-
Notifications
You must be signed in to change notification settings - Fork 70
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
Fix/issue 684 #820
Fix/issue 684 #820
Conversation
@Phoenix500526 Convert your pr to draft since CI failed |
284e26d
to
bddfaab
Compare
@Phoenix500526 You've modified the workflows. Please don't forget to update the .mergify.yml. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #820 +/- ##
==========================================
+ Coverage 75.55% 75.57% +0.02%
==========================================
Files 180 186 +6
Lines 26938 27712 +774
Branches 26938 27712 +774
==========================================
+ Hits 20353 20944 +591
- Misses 5366 5472 +106
- Partials 1219 1296 +77 ☔ View full report in Codecov by Sentry. |
@Phoenix500526 Convert your pr to draft since CI failed |
1c973bf
to
dcc89ca
Compare
@Phoenix500526 Your PR is in conflict and cannot be merged. |
dcc89ca
to
1a0abbb
Compare
@Phoenix500526 Your PR is in conflict and cannot be merged. |
1a0abbb
to
b848a11
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.
Mutex and its guard may be not the best way to abstract. If there's any error happens, such as lease renew failure, lock free is a good point to report error. In the mutex guard abstraction, lock free is in the drop function, which is not possible to handle for the caller.
e0ddaf9
to
5c535e6
Compare
@Phoenix500526 Convert your pr to draft since CI failed |
70d0524
to
7decae5
Compare
@Phoenix500526 Your PR is in conflict and cannot be merged. |
7decae5
to
89fa23e
Compare
@Phoenix500526 Convert your pr to draft since CI failed |
89fa23e
to
3be34a1
Compare
We could guarantee the lock safety by coupling the lock key to every update send to Xline, and the Xline server must verify the validity of the key. Please refer to https://jepsen.io/analyses/etcd-3.4.3 On the client side, we could associate KV operation methods to the lock guard to prevent user from using the lock for other purpose. |
@Mergifyio rebase |
✅ Branch has been successfully rebased |
3be34a1
to
32fa940
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.
Closes: xline-kv#664 Signed-off-by: Phoeniix Zhao <Phoenix500526@163.com>
32fa940
to
09f1df9
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
Please briefly answer these questions:
Close the issue #664 and #684
what problem are you trying to solve? (or if there's no problem, what's the motivation for this change?)
Close the issue [Bug]: The xlinectl won't renew the lease of the lock key #664 and [Refactor]: Add a session structure to renew lock lease automatically #684
what changes does this pull request make?
Implement a session structure to auto renew the lock lease.
Implement an
Xutex
, which means Xline Mutex, to describe a lock instanceProvide an RAII implementation
XutexGuard
forXutex
Remove the LockRequest and UnlockRequest in xline-client
Remove some unless test cases, like
lock_should_timeout_when_ttl_is_set
. Actually, whether the ttl is set or not, the lock in etcd won't timeout. The ttl of a lock is only used to liveness checking. FYI: what is used for about ttl in session? etcd-io/etcd#6736Remove the validation_lock_client.rs
are there any non-obvious implications of these changes? (does it break compatibility with previous versions, etc)
no