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