Repository navigation
Fix writer starvation issue for compact mutex - #424
Merged
Merged
Conversation
razdoburdin
enabled auto-merge (squash)
October 16, 2026 10:51
razdoburdin
disabled auto-merge
October 22, 2026 06:38
ahuber21
reviewed
Oct 22, 2026
| /// | ||
| /// Hold this through internal-to-external ID translation. Acquire the translation | ||
| /// lock inside this guard, preserving the compact -> translator lock order. | ||
| [[nodiscard]] std::shared_lock<std::shared_mutex> lock_for_search() const { |
Member
There was a problem hiding this comment.
The naming is inconsistent. We're calling lock_for_search() but we are returning the gatekeeper lock. We're also using it for deletion and consolidation. So while I don't spot any logic issues, I'm pretty confused about the scope of the lock.
Member
Author
There was a problem hiding this comment.
I have renamed it to lock_storage_shared.
It doesn't return gatekeeper lock, but the shared compact_mutex_, that protects the storage during compaction. Gatekeeper is released just after the exit from lock_storage_shared.
ahuber21
approved these changes
Oct 22, 2026
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.
This PR fixes potential writer starvation for compact_mutex by adding a gatekeeper.
Address one of the comments from: #418