Repository navigation
Consolidate tserver tablet assignment state into TabletAssignmentTracker - #6621
Open
DomGarguilo wants to merge 2 commits into
Open
DomGarguilo wants to merge 2 commits into
DomGarguilo wants to merge 2 commits into
Conversation
Co-authored-by: Claude Opus 5.5
dlmarion
reviewed
Oct 29, 2026
Comment on lines
+119
to
+120
| waiter.start(); | ||
| waiter.join(100); |
Contributor
There was a problem hiding this comment.
I don't think it's guaranteed that the thread has actually started running here. I typically handle this by waiting on a CountDownLatch, and call countDown in Thread.run.
Member
Author
There was a problem hiding this comment.
Yea I think you're right. A latch would still leave a gap though before wait() so I just opted for a polling loop to wait until the thread is WAITING. Also added a @Timeout to the test case to protect against that loop. I tried removing the notifyAll call temporarily and the test failed so I think things are correct here now.
dlmarion
approved these changes
Oct 30, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #6587
Moves the tserver's unopened, opening, and online tablet collections into a new
TabletAssignmentTrackerthat owns them behind a single private lock. Callers use namedatomic transitions (
addUnopenedIfNoOverlap,unopenedToOpening,openingToOnline,awaitNotOpening, ...) instead of synchronizing onTabletServerfields. This resolves the11
USO_UNSAFE_OBJECT_SYNCHRONIZATIONfindings from SpotBugs 4.10, removes the three-levellock ordering, and makes the assignment state machine unit-testable.
OnlineTabletsisfolded into the tracker.
Most of the tracker is existing logic moved as-is. To see only the real changes:
git diff --color-moved=dimmed-zebra --color-moved-ws=allow-indentation-change upstream/2.1...unifiedLockingBehavior changes
loadTabletoverlap error logging runs after the lock is released, using tablets capturedunder the lock. Its output is unchanged.
Testing: new
TabletAssignmentTrackerTest; tserver unit tests;-PsunnyITs; SpotBugs4.9.8 and 4.10.5 (the 11 findings are gone).
Co-authored-by: Claude Opus 5.5