When using the official Python client, I can't seem to find a way to change an index to normal "read-write" status once it's been marked "read_only".
This function works fine to go from read-write to read_only, but I was unable to identify any method to reverse it.
I can accomplish this in curl with something like the following: curl -s -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -X PUT http://localhost:9200/my-index-2020.09/_settings -d '{ "index": { "blocks.read_only": false } }'
Thanks for any pointers you might have on this one!
Hmm, ok. Curious why setting the read-only would be supported but not the reverse. Especially since the action can be done via curl. (Suggesting to me that the python client is returning the denial rather than ES itself, but I admit that's speculation.)
I'm kind of hoping not to write a python script that can do everything except reverting to R-W, which has to be done via a subprocess call to curl.
We were able to solve this issue, there was a typo in the request using the Python client attempting to set the blocks.read_only setting instead of the full index.blocks.read_only setting. Combine that with Elasticsearch favoring raising the "this index is read-only" error over the "this setting doesn't exist" error.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.