fix(series file): Sync series segment after truncate (#13836) (#13859)

pull/13885/head
Jacob Marble 2019-05-10 11:25:43 -07:00 committed by GitHub
parent adfb6a9b46
commit 95f28cb571
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -70,6 +70,8 @@ func CreateSeriesSegment(id uint16, path string) (*SeriesSegment, error) {
return nil, err
} else if err := f.Truncate(int64(SeriesSegmentSize(id))); err != nil {
return nil, err
} else if err := f.Sync(); err != nil {
return nil, err
} else if err := f.Close(); err != nil {
return nil, err
}