mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/{storage,mergeset}: sync filenames inside part when finalizing the part
Fixes https://github.com/VictoriaMetrics/VictoriaMetrics/issues/63
This commit is contained in:
parent
3437c30180
commit
b491045a4b
2 changed files with 12 additions and 0 deletions
|
@ -151,6 +151,12 @@ func (bsw *blockStreamWriter) MustClose() {
|
|||
bsw.itemsWriter.MustClose()
|
||||
bsw.lensWriter.MustClose()
|
||||
|
||||
// Sync bsw.path contents to make sure it doesn't disappear
|
||||
// after system crash or power loss.
|
||||
if bsw.path != "" {
|
||||
fs.SyncPath(bsw.path)
|
||||
}
|
||||
|
||||
bsw.reset()
|
||||
}
|
||||
|
||||
|
|
|
@ -146,6 +146,12 @@ func (bsw *blockStreamWriter) MustClose() {
|
|||
bsw.indexWriter.MustClose()
|
||||
bsw.metaindexWriter.MustClose()
|
||||
|
||||
// Sync bsw.path contents to make sure it doesn't disappear
|
||||
// after system crash or power loss.
|
||||
if bsw.path != "" {
|
||||
fs.SyncPath(bsw.path)
|
||||
}
|
||||
|
||||
bsw.reset()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue