-
Notifications
You must be signed in to change notification settings - Fork 25k
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
[8.x] Allow archive and searchable snapshots indices in N-2 version #118923
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a637679
Allow read-only compatible indices
tlrx 495fa0f
Merge branch '8.x' into 2024/12/18/ES-10274-8.x
tlrx 3225afe
Merge branch '8.x' into 2024/12/18/ES-10274-8.x
tlrx 88dd29b
assert
tlrx 0a14878
Merge branch '8.x' into 2024/12/18/ES-10274-8.x
tlrx de408ac
Merge branch '8.x' into 2024/12/18/ES-10274-8.x
tlrx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1315,6 +1315,7 @@ public ClusterState execute(ClusterState currentState) { | |
final Map<ShardId, ShardRestoreStatus> shards = new HashMap<>(); | ||
|
||
final IndexVersion minIndexCompatibilityVersion = currentState.getNodes().getMinSupportedIndexVersion(); | ||
final IndexVersion minReadOnlyIndexCompatibilityVersion = currentState.getNodes().getMinReadOnlySupportedIndexVersion(); | ||
final String localNodeId = clusterService.state().nodes().getLocalNodeId(); | ||
for (Map.Entry<String, IndexId> indexEntry : indicesToRestore.entrySet()) { | ||
final IndexId index = indexEntry.getValue(); | ||
|
@@ -1327,12 +1328,16 @@ public ClusterState execute(ClusterState currentState) { | |
request.indexSettings(), | ||
request.ignoreIndexSettings() | ||
); | ||
if (snapshotIndexMetadata.getCompatibilityVersion().before(minIndexCompatibilityVersion)) { | ||
if (snapshotIndexMetadata.getCompatibilityVersion().isLegacyIndexVersion()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, it does not have an impact on 8.x but makes the code look similar to main. |
||
// adapt index metadata so that it can be understood by current version | ||
snapshotIndexMetadata = convertLegacyIndex(snapshotIndexMetadata, currentState, indicesService); | ||
} | ||
try { | ||
snapshotIndexMetadata = indexMetadataVerifier.verifyIndexMetadata(snapshotIndexMetadata, minIndexCompatibilityVersion); | ||
snapshotIndexMetadata = indexMetadataVerifier.verifyIndexMetadata( | ||
snapshotIndexMetadata, | ||
minIndexCompatibilityVersion, | ||
minReadOnlyIndexCompatibilityVersion | ||
); | ||
} catch (Exception ex) { | ||
throw new SnapshotRestoreException(snapshot, "cannot restore index [" + index + "] because it cannot be upgraded", ex); | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Ok, up to you!