-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Clone index does not keep "number_of_replicas" setting, nor it respects index templates #74135
Comments
This behaviour is by design, and the note in the docs that says "Cloning doesn’t copy index metadata..." is intended to describe it, but I agree it could be clearer. Especially we should note that index templates have no impact on cloning. Marking this as a docs bug. |
Pinging @elastic/es-docs (Team:Docs) |
Pinging @elastic/es-core-features (Team:Core/Features) |
In the PR you did you added At the moment I'm handling copying the number_of_replicas manually app-side, but I can't be sure if there aren't any other settings that are not being copied over as well. Perhaps you should make it more explicit exactly what is copied and what is not. |
Sorry, it seems I've misread the code, I have just discovered a whole load of complications and it seems to vary by version. Let me investigate further what it's supposed to be doing. |
Ok sorry for the confusion, as per #28347 these days we apparently do copy most of the settings over. The only ones that look to be overridden are Lines 794 to 799 in 393ab2d
There's a bunch of other private settings that are also not being copied, but that's deliberate and they don't matter to end-users anyway. I'll correct the docs PR that James made. |
@DaveCTurner closed this with #74175. Thanks again! |
I am not sure it's deliberate that clones always have exactly one replica by default, at least I find that a bit surprising given that other settings are copied over, and I think we might want to consider this a bug. I opened #74615 to discuss whether we want to do anything further on this front. I didn't reopen this thread since I didn't want the discussion to dwell on the point about index templates raised here. |
Elasticsearch version (
bin/elasticsearch --version
): 7.12.1Description of the problem including expected versus actual behavior:
There could as well be 2 unrelated problems:
When cloning an index,
number_of_replicas
of the target index is not kept the same as the source index.If there is an index template that sets the
number_of_replicas
to 0, this is being ignored as well, although the target index name matches the template patternSteps to reproduce:
Observe that number_of_replicas = 0, as expected.
Observe that number_of_replicas = 1, so the value was neither copied over from the source index, nor the index template was respected.
The text was updated successfully, but these errors were encountered: