diff options
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | src/zenstore/gc.cpp | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1110d3344..9e39c17aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - Improvement: `zen oplog-import` command now does cloud storage host and Zenserver cache discovery - `--builds-override-host` option can be used instead of or in addtition to `--builds` to specify host to override cloud storage host discovery - `--zen-cache-host` specifies a Zenserver cache host that overrides any host discovery +- Improvement: If gc disk usage log file is corrupt, remove and restart the log - Bugfix: Add quotes around messages when using `--log-progress` with `zen builds` commands - Bugfix: Fix ASSERT after running `zen workspace info` on a non-existing workspace. UE-349934 - Bugfix: Fixed issue where GC could start after shutdown of GC had been requested causing a race diff --git a/src/zenstore/gc.cpp b/src/zenstore/gc.cpp index 8c3d802c3..b17103e43 100644 --- a/src/zenstore/gc.cpp +++ b/src/zenstore/gc.cpp @@ -1781,8 +1781,16 @@ GcScheduler::Initialize(const GcSchedulerConfig& Config) m_AttachmentPassIndex = SchedulerState["AttachmentPassIndex"sv].AsUInt8(); } + const std::filesystem::path GcDiskUsageLogPath = m_Config.RootDirectory / "gc.dlog"; + if (!TCasLogFile<DiskUsageWindow::DiskUsageEntry>::IsValid(GcDiskUsageLogPath)) + { + ZEN_WARN("GC disk usage log at '{}' is malformed, restarting log", GcDiskUsageLogPath); + RemoveFile(GcDiskUsageLogPath); + } + m_DiskUsageLog.Open(m_Config.RootDirectory / "gc.dlog", CasLogFile::Mode::kWrite); m_DiskUsageLog.Initialize(); + const GcClock::Tick LastGCTick = m_LastGcTime.time_since_epoch().count(); m_DiskUsageLog.Replay( [this, LastGCTick](const DiskUsageWindow::DiskUsageEntry& Entry) { |