-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[8.x] Forbid the removal of the write block if the index is read-only
#120647
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
[8.x] Forbid the removal of the write block if the index is read-only
#120647
Conversation
| if (blocks.hasIndexBlock(index, block)) { | ||
| blocks.removeIndexBlock(index, block); | ||
| changed = true; | ||
| if (block.contains(ClusterBlockLevel.WRITE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In relation to my comment on the v9 PR, just noting that this should follow whatever we do on that PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the behavior in the V9 PR and here, see this comment
b418880 to
7d57b16
Compare
114ae6e to
e84ed85
Compare
|
This is ready for another review, the behavior has been updated and is described in this comment. |
henningandersen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
| private static void verifyReadOnlyIndices(@Nullable Set<Index> readOnlyIndices, ClusterBlocks blocks) { | ||
| if (readOnlyIndices != null) { | ||
| for (Index readOnlyIndex : readOnlyIndices) { | ||
| if (blocks.indexBlocked(ClusterBlockLevel.WRITE, readOnlyIndex.getName()) == false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the 9.0 PR, I think we should use the new hasIndexBlockLevel here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I pushed 66325bf (use hasIndexBlockLevel at the ClusterBlocks level, while the other is at the Builder level).
|
Thanks Henning! |
) Ensure that a `write` block cannot be removed on a read-only compatible index in version N-2, while allowing to change a `read_only` block into a `write` block if needed as well as closing/reopening such indices. Requires #120647 to be merged on `8.x`. Relates ES-10320
Forbids on
8.xthe removal/update of awriteblock if at least one node of the cluster cannot write the index.Backport of #120648 for 8.18.
Relates ES-10320