-
Notifications
You must be signed in to change notification settings - Fork 719
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
storage: Use etcd lease to manage safe point expiration #4984
storage: Use etcd lease to manage safe point expiration #4984
Conversation
Signed-off-by: AmoebaProtozoa <[email protected]>
Signed-off-by: AmoebaProtozoa <[email protected]>
Signed-off-by: AmoebaProtozoa <[email protected]>
Signed-off-by: AmoebaProtozoa <[email protected]>
Signed-off-by: AmoebaProtozoa <[email protected]>
Signed-off-by: AmoebaProtozoa <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
[REVIEW NOTIFICATION] This pull request has not been approved. To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
server/storage/kv/etcd_kv.go
Outdated
} | ||
|
||
func (kv *etcdKVBase) SaveWithTTL(key, value string, ttlSeconds int64) error { | ||
leaseID, err := kv.GrantLease(ttlSeconds) |
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.
Could we use etcdutil.EtcdKVPutWithTTL(context.TODO(),kv.client,key,value,ttlSeconds)
directly?
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.
Hmm, I was trying to put SaveWithTTL
into a SlowLogTxn
like other update methods for timeout and logging. But I guess that created more complexity.
Should we skip timeout / logging for this operation like other read methods?
Codecov Report
@@ Coverage Diff @@
## master #4984 +/- ##
==========================================
- Coverage 75.65% 75.40% -0.26%
==========================================
Files 310 309 -1
Lines 30675 30544 -131
==========================================
- Hits 23208 23032 -176
- Misses 5463 5495 +32
- Partials 2004 2017 +13
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
server/storage/kv/kv.go
Outdated
// Base is an abstract interface for load/save pd cluster data. | ||
type Base interface { | ||
Load(key string) (string, error) | ||
LoadRange(key, endKey string, limit int) (keys []string, values []string, err error) | ||
LoadRevision(key string) (string, int64, error) |
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.
revision
here is a very specific term that is related to etcd, is there a better way to avoid introducing it in this generic KV interface?
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: David <[email protected]>
@AmoebaProtozoa: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: AmoebaProtozoa [email protected]
An enhancement to #4937 which manages expiration manually
What problem does this PR solve?
Use etcd Lease feature to manage service safe point life time
Add revision related storage functions
Issue Number: ref #4865
RFC: tikv/rfcs#90
What is changed and how does it work?
Check List
Tests
Code changes
No
No
No
Side effects
No
Release note