{"record":{"id":"31b9e91a900b1ca1","repo":"microsoft/FASTER","slug":"unexpected-checkpoint-status-s-for-cold-store-expected-s","errorCode":null,"errorMessage":"Unexpected checkpoint status [%s] for COLD store [expected: %s]","messagePattern":"Unexpected checkpoint status \\[(.+?)\\] for COLD store \\[expected: (.+?)\\]","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cc/src/core/f2.h","lineNumber":759,"sourceCode":"                                                bool shift_begin_address, int n_threads, bool checkpoint) {\n  const bool is_hot_store = (store_type == StoreType::HOT);\n\n  uint64_t tail_address = store.hlog.GetTailAddress().control();\n  log_debug(\"Compact %s: {%.2lf GB} {Goal %.2lf GB} [%lu %lu] -> [%lu %lu]\",\n            is_hot_store ? \"HOT\" : \"COLD\",\n            static_cast<double>(store.Size()) / (1 << 30),\n            static_cast<double>(tail_address - until_address) / (1 << 30),\n            store.hlog.begin_address.control(), tail_address,\n            until_address, tail_address);\n  if (until_address > store.hlog.safe_read_only_address.control()) {\n    throw std::invalid_argument{ \"Can only compact until safe read-only region\" };\n  }\n\n  StoreCheckpointStatus status;\n  if (checkpoint) {\n    assert(checkpoint_.phase.load() == CheckpointPhase::COLD_STORE_CHECKPOINT);\n    if ((status = checkpoint_.cold_store_status.load()) != StoreCheckpointStatus::REQUESTED) {\n      log_error(\"Unexpected checkpoint status [%s] for COLD store [expected: %s]\",\n                STORE_CHECKPOINT_STATUS_STR[static_cast<int>(status)],\n                STORE_CHECKPOINT_STATUS_STR[static_cast<int>(StoreCheckpointStatus::REQUESTED)]);\n      assert(false);\n    }\n    checkpoint_.cold_store_status.store(StoreCheckpointStatus::ACTIVE);\n  }\n  Guid token = checkpoint ? checkpoint_.token : Guid::Create();\n  bool success = store.InternalCompactWithLookup(until_address, shift_begin_address,\n                                                n_threads, is_hot_store, checkpoint, token);\n  log_debug(\"Compact %s [success=%d]: {Goal %.2lf} {Actual %.2lf GB} Done!\",\n            is_hot_store ? \"HOT\": \"COLD\", success,\n            static_cast<double>(tail_address - until_address) / (1 << 30),\n            static_cast<double>(store.Size()) / (1 << 30));\n\n  if (checkpoint) {\n    assert(checkpoint_.phase.load() == CheckpointPhase::COLD_STORE_CHECKPOINT);\n    if ((status = checkpoint_.cold_store_status.load()) != StoreCheckpointStatus::ACTIVE) {\n      log_error(\"Unexpected checkpoint status [%s] for COLD store [expected: %s]\",","sourceCodeStart":741,"sourceCodeEnd":777,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cc/src/core/f2.h#L741-L777","documentation":"At the start of the cold-store checkpoint step, cold_store_status must be REQUESTED (set when the checkpoint was initiated). Any other value means the checkpoint state machine is inconsistent — e.g., this checkpoint context was already consumed or was never properly requested.","triggerScenarios":"The cold-store checkpoint entry point (CheckpointColdStore-like API) invoked when cold_store_status is IDLE/ACTIVE/FINISHED — e.g., double invocation of the cold checkpoint, or invocation outside a COLD_STORE_CHECKPOINT phase (also asserted).","commonSituations":"Manually driving checkpoint stages out of order; calling the cold-store checkpoint step twice within one checkpoint round; a previous FAILED checkpoint leaving stale status.","solutions":["Only invoke the cold-store checkpoint step once per Checkpoint() round, after hot-store finishes","Do not call internal per-store checkpoint methods directly; use the top-level Checkpoint() API","Verify phase is COLD_STORE_CHECKPOINT before the call (the assert fires otherwise)","Reset instance state after a FAILED checkpoint before retrying"],"exampleFix":"// before\nf2->CheckpointColdStore(ctx); // called twice per round\nf2->CheckpointColdStore(ctx); // second call: status no longer REQUESTED\n// after\nf2->CheckpointColdStore(ctx); // once, per Checkpoint() invocation only","handlingStrategy":"validation","validationCode":"if (!inside_checkpoint_round || cold_step_already_ran) { return Status::Aborted; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only the public Checkpoint() API, not internal per-store steps","Run each checkpoint step once per round","Reset state after FAILED checkpoints"],"tags":["checkpoint","cold-store","state-machine"],"backgroundTag":"invalid-state-transition","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"}