Skip to content

Commit

Permalink
update dump db tool
Browse files Browse the repository at this point in the history
Signed-off-by: Liang Zheng <zhengliang0901@gmail.com>
  • Loading branch information
microyahoo committed Dec 31, 2021
1 parent 6927953 commit 0cc789d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion server/lease/leasehttp/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions server/storage/mvcc/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion server/storage/mvcc/kvstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tools/etcd-dump-db/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0cc789d

Please sign in to comment.