-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add test for deprecated index settings in N-2 indices #122493
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
Add test for deprecated index settings in N-2 indices #122493
Conversation
|
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
…estCase testClosedIndexUpgrade {p0=[9.1.0, 9.1.0, 9.1.0]} elastic#122495
…mpatibilityIT testSearchableSnapshotUpgrade {p0=[9.1.0, 8.19.0, 8.19.0]} elastic#122500
…mpatibilityIT testMountSearchableSnapshot {p0=[9.1.0, 9.1.0, 8.19.0]} elastic#122501
…mpatibilityIT testMountSearchableSnapshot {p0=[9.1.0, 8.19.0, 8.19.0]} elastic#122502
…mpatibilityIT testSearchableSnapshotUpgrade {p0=[9.1.0, 9.1.0, 8.19.0]} elastic#122503
…mpatibilityIT testMountSearchableSnapshot {p0=[9.1.0, 9.1.0, 9.1.0]} elastic#122504
…mpatibilityIT testSearchableSnapshotUpgrade {p0=[9.1.0, 9.1.0, 9.1.0]} elastic#122505
| assertIndexSetting(index, VERIFIED_BEFORE_CLOSE_SETTING, is(isClosed)); | ||
| assertIndexSetting(index, VERIFIED_READ_ONLY_SETTING, is(true)); | ||
|
|
||
| var blocks = indexBlocks(index).stream().filter(c -> c.equals(INDEX_WRITE_BLOCK) || c.equals(INDEX_READ_ONLY_BLOCK)).toList(); |
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.
There are parts of code in common between this test class and RollingUpgradeDeprecatedSettingsIT, such as the following code block. We can export methods to the parent class for the duplicated code.
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.
Sure, I will take a look what makes most sense here.
| .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) | ||
| .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) | ||
| // add some index settings deprecated in v7 | ||
| .put(MapperService.INDEX_MAPPER_DYNAMIC_SETTING.getKey(), true) |
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.
Is it worth checking the behavior of each deprecated setting? For example, to verify that a new field is added to the mapping when index. mapper.dynamic: true, etc.
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 think so, any of these settings shouldn't be used any longer and most of the times we're not even evaluating their setting in production code anywhere (e.g. "index.mapper.dynamic" hasn't been used since #109160 but having the setting in the mapping has created issues in the past). This test merely should assure that we tolerate any of these settings when moving to 9 but not necessarily that any legacy functionality attached to them is still working (which most of the time isn't)
|
@drempapis thanks for the review, I left a note and moved some common test code up to a shared parent class. I didn't opt for making the new test a sub-class of the existing |
|
@drempapis I'm still considering merging this. Any other suggestions or concerns from your end? |
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.
LGTM! thank you @cbuescher for this update
|
@drempapis thanks for the review |
💚 Backport successful
|
This change adds a new rolling upgrade test that checks having certain deprecated index settings present in an N-2 index doesn't prevent the index from being opened in the current version. The deprecated settings specifically tested here are: * index.mapper.dynamic * index.max_adjacency_matrix_filters * index.force_memory_term_dictionary * index.soft_deletes.enabled
) This change adds a new rolling upgrade test that checks having certain deprecated index settings present in an N-2 index doesn't prevent the index from being opened in the current version. The deprecated settings specifically tested here are: * index.mapper.dynamic * index.max_adjacency_matrix_filters * index.force_memory_term_dictionary * index.soft_deletes.enabled
This change adds a new rolling upgrade test that checks having certain deprecated index settings present in an N-2 index doesn't prevent the index from being opened in the current version. The deprecated settings specifically tested here are: * index.mapper.dynamic * index.max_adjacency_matrix_filters * index.force_memory_term_dictionary * index.soft_deletes.enabled
This change adds a new rolling upgrade test that checks having certain deprecated
index settings present in an N-2 index doesn't prevent the index from being opened
in the current version. The deprecated settings specifically tested here are:
Even though that list is not exhaustive of deprecated settings it covers some of the
ones that appeared in several discussions and have been of interest in the past.