Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Auto-release of read-only-allow-delete block when disk utilization fa… #42559
Auto-release of read-only-allow-delete block when disk utilization fa… #42559
Changes from 6 commits
c90c84f
92e7d7b
569e8cc
ce28f9e
3a1402a
ca5cfa0
041e7a8
6d4228a
0b6440e
84ec0c6
a6334c8
2444c6d
da31384
7914860
bd6a990
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
As far as I can tell this does essentially the same thing as the loop on lines 161-163.
indicesToMarkIneligibleForAutoRelease
ends up beingindicesToMarkReadOnly
plus any indices with shards on nodes for whom we don't know the disk usage. I think it'd be simpler to use this fact in the calculation ofindicesToAutoRelease
below rather than constructing these two almost-identical sets.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.
Apologies, I see the difference now, we're looking at the
high
thresholds not theflood_stage
thresholds. Still, I think we should combine this with the other check on thehigh
thresholds below.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.
Here is the definition of each
I think each of them are clear and distinctly represent a set. Any changes that we do will affect readability.
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 think it's far too early to declare that this is the most readable solution we can find. A case in point: you see my earlier confusion about which thresholds this condition is checking. Also, we're duplicating a rather complicated condition that appears a few lines lower down too. Also we're not marking any indices as ineligible for auto-release so the name of that set is a bit odd. Let's call that something like
indicesNotToAutoRelease
.In
master
, this method flows through the thresholds in a much more obvious manner: work on nodes above theflood_stage
watermark, then nodes betweenhigh
andflood_stage
, then nodes betweenlow
andhigh
and finally nodes belowlow
. I think it'd be much better to fit into this flow. Why not add indices toindicesNotToAutoRelease
in the existing loop in the first block, and have a similar loop in the second block for nodes between thehigh
andflood_stage
watermarks?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 think I meant about the sets in specific which are well-defined and not the logic in general. I have simplified the if-block which I agree is the right thing to do