-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Streamline AsyncShardFetch#getNumberOfInFlightFetches #96545
Streamline AsyncShardFetch#getNumberOfInFlightFetches #96545
Conversation
Avoids an O(#nodes) iteration by tracking the number of fetches directly. Backport of elastic#93632 to 7.17
This backports cleanly and is a good improvement in large clusters. We've seen no related trouble since it was introduced in 8.5 so I see no good reason not to backport it, but just checking with @henningandersen before I merge it. |
Correction, sorry, this was only introduced in 8.8 (I was thinking of #96546). But IMO the assertions in this area are good and we haven't seen any related test failures since it was merged. |
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.
Notice that this landed in 8.8, not 8.5 AFAICS?
Feel free to omit my nit if you prefer a clean backport.
@@ -131,7 +128,7 @@ public synchronized FetchResult<T> fetchData(DiscoveryNodes nodes, Set<String> i | |||
} | |||
|
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: ideally we'd also assert consistency between fetchingCount
and cache
here (or inside the brace one line up).
assert assertFetchingCountConsistent(); |
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.
++ thanks, yes that'd make sense. I'll do that in a follow up (and apply it in main
too)
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.
see #96553
Avoids an O(#nodes) iteration by tracking the number of fetches directly.
Backport of #93632 to 7.17