-
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
Default to zero replicas for searchable snapshots #57802
Default to zero replicas for searchable snapshots #57802
Conversation
Today a mounted searchable snapshot defaults to having the same replica configuration as the index that was snapshotted. This commit changes this behaviour so that we default to zero replicas on these indices, but allow the user to override this in the mount request. Relates elastic#50999
Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore) |
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 - I left some minor comments in tests
@@ -153,6 +154,9 @@ public void testCreateAndRestoreSearchableSnapshot() throws Exception { | |||
new ByteSizeValue(randomLongBetween(10, 100_000)) | |||
); | |||
} | |||
if (randomBoolean()) { |
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 we capture the number of replica that it randomly set and checks once the index is mounted that it corresponds?
.cluster() | ||
.preparePutRepository(fsRepoName) | ||
.setType("fs") | ||
.setSettings(Settings.builder().put("location", repo).put("chunk_size", randomIntBetween(100, 1000), ByteSizeUnit.BYTES)) |
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.
The chunk_size can introduces many more writes and files, so maybe we can jut remove for this test?
final Settings.Builder originalIndexSettings = Settings.builder(); | ||
originalIndexSettings.put(INDEX_SOFT_DELETES_SETTING.getKey(), true); | ||
if (randomBoolean()) { | ||
originalIndexSettings.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, between(0, dataNodesCount - 1)); |
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 think we can use minimumNumberOfReplicas / maximumNumberOfReplicas here?
Today a mounted searchable snapshot defaults to having the same replica configuration as the index that was snapshotted. This commit changes this behaviour so that we default to zero replicas on these indices, but allow the user to override this in the mount request. Relates #50999
Today a mounted searchable snapshot defaults to having the same replica
configuration as the index that was snapshotted. This commit changes this
behaviour so that we default to zero replicas on these indices, but allow the
user to override this in the mount request.
Relates #50999