fix(tsdb): sync series segment to disk after writing (#22545)

Co-authored-by: Tristan Su <suqing.sq@alibaba-inc.com>
pull/22574/head
Tristan Su 2021-09-24 01:09:16 +08:00 committed by GitHub
parent 47007f6988
commit 0f6614ffa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -212,7 +212,10 @@ func (s *SeriesSegment) Flush() error {
if s.w == nil {
return nil
}
return s.w.Flush()
if err := s.w.Flush(); err != nil {
return err
}
return s.file.Sync()
}
// AppendSeriesIDs appends all the segments ids to a slice. Returns the new slice.