storage: Use etcd lease to manage safe point expiration#4984
storage: Use etcd lease to manage safe point expiration#4984AmoebaProtozoa wants to merge 43 commits intotikv:masterfrom
Conversation
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
|
[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. DetailsReviewer 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.
Could we use etcdutil.EtcdKVPutWithTTL(context.TODO(),kv.client,key,value,ttlSeconds) directly?
There was a problem hiding this comment.
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 <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
server/storage/kv/kv.go
Outdated
| 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.
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 <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
|
@AmoebaProtozoa: PR needs rebase. DetailsInstructions 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 8039876+AmoebaProtozoa@users.noreply.github.com
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