{"record":{"id":"83169bb3420ebe0b","repo":"microsoft/FASTER","slug":"compact-cold-log-failed","errorCode":null,"errorMessage":"Compact COLD log failed!  :(","messagePattern":"Compact COLD log failed!  :\\(","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cc/src/core/f2.h","lineNumber":945,"sourceCode":"\n    // Hot-Cold compaction (optional cold-log checkpoint)\n    if (ShouldCompactHlog(hot_store, StoreType::HOT, hot_log_compaction_config, until_address)) {\n      hot_store.StartSession();\n      cold_store.StartSession();\n      if (!CompactLog(hot_store, StoreType::HOT, until_address, true,\n                      hot_log_compaction_config.num_threads, should_checkpoint_cold_store())) {\n        log_error(\"Compact HOT log failed! :(\");\n      }\n      cold_store.StopSession();\n      hot_store.StopSession();\n    }\n\n    // Cold-Cold compaction (optional cold-log checkpoint)\n    if (ShouldCompactHlog(cold_store, StoreType::COLD, cold_log_compaction_config, until_address)) {\n      cold_store.StartSession();\n      if (!CompactLog(cold_store, StoreType::COLD, until_address, true,\n                      cold_log_compaction_config.num_threads, should_checkpoint_cold_store())) {\n        log_error(\"Compact COLD log failed!  :(\");\n      }\n      cold_store.StopSession();\n    }\n\n    wait = (checkpoint_.hot_store_status != StoreCheckpointStatus::REQUESTED &&\n            !ShouldCompactHlog(hot_store, StoreType::HOT, hot_log_compaction_config, until_address) &&\n            !ShouldCompactHlog(cold_store, StoreType::COLD, cold_log_compaction_config, until_address));\n    if (wait) {\n      compaction_scheduled_.store(false);\n      std::this_thread::sleep_for(check_interval);\n    }\n\n  } while(background_worker_active_.load());\n\n  compaction_scheduled_.store(false);\n}\n\ntemplate<class K, class V, class D, class HHI, class CHI>","sourceCodeStart":927,"sourceCodeEnd":963,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cc/src/core/f2.h#L927-L963","documentation":"The cold-log compaction step inside Checkpoint (CompactLog on the COLD store) returned false. The cold log was not compacted; like the hot variant this is logged and the checkpoint flow continues, but cold-log space was not reclaimed.","triggerScenarios":"ShouldCompactHlog triggers on the cold store (cold_log_compaction_config thresholds exceeded) and CompactLog(cold_store, StoreType::COLD, ...) fails — invalid until_address, insufficient compaction threads, or an internal fold failure over cold-log segments.","commonSituations":"Auto-compaction of the cold log under sustained ingest; cold_log_compaction_config.num_threads too low; compacting a cold log with many immutable segments still referenced by active readers.","solutions":["Retry the compaction/checkpoint — transient reader contention is the most common cause.","Raise cold_log_compaction_config.num_threads.","Ensure until_address is a valid, flushed address within the cold log.","Verify no sessions are pinning old cold-log regions; stop idle sessions before compacting."],"exampleFix":"// before\nkv.CompactLog(until_address, 1);\n// after\nbool ok = kv.CompactLog(until_address, cold_cfg.num_threads);\nif (!ok) { /* schedule retry */ }","handlingStrategy":"retry","validationCode":"// before cold-log compaction\nif (!cold_store.HasActiveSession()) cold_store.StartSession();\nuint64_t until = cold_store.hlog.flushed_until_address;\nif (until == 0) return;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Stop idle sessions that pin old cold-log regions.","Use enough cold_log_compaction_config.num_threads.","Retry failed compaction cycles instead of aborting the checkpoint.","Monitor cold-log size trend to catch persistent compaction failure."],"tags":["compaction","cold-store","hybridlog","checkpoint"],"backgroundTag":"database-query-failed","analyzedSha":"321d872eabda6a0345c8bd76419f89723ed864ae","analyzedAt":"2026-09-15T22:18:00.693Z","contentChangedAt":"2026-09-15T22:18:00.693Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}