Make Resource Group operations executed in SingleThreadExecutor #18669
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.
Problem description
Presently, all operations on Resource Group tree-like data structure are protected by the root group monitor. That makes all operation are blockable. Essentially, these operations are the bottleneck for the Coordinator. It limits the number of queries that could be admitted by Coordinator. Additionally, those operations are invoked from many different threads that could be scheduled on different cores. That hurts the performance of those operations due to the necessity of running costly cache coherence operations to invalidate local caches on different hardware cores. That limits the bandwidth on operations over Resource Groups.
Proposed solution
move all the operations on the resource group tree to a single thread (using Single Threaded Executor) that opens the opportunity for Lock Elision. Additionally, this solution enables changing the priority of the executor thread and further speed up the resource group operations.
Test plan - (Please fill in how you tested your changes)
Please make sure your submission complies with our Development, Formatting, and Commit Message guidelines. Don't forget to follow our attribution guidelines for any code copied from other projects.
Fill in the release notes towards the bottom of the PR description.
See Release Notes Guidelines for details.
If release note is NOT required, use: