mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-06-06 11:47:29 +02:00
Merge pull request #554 from ClusterCockpit/release/v1.5
Fix bug that prevents WAL cleanup on shutdown
This commit is contained in:
@@ -308,8 +308,14 @@ func Shutdown() {
|
|||||||
lastCheckpointMu.Unlock()
|
lastCheckpointMu.Unlock()
|
||||||
|
|
||||||
if Keys.Checkpoints.FileFormat == "wal" {
|
if Keys.Checkpoints.FileFormat == "wal" {
|
||||||
// WAL files are deleted per-host inside ToCheckpointWAL workers.
|
var successDirs []string
|
||||||
files, _, err = ms.ToCheckpointWAL(Keys.Checkpoints.RootDir, from.Unix(), time.Now().Unix())
|
files, successDirs, err = ms.ToCheckpointWAL(Keys.Checkpoints.RootDir, from.Unix(), time.Now().Unix())
|
||||||
|
// The final binary snapshot now captures all in-memory data for these
|
||||||
|
// hosts, making their current.wal redundant. The staging goroutines have
|
||||||
|
// already exited, so remove the WAL files directly (the channel-based
|
||||||
|
// RotateWALFiles is no longer safe to call). Without this, current.wal
|
||||||
|
// files survive shutdown and keep growing across restarts.
|
||||||
|
RotateWALFilesAfterShutdown(successDirs)
|
||||||
} else {
|
} else {
|
||||||
files, err = ms.ToCheckpoint(Keys.Checkpoints.RootDir, from.Unix(), time.Now().Unix())
|
files, err = ms.ToCheckpoint(Keys.Checkpoints.RootDir, from.Unix(), time.Now().Unix())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user