-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Expose merge events and their memory usage estimate #126667
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
Conversation
11667b7
to
6fffd73
Compare
6fffd73
to
643979c
Compare
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.
Moved this out of stateless.
Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing) |
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.
@@ -449,6 +462,14 @@ long estimatedMergeSize() { | |||
return onGoingMerge.getMerge().getStoreMergeInfo().estimatedMergeBytes(); | |||
} | |||
|
|||
public long getEstimateMergeMemoryBytes() { |
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.
nit: I'd prefer to call this getMergeMemoryEstimateBytes()
, similar to the provider (also rename various variales).
I've added 3724a21 as a simple way to make sure abort/complete listeners are not called before queued listeners for a given merge. |
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'd like to ensure ordering differently if possible?
|
||
private void enqueueMergeTask(MergeTask mergeTask) { | ||
synchronized (mergeEventsMutex) { | ||
if (queuedMergeTasks.add(mergeTask)) { |
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 we can assert that it always returns true instead, thus avoid the if-statement, invoke the listener before adding and thus avoid the synchronized?
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.
Sure. See ba7ebb5. This doesn't change anything in the stateless PR though.
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.
Relates ES-10961