Phát hành

  • 2.21.1 - replay records no history, max_versions enforced, eviction/snapshot races (bug fix, server only)

    Szontágh Ferenc 1 tháng trước cách đây | 19 commit đến main đến phiên bản này

    Fixed

    • [server] ⚠ Every boot that replayed the WAL recorded each replayed update and delete in version history AGAIN (it had been recorded when first written), and did so for collections with versioning OFF too, because replay runs before the collection settings are loaded. One production boot that replayed 14,998 entries (after a stop that was killed mid-snapshot) wrote 1.9 GB of history into two versioning-off collections. Replay now records no history.
    • [server] max_versions was enforced only when it was lowered, so a capped collection's history file grew without bound (a comment claimed the snapshot loop pruned it; nothing did). After each snapshot, a capped file that has grown past 16 MB and twice its size at its last prune is now pruned to the cap. The first snapshot after the upgrade prunes every capped file over 16 MB once, which reclaims history like the 1.9 GB above.
    • [server] Eviction removed a document from memory a moment before recording its stub, so for that moment it was in neither place: a snapshot that had listed it could write it as deleted. The stub is now recorded first.
    • [server] Two snapshots could run at once (the final snapshot at shutdown and the periodic one); within the same second they shared a file name, and one failed or renamed the other's half-written file. Snapshots now run one at a time.

      Changed

    • [server] The boot key audit no longer logs one line per adopted row; the summary says how many were adopted (loaded unchanged) and how many are not adoptable because their collection exists only on disk. In report mode each collection says what adopt would do, and consistency-report.json carries collection_in_memory per collection, so the step can be sized before it is taken.

    Server only; the client stays 2.20.0.

     
  • 2.21.0 - snapshots keep evicted rows, failed copies remembered, consistency knobs (server only)

    Szontágh Ferenc 1 tháng trước cách đây | 21 commit đến main đến phiên bản này

    Fixed

    • [server] ⚠ A snapshot silently left out every document that stayed evicted across a WAL rotation: it read an evicted document back only from the WAL, and the previous snapshot had deleted that WAL file, so the document was written as absent with a WARN. The next boot came up without it while LMDB kept it (7,219 rows on one production instance, found by the 2.20.2 key audit): readable, invisible to writes, and missing from any backup of snapshots/ plus wal/. The snapshot now reads an evicted document from LMDB, and a document it still cannot read fails the snapshot (the WAL is kept) instead of being dropped.
    • [server] A row whose copy to LMDB failed was repaired at the next boot only if its WAL entry still existed; a snapshot in between made the divergence permanent. Failed copies are now recorded durably (mirror-pending.log in the data directory) and repaired from memory at the next boot.

      Added

    • [server] storage.consistency: what the boot key audit does about rows memory and disk disagree on. disk_only: adopt (default: load into memory; reads already see them) / report / remove. memory_only: report (default) / write / remove. Complete id lists in consistency-report.json in the data directory every boot.

      Observable

    • [server] With the default disk_only: adopt, the first boot on this version loads every disk-only row into memory (on the instance above, 7,219 rows): memory use rises by their size until eviction trims it, and boot takes longer by the time to read them. Set disk_only: report first to see the list before anything acts. The key audit logs at WARN (it was ERROR), and ERROR only when a repair failed.

    Server only; the client stays 2.20.0.

     
  • 2.20.2 - disk-only rows are writable, boot key audit (bug fix, server only)

    Szontágh Ferenc 1 tháng trước cách đây | 25 commit đến main đến phiên bản này

    Fixed

    • [server] ⚠ A row that LMDB held and MemoryStore did not could be read and never written: patch, update and delete answered not-found, and an insert or upsert of its id was ACCEPTED and overwrote it at version 1. Found on a production instance. MemoryStore is rebuilt from snapshot + WAL, never from LMDB, so no restart repaired it. A write that misses memory now checks LMDB and, if the row is there, loads it and applies the write to it (WARN per row). An insert of its id is AlreadyExists. Only while LMDB is what reads are served from (mirror healthy, no drift).
    • [server] upsert reported inserted=true for a row that existed but was not in memory (evicted since 2.12.1, or the case above), and skipped keeping the stored ciphertext of unchanged sensitive fields (a spurious history diff). An evicted row's _created_by was NOT affected (the store keeps the original); a disk-only row's was, because the upsert re-created it. _created_by keeps its meaning (the creator) on every version; 2.20.2 removes an exception, it does not redefine the field. The exception belongs to a ROW, not a date: a disk-only row that an insert or upsert re-created before 2.20.2 names that writer, and still will after the upgrade (nothing repairs it retroactively), so an audit across the upgrade compares like with like everywhere else.

      Added

    • [server] Boot step "memory/disk key audit": per collection, the ids LMDB holds that MemoryStore does not and the reverse, logged as ERROR with counts and up to 10 ids each; read-only, changes nothing. Walks keys, never values: about 120 ms and a few MB per 100,000 rows (memory scales with the largest collection, not the store).

      Observable

    • [server] An insert of an id that is on disk but was not in memory now fails AlreadyExists instead of silently overwriting. Each insert of a new id costs one LMDB existence check (microseconds). No format, marker or migration change: 2.20.1 runs on a data directory 2.20.2 has used.

    Server only; the client stays 2.20.0.