update dump db tool

Signed-off-by: Liang Zheng <zhengliang0901@gmail.com>
This commit is contained in:
Liang Zheng 2021-12-29 19:07:34 +08:00
parent 69279532f4
commit 0cc789d81d
4 changed files with 5 additions and 5 deletions

View File

@ -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)) return nil, fmt.Errorf(`lease: %v. data = "%s"`, err, string(b))
} }
if lresp.LeaseTimeToLiveResponse.ID != int64(id) { 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 return lresp, nil
} }

View File

@ -218,8 +218,8 @@ func (ti *treeIndex) Compact(rev int64) map[revision]struct{} {
clone.Ascend(func(item btree.Item) bool { clone.Ascend(func(item btree.Item) bool {
keyi := item.(*keyIndex) keyi := item.(*keyIndex)
//Lock is needed here to prevent modification to the keyIndex while // Lock is needed here to prevent modification to the keyIndex while
//compaction is going on or revision added to empty before deletion // compaction is going on or revision added to empty before deletion
ti.Lock() ti.Lock()
keyi.compact(ti.lg, rev, available) keyi.compact(ti.lg, rev, available)
if keyi.isEmpty() { if keyi.isEmpty() {

View File

@ -142,7 +142,7 @@ func (s *store) compactBarrier(ctx context.Context, ch chan struct{}) {
select { select {
case <-s.stopc: case <-s.stopc:
default: 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 // s.stopc is only updated in restore operation, which is called by apply
// snapshot call, compaction and apply snapshot requests are serialized by // snapshot call, compaction and apply snapshot requests are serialized by
// raft, and do not happen at the same time. // raft, and do not happen at the same time.

View File

@ -95,7 +95,7 @@ func leaseDecoder(k, v []byte) {
if err := lpb.Unmarshal(v); err != nil { if err := lpb.Unmarshal(v); err != nil {
panic(err) 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) { func authDecoder(k, v []byte) {