mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Simplify KVstore dependency on cindex.
This commit is contained in:
@@ -322,9 +322,7 @@ func saveDB(lg *zap.Logger, destDB, srcDB string, idx uint64, desired *desiredCl
|
||||
tx.Lock()
|
||||
defer tx.Unlock()
|
||||
cindex.UnsafeCreateMetaBucket(tx)
|
||||
ci := cindex.NewConsistentIndex(tx)
|
||||
ci.SetConsistentIndex(idx)
|
||||
ci.UnsafeSave(tx)
|
||||
cindex.UnsafeUpdateConsistentIndex(tx, idx, false)
|
||||
} else {
|
||||
// Thanks to translateWAL not moving entries, but just replacing them with
|
||||
// 'empty', there is no need to update the consistency index.
|
||||
|
||||
@@ -478,8 +478,7 @@ func (s *v3Manager) saveWALAndSnap() (*raftpb.HardState, error) {
|
||||
func (s *v3Manager) updateCIndex(commit uint64) error {
|
||||
be := backend.NewDefaultBackend(s.outDbPath())
|
||||
defer be.Close()
|
||||
ci := cindex.NewConsistentIndex(be.BatchTx())
|
||||
ci.SetConsistentIndex(commit)
|
||||
ci.UnsafeSave(be.BatchTx())
|
||||
|
||||
cindex.UpdateConsistentIndex(be.BatchTx(), commit, false)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user