Skip to content

disk-offload: failed cold-manifest commit can lose cold keys on crash (apply_spill_completions) #137

Description

@pilotspacex-byte

Summary

apply_spill_completions (src/shard/persistence_tick.rs ~407-414) populates the in-memory cold_index unconditionally, but if the preceding manifest.commit() returns Err it only logs a warning and continues. Cold read-through works in the live process (the index is populated), but if the process crashes between the failed commit and the next successful one, rebuild_from_manifest rebuilds from on-disk state that does not include the file's entry — those cold keys are silently lost (the .mpf exists on disk but nothing indexes it after restart).

Severity

LOW-MEDIUM. Pre-existing; surfaced in the PR #136 self-review. Window is narrow (failed commit → crash before next commit) but the failure is silent.

Suggested fix

On commit() failure either (a) retry/escalate before populating the index, or (b) record the pending entry in a recovery-visible side-log so a crash in the window can rebuild it. At minimum, surface a metric/counter for failed cold-manifest commits.

Context

Found during PR #136 review (multishard stability + disk-offload durability). Reviewer-reported, not independently reproduced.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions