-
Notifications
You must be signed in to change notification settings - Fork 693
Apply number_of_replicas and number_of_shards ES/OS configuration changes #36680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
4c238b9
to
889bf2f
Compare
dff82f2
to
879575d
Compare
…uration when it changes
879575d
to
7b0d419
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces dynamic application of number_of_replicas
and number_of_shards
configuration changes for Elasticsearch and OpenSearch implementations across both Operate and Tasklist applications. The changes enable automatic updates to index settings and templates at application startup when schema creation and the new updateSchemaSettings
property are enabled.
Key Changes:
- Added
updateIndexSettings()
method to schema managers that updates existing indices, index templates, and component templates with current configuration values - Introduced new
updateSchemaSettings
configuration property to control when schema settings updates should be applied - Aligned Elasticsearch and OpenSearch implementations to consistently set index template settings regardless of default values
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
operate/schema/src/main/java/io/camunda/operate/schema/SchemaStartup.java |
Integrates the new updateIndexSettings() call into the schema initialization process |
operate/schema/src/main/java/io/camunda/operate/schema/SchemaManager.java |
Adds the updateIndexSettings() method interface and related constants |
operate/schema/src/main/java/io/camunda/operate/schema/elasticsearch/ElasticsearchSchemaManager.java |
Implements comprehensive index settings update logic for Elasticsearch |
operate/schema/src/main/java/io/camunda/operate/schema/opensearch/OpensearchSchemaManager.java |
Implements comprehensive index settings update logic for OpenSearch |
operate/common/src/main/java/io/camunda/operate/property/ElasticsearchProperties.java |
Adds updateSchemaSettings configuration property |
operate/common/src/main/java/io/camunda/operate/property/OpensearchProperties.java |
Adds updateSchemaSettings configuration property |
operate/common/src/main/java/io/camunda/operate/property/OperateElasticsearchProperties.java |
Adds helper methods for retrieving per-index settings |
operate/common/src/main/java/io/camunda/operate/property/OperateOpensearchProperties.java |
Adds helper methods for retrieving per-index settings |
tasklist/els-schema/src/main/java/io/camunda/tasklist/schema/manager/ElasticsearchSchemaManager.java |
Implements index template settings update for Tasklist Elasticsearch |
tasklist/els-schema/src/main/java/io/camunda/tasklist/schema/manager/OpenSearchSchemaManager.java |
Implements index template settings update for Tasklist OpenSearch |
Test files | Extensive integration tests covering the new functionality across both Elasticsearch and OpenSearch |
Comments suppressed due to low confidence (1)
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know this part of Operate/Tasklist very well but the changes seem reasonable to me and I mostly get confidence because the new tests are broad and thorough in the behaviour that they are testing.
Some possible improvements could be made to remove the duplication but this doesn't feel necessary so I overlooked it as part of this review.
Functionally, really just one question about NPEs (that also applies in other files, just only marked it in one place). Otherwise, great job in finding and implementing a solution here 🎉
indexTemplate = | ||
retryElasticsearchClient.getIndexTemplate(templateDescriptor.getTemplateName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Can this ever be null
? It would NPE if so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it cannot be null because retryElasticsearchClient is used.
If the index template is not found for any reason, the client will retry until it becomes available, otherwise an exception will be thrown, if the max retries is reached,
This handles the edge case that can occur immediately after an index template is created, when some nodes may not yet return the template.
b9aa41a
to
c08da9f
Compare
Successfully created backport PR for |
This pull request introduces support for dynamic application of
number_of_replicas
andnumber_of_shards
configuration changes at application startup, ensuring consistent schema management across Elasticsearch and OpenSearch implementations for both Operate and Tasklist.New
updateIndexSettings()
method in the schema manager that runs on application startup when bothcamunda.operate.elasticsearch.createSchema
and the newcamunda.operate.elasticsearch.updateSchemaSettings
properties are enabledDynamic index updates: automatically updates the replicas count of all existing indices using either global replica configuration or per-index specific configuration
Index Templates: updates shards/replicas count settings in index templates to match current configuration values (global or per-index)
Component template: updates the
operate_component
component template settings with current global shards/replicas configurationImplementation Consistency: aling behavior between Elasticsearch and OpenSearch implementations. Previously, Elasticsearch always set shards/replicas at index template level while OpenSearch only set them when different from defaults, both implementations now consistently set index template settings regardless of default values, this is consistent with 8.8 implementation
Testing Infrastructure:
there was a discrepency between Elasticsearch and Opensearch implementation: for Elasticsearch, the shards/replicas settings are always set at index template level, while for Opensearch they are set only when different from the default global configuration. Aligned both implementations to always set the index template settings (also for Tasklist) , this will be also the behavior of 8.8
Expanded the integration
operateItOpensearch
test profile inoperate/pom.xml
to include schema-related tests to be run in Opensearch IT tests.Description
Checklist
Related issues
closes #32872