preallocate disk space during compaction also, add cleanup for failed compaction

This commit is contained in:
Chris Lu
2017-08-29 23:59:53 -07:00
parent f7c22f0159
commit 58344980e4
10 changed files with 92 additions and 17 deletions

View File

@@ -55,7 +55,7 @@ func (v *Volume) Synchronize(volumeServer string) (err error) {
return fmt.Errorf("Failed to sync volume %d entries with %s: %v", v.Id, volumeServer, err)
}
if lastCompactRevision != compactRevision && lastCompactRevision != 0 {
if err = v.Compact(); err != nil {
if err = v.Compact(0); err != nil {
return fmt.Errorf("Compact Volume before synchronizing %v", err)
}
if err = v.commitCompact(); err != nil {