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
4d9f088526
commit
20fc0e0e54
2 changed files with 12 additions and 0 deletions
|
@ -151,6 +151,12 @@ func (bsw *blockStreamWriter) MustClose() {
|
||||||
bsw.itemsWriter.MustClose()
|
bsw.itemsWriter.MustClose()
|
||||||
bsw.lensWriter.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()
|
bsw.reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,6 +146,12 @@ func (bsw *blockStreamWriter) MustClose() {
|
||||||
bsw.indexWriter.MustClose()
|
bsw.indexWriter.MustClose()
|
||||||
bsw.metaindexWriter.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()
|
bsw.reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue