Skip to content

Can't remap index alias pointing to read-only index #1762

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

Closed
outoftime opened this issue Mar 6, 2012 · 3 comments
Closed

Can't remap index alias pointing to read-only index #1762

outoftime opened this issue Mar 6, 2012 · 3 comments

Comments

@outoftime
Copy link

See reduction (download):

curl -XDELETE http://localhost:9200/test1?pretty=true
echo ''
curl -XDELETE http://localhost:9200/test2?pretty=true
echo ''
curl -XPUT http://localhost:9200/test1?pretty=true -d '{}'
echo ''
curl -XPOST http://localhost:9200/_aliases?pretty=true -d '{"actions":[{"add":{"index":"test1","alias":"test"}}]}'
echo ''
curl -XPUT http://localhost:9200/test2?pretty=true -d '{}'
echo ''
curl -XPUT http://localhost:9200/test1/_settings?pretty=true -d '{"index":{"blocks":{"read_only":true}}}'
echo ''
curl -XPOST http://localhost:9200/_aliases?pretty=true -d '{"actions":[{"remove":{"index":"test1","alias":"test"}},{"add":{"index":"test2","alias":"test"}}]}'
echo ''
@kimchy
Copy link
Member

kimchy commented Mar 7, 2012

Mmm, the problem here is that read_only was defined as not being allowed to "write" or do "metadata" changes to the index. Adding an alias constitutes metadata change... . It makes sense (though it could have easily been defined the to only disallow writes), and I am reluctant to change it now.

We can potentially add another option, like disable writes, but it feels like its going to be confusion. Not sure what the best answer for this is currently...

@outoftime
Copy link
Author

Gotcha. I also noticed that doing e.g. a DELETE / fails if any of your indexes are read-only. This makes sense given your definition of "readonly", but for what it's worth, I think a "disable writes" would be much more useful than the read-only functionality as currently defined...

@kimchy
Copy link
Member

kimchy commented Mar 8, 2012

Opened #1771, which will resolve this one.

@kimchy kimchy closed this as completed Mar 8, 2012
tvernum pushed a commit that referenced this issue Feb 25, 2025
Merge main into multi-project 2024-11-07T10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants