[8.x] Allow archive and searchable snapshots indices in N-2 version#118923
[8.x] Allow archive and searchable snapshots indices in N-2 version#118923tlrx merged 6 commits intoelastic:8.xfrom
Conversation
ba74897 to
8ecac81
Compare
Relates ES-10274
8ecac81 to
a637679
Compare
|
|
||
| public boolean isLegacyIndexVersion() { | ||
| return before(IndexVersions.MINIMUM_COMPATIBLE); | ||
| return before(IndexVersions.MINIMUM_READONLY_COMPATIBLE); |
There was a problem hiding this comment.
On 8.18, MINIMUM_COMPATIBLE is equal to MINIMUM_READONLY_COMPATIBLE as there is no N-2 support, but I changed it here to make it uniform with 9.x.
There was a problem hiding this comment.
I wonder about this. Why do we need MINIMUM_READONLY_COMPATIBLE in 8.x if it's the same as MINIMUM_COMPATIBLE? It seems like the code in 8.x could be much simpler, although it would diverge from main? Anything I am missing?
There was a problem hiding this comment.
No you're not missing anything. Keeping the code similar on both branches helps for backporting changes and I suspect we will have more things to backport in a short future.
| request.ignoreIndexSettings() | ||
| ); | ||
| if (snapshotIndexMetadata.getCompatibilityVersion().before(minIndexCompatibilityVersion)) { | ||
| if (snapshotIndexMetadata.getCompatibilityVersion().isLegacyIndexVersion()) { |
There was a problem hiding this comment.
Similarly, it does not have an impact on 8.x but makes the code look similar to main.
henningandersen
left a comment
There was a problem hiding this comment.
LGTM.
I think this can go in independently of the 9.0 change?
| .settings( | ||
| Settings.builder() | ||
| .put(INDEX_STORE_TYPE_SETTING.getKey(), SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE) | ||
| .put(IndexMetadata.SETTING_VERSION_CREATED, IndexVersions.MINIMUM_READONLY_COMPATIBLE) |
There was a problem hiding this comment.
Got fooled here, I wonder if you should comment (or assert) that readonly==regular compatibility to explain to reader?
|
Thanks for the quick review!
I think so, if we are OK leaving a time window (until the 9.0 change is merged) during which indices can be accepted without being really supported on 9.0. |
Ah, right, let us hold off on it then until both are ready - unless you need to build on top of it? |
|
Thanks Henning & Luca! |
This change (along with the required change #118923 for 8.18) relaxes the index compatibility version checks to allow archive and searchable snapshot indices in version N-2 to exist on a 9.x cluster. Relates ES-10274
This is the backport of #118941 for 8.18.
This change relaxes the index compatibility version checks to allow archive and searchable snapshot indices in version N-2 to exist on a 9.x cluster. It uses the min. read-only index compatible version added in #118884 to accept join requests from 9.x nodes that can read indices created in version 7.x (N-2) as long as they have a write block and are either archive or searchable snapshot indices.
Relates ES-10274