-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[BUG] The split index's shards cannot be assigned because of the source index's index.blocks.read_only setting #4845
Comments
@nandi-github Could you look into this? |
From the code I found that there is a block check, but it's useless because the new split index has not been created yet: Line 128 in 31bcda6
So maybe we should check the MATADATA_WRITE block when creating the new split index, like this:OpenSearch/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java Line 1314 in 31bcda6
I think we can throw an
For another situation, if the source index's setting @nandi-github may I know your opinion about this? |
Signed-off-by: Gao Binlong <[email protected]>
* Add more index blocks check for resize APIs (#4845) Signed-off-by: Gao Binlong <[email protected]> * modify change log Signed-off-by: Gao Binlong <[email protected]> * Rewording the error message Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]>
* Add more index blocks check for resize APIs (#4845) Signed-off-by: Gao Binlong <[email protected]> * modify change log Signed-off-by: Gao Binlong <[email protected]> * Rewording the error message Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]> (cherry picked from commit 170dcef) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…7601) * Add more index blocks check for resize APIs (#4845) (#6774) * Add more index blocks check for resize APIs (#4845) Signed-off-by: Gao Binlong <[email protected]> * modify change log Signed-off-by: Gao Binlong <[email protected]> * Rewording the error message Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]> (cherry picked from commit 170dcef) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update REST API spec tests version ranges Signed-off-by: Andriy Redko <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Andriy Redko <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Andriy Redko <[email protected]>
…opensearch-project#6774) * Add more index blocks check for resize APIs (opensearch-project#4845) Signed-off-by: Gao Binlong <[email protected]> * modify change log Signed-off-by: Gao Binlong <[email protected]> * Rewording the error message Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]>
…opensearch-project#6774) * Add more index blocks check for resize APIs (opensearch-project#4845) Signed-off-by: Gao Binlong <[email protected]> * modify change log Signed-off-by: Gao Binlong <[email protected]> * Rewording the error message Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]> Signed-off-by: Shivansh Arora <[email protected]>
Describe the bug
When executing Split API , if we set the
index.blocks.read_only
setting of the source index totrue
, then the Split API responds slowly and finally return anaction_request_validation_exception
with 400 status code, but the new splitted index is created and only part of the new shards are STARTED, so the new split index's health isred
. By checking the log, it shows that the unassigned shards cannot be recovered because the new split index has a read_only block:Caused by: org.opensearch.cluster.block.ClusterBlockException: index [index111] blocked by: [FORBIDDEN/5/index read-only (api)]
I think it means that the new spit index's settings are copied from the source index, so the
index.blocks.read_only
setting of the new spit index istrue
. After changing the setting tofalse
and executingPOST _cluster/reroute?retry_failed=true
to retry recovering the unassigned shards, the new spit index's health then becamegreen
.So, should we add more validations for Split & Shrink & Clone API ? Maybe we can throw an
action_request_validation_exception
with 400 when the source index'sindex.blocks.read_only
orindex.blocks.metadata
setting was set totrue
.Besides, why only parts of new spit index's shards are assigned and in
STARTED
status? That's really confused and there might be some other underlying problems.To Reproduce
Steps to reproduce the behavior:
index.blocks.read_only
setting totrue
the response is:
we can see that only parts of the new shards are
STARTED
and the new index's health isred
.Expected behavior
Add more validations for Split & Shrink & Clone API to avoid the above situation.
Host/Environment (please complete the following information):
The opensearch version is 2.3.
The text was updated successfully, but these errors were encountered: