Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ setup:
---
"Create a snapshot and then restore it":

- skip:
version: "all"
reason: "AwaitsFix https://github.com/elastic/elasticsearch/issues/64152"

- do:
snapshot.create:
repository: test_repo_restore_1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,17 @@ public ClusterState execute(ClusterState currentState) {
aliases.add(alias.value);
}
}
indexMdBuilder.settings(Settings.builder()
.put(snapshotIndexMetadata.getSettings())
.put(IndexMetadata.SETTING_INDEX_UUID, currentIndexMetadata.getIndexUUID())
.put(IndexMetadata.SETTING_HISTORY_UUID, UUIDs.randomBase64UUID()));
final Settings.Builder indexSettingsBuilder = Settings.builder()
.put(snapshotIndexMetadata.getSettings())
.put(IndexMetadata.SETTING_INDEX_UUID, currentIndexMetadata.getIndexUUID());
// Only add a restore uuid if either all nodes in the cluster support it (version >= 7.9) or if the
// index itself was created after 7.9 and thus won't be restored to a node that doesn't support the
// setting anyway
if (snapshotIndexMetadata.getCreationVersion().onOrAfter(Version.V_7_9_0) ||
currentState.nodes().getMinNodeVersion().onOrAfter(Version.V_7_9_0)) {
indexSettingsBuilder.put(SETTING_HISTORY_UUID, UUIDs.randomBase64UUID());
}
indexMdBuilder.settings(indexSettingsBuilder);
IndexMetadata updatedIndexMetadata = indexMdBuilder.index(renamedIndexName).build();
rtBuilder.addAsRestore(updatedIndexMetadata, recoverySource);
blocks.updateBlocks(updatedIndexMetadata);
Expand Down