This commit is contained in:
Sina Mahmoodi 2021-12-16 18:32:58 +03:30
parent a5360a97eb
commit 8f42a64920
1 changed files with 5 additions and 7 deletions

View File

@ -321,13 +321,11 @@ func (t *freezerTable) repair() error {
}
}
// Ensure all reparation changes have been written to disk
if !t.readonly {
if err := t.index.Sync(); err != nil {
return err
}
if err := t.head.Sync(); err != nil {
return err
}
if err := t.index.Sync(); err != nil {
return err
}
if err := t.head.Sync(); err != nil {
return err
}
// Update the item and byte counters and return
t.items = uint64(t.itemOffset) + uint64(offsetsSize/indexEntrySize-1) // last indexEntry points to the end of the data file