Skip to content
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

Conversation

DaveCTurner
Copy link
Contributor

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 elastic#50999
@DaveCTurner DaveCTurner added >enhancement :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v8.0.0 v7.9.0 labels Jun 8, 2020
@DaveCTurner DaveCTurner requested a review from tlrx June 8, 2020 10:36
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore)

@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Jun 8, 2020
Copy link
Member

@tlrx tlrx left a 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()) {
Copy link
Member

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))
Copy link
Member

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));
Copy link
Member

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?

@DaveCTurner DaveCTurner merged commit 57dea5e into elastic:master Jun 16, 2020
@DaveCTurner DaveCTurner deleted the 2020-06-08-searchable-snapshot-defaults-to-no-replicas branch June 16, 2020 08:47
DaveCTurner added a commit that referenced this pull request Jun 16, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >enhancement Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v7.9.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants