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

Setting number_of_replicas on a closed index can put it in an unopenable state #9566

Closed
nik9000 opened this issue Feb 4, 2015 · 5 comments · Fixed by #11410
Closed

Setting number_of_replicas on a closed index can put it in an unopenable state #9566

nik9000 opened this issue Feb 4, 2015 · 5 comments · Fixed by #11410

Comments

@nik9000
Copy link
Member

nik9000 commented Feb 4, 2015

From an irc conversation, someone did this:

curl -XPUT "localhost:9200/my_index/_settings" -d '{
  "index": {
    "number_of_replicas": 0
  }
}'
curl -XPOST "localhost:9200/my_index/_close"
curl -XPUT "localhost:9200/my_index/_settings" -d '{
  "index": {
    "number_of_replicas": 2
  }
}'
curl -XPOST "localhost:9200/my_index/_open"

and the index wouldn't open properly. Setting number_of_replicas back to 0 and then opening the index, and then setting number_of_replicas to 2 fixed the issue. It'd be nice if setting the number_of_replicas to something that prevents the index from opening wasn't possible.

@clintongormley
Copy link

Hmm agreed... although I'm not sure how easy it would be to do. While the index is closed, we don't keep track of where or how many shards there are I believe.

@nik9000
Copy link
Member Author

nik9000 commented Feb 5, 2015

Yeah- I dunno. Maybe its better to just stop all replica count changes on
closed indexes or only allow it with some dangerous=OK flag or something.

Or more documentation but I doubt that's enough.
On Feb 5, 2015 8:48 AM, "Clinton Gormley" notifications@github.com wrote:

Hmm agreed... although I'm not sure how easy it would be to do. While the
index is closed, we don't keep track of where or how many shards there are
I believe.


Reply to this email directly or view it on GitHub
#9566 (comment)
.

@jpountz
Copy link
Contributor

jpountz commented Feb 6, 2015

Or more documentation but I doubt that's enough.

Not sure how hard it is to fix but agreed that we should document this behaviour until it's fixed.

@bleskes
Copy link
Contributor

bleskes commented Feb 6, 2015

I tend to say that we should forbid changing these settings while the index is closed as it is not clear what the effect of it would be. I also can't think of a use case where it will be helpful. I briefly looked at the code and it looks easy to add a black list of settings for closed indices.

cbuescher pushed a commit that referenced this issue Feb 6, 2015
…s on a closed index

Issue #9566 raises the point that setting the number of shards on a closed index can lead to this index not beeing able to open again. This change in documentation is ment to warn the user about this issue.
cbuescher pushed a commit that referenced this issue Feb 6, 2015
…s on a closed index

Issue #9566 raises the point that setting the number of shards on a closed index can lead to this index not beeing able to open again. This change in documentation is ment to warn the user about this issue.
cbuescher pushed a commit that referenced this issue Feb 6, 2015
…s on a closed index

Issue #9566 raises the point that setting the number of shards on a closed index can lead to this index not beeing able to open again. This change in documentation is ment to warn the user about this issue.
@s1monw
Copy link
Contributor

s1monw commented Feb 13, 2015

@bleskes +1 on not allowing to change these settings! Can you open a PR for this? I think the fact that you can do this is actually a bug?

s1monw added a commit to s1monw/elasticsearch that referenced this issue May 29, 2015
Setting the number of replicas on a closed index can leave the index
in an unopenable state since we might not be able to recover a quorum.
This commit simply prevents updating this setting on a closed index.

Closes elastic#9566
@s1monw s1monw self-assigned this May 29, 2015
s1monw added a commit to s1monw/elasticsearch that referenced this issue May 29, 2015
Setting the number of replicas on a closed index can leave the index
in an unopenable state since we might not be able to recover a quorum.
This commit simply prevents updating this setting on a closed index.

Closes elastic#9566
s1monw added a commit that referenced this issue May 29, 2015
Setting the number of replicas on a closed index can leave the index
in an unopenable state since we might not be able to recover a quorum.
This commit simply prevents updating this setting on a closed index.

Closes #9566

Conflicts:
	src/main/java/org/elasticsearch/cluster/metadata/MetaDataUpdateSettingsService.java
	src/test/java/org/elasticsearch/indices/IndicesOptionsIntegrationTests.java
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
…s on a closed index

Issue elastic#9566 raises the point that setting the number of shards on a closed index can lead to this index not beeing able to open again. This change in documentation is ment to warn the user about this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants