mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #13572 from microyahoo/update_lease_tools
update dump db tool
This commit is contained in:
commit
e0a0fdc984
@ -236,7 +236,7 @@ func TimeToLiveHTTP(ctx context.Context, id lease.LeaseID, keys bool, url string
|
||||
return nil, fmt.Errorf(`lease: %v. data = "%s"`, err, string(b))
|
||||
}
|
||||
if lresp.LeaseTimeToLiveResponse.ID != int64(id) {
|
||||
return nil, fmt.Errorf("lease: renew id mismatch")
|
||||
return nil, fmt.Errorf("lease: TTL id mismatch")
|
||||
}
|
||||
return lresp, nil
|
||||
}
|
||||
|
@ -218,8 +218,8 @@ func (ti *treeIndex) Compact(rev int64) map[revision]struct{} {
|
||||
|
||||
clone.Ascend(func(item btree.Item) bool {
|
||||
keyi := item.(*keyIndex)
|
||||
//Lock is needed here to prevent modification to the keyIndex while
|
||||
//compaction is going on or revision added to empty before deletion
|
||||
// Lock is needed here to prevent modification to the keyIndex while
|
||||
// compaction is going on or revision added to empty before deletion
|
||||
ti.Lock()
|
||||
keyi.compact(ti.lg, rev, available)
|
||||
if keyi.isEmpty() {
|
||||
|
@ -142,7 +142,7 @@ func (s *store) compactBarrier(ctx context.Context, ch chan struct{}) {
|
||||
select {
|
||||
case <-s.stopc:
|
||||
default:
|
||||
// fix deadlock in mvcc,for more information, please refer to pr 11817.
|
||||
// fix deadlock in mvcc, for more information, please refer to pr 11817.
|
||||
// s.stopc is only updated in restore operation, which is called by apply
|
||||
// snapshot call, compaction and apply snapshot requests are serialized by
|
||||
// raft, and do not happen at the same time.
|
||||
|
@ -95,7 +95,7 @@ func leaseDecoder(k, v []byte) {
|
||||
if err := lpb.Unmarshal(v); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("lease ID=%016x, TTL=%ds\n", leaseID, lpb.TTL)
|
||||
fmt.Printf("lease ID=%016x, TTL=%ds, remaining TTL=%ds\n", leaseID, lpb.TTL, lpb.RemainingTTL)
|
||||
}
|
||||
|
||||
func authDecoder(k, v []byte) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user