Skip to content

store: appendVersion proceeds unlocked when the advisory lock fails; data_log never compacts #597

@justrach

Description

@justrach

Two hardening gaps in Store.appendVersion (src/store.zig:94-108):

  1. log.lock(io, .exclusive) catch break :blk false; — on lock failure the write proceeds without the advisory lock; two processes can compute the same end_pos and interleave writePositionalAll, corrupting both diffs. Failing to acquire should either retry or skip the diff persist (versions still record, data_offset = null).
  2. The diff data log is append-only forever: versions trimmed by max_versions leave their diff bytes in the file, so the log grows monotonically across daemon lifetimes. A compaction pass (rewrite live ranges, fix offsets) or size-triggered truncation of orphaned ranges would bound it.

No deterministic failing test for either (cross-process lock contention / disk-growth-over-time) — enhancement filed per #550/#564 precedent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions