-
Notifications
You must be signed in to change notification settings - Fork 332
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
refactor: allow procedure to acquire share lock #3061
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3061 +/- ##
==========================================
- Coverage 85.45% 85.17% -0.29%
==========================================
Files 799 805 +6
Lines 129155 130891 +1736
==========================================
+ Hits 110373 111481 +1108
- Misses 18782 19410 +628 |
de56075
to
5bf86d5
Compare
5bf86d5
to
8f02038
Compare
eb72343
to
48eb30b
Compare
That paper is inspiring, maybe we need to adopt the whole idea from it, including lock scheduler and deadlock detection. |
For deadlock detection, we now simply acquire all locks in the lexicographical order. I think it enough for now. cc @evenyag @fengjiachun |
64f983c
to
05cf253
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.
LGTM
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.
Rest LGTM
I hereby agree to the terms of the GreptimeDB CLA
What's changed and what's your intention?
KeyRwLock
Background
During reading the paper(Granularity of Locks and Degrees of Consistency in a Shared Data Base).
I realized that to acquire a lock on the subtree, there are two ways:
We're stuck in the first way and always imagine we must acquire the lock in Root-to-Leaf order and need to employ something like a Hierarchical lock.
In fact, the order acquiring locks doesn't really matter in our scenario. We only have three levels, and it's enough to meet the invariant in our system if we acquire one lock on each level.
Invariant in our system
Checklist
Refer to a related PR or issue link (optional)
#2700