mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
mvcc: use correct error variable in defragdb (#11527)
Co-authored-by: yutedz <54038175+yutedz@users.noreply.github.com>
This commit is contained in:
parent
d17a607da2
commit
c3497c84ed
@ -498,7 +498,7 @@ func defragdb(odb, tmpdb *bolt.DB, limit int) error {
|
||||
}
|
||||
tmpb.FillPercent = 0.9 // for seq write in for each
|
||||
|
||||
if pErr := b.ForEach(func(k, v []byte) error {
|
||||
if err = b.ForEach(func(k, v []byte) error {
|
||||
count++
|
||||
if count > limit {
|
||||
err = tmptx.Commit()
|
||||
@ -515,8 +515,8 @@ func defragdb(odb, tmpdb *bolt.DB, limit int) error {
|
||||
count = 0
|
||||
}
|
||||
return tmpb.Put(k, v)
|
||||
}); pErr != nil {
|
||||
return pErr
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user