Skip to content

persist: a stale in-memory snapshot can roll back persisted session state #598

Closed

Description

@ranxianglei

Problem

With BILI_PERSIST, sessions restore from disk. If an older in-memory snapshot of a session is written back after a newer persisted state exists (multi-instance overlap, restart race, restored-session edge), the write silently rolls the persisted state back — losing blocks/refs created in between.

Impact

Silent state regression: refs/blocks disappear, usage counters contradict, decompression of cited tags fails.

Suggested fix

Guard at write time: reject (or re-merge) snapshots that are older than what is already persisted (generation/seq comparison). PR #517 implements the guard (+181/−9); needs a rebase against the #587 persist rewrite (bounded folded snapshot).

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions