mvcc: use correct error variable in defragdb
@@ -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
}
}
