Просмотр исходного кода

release: 2.21.4 - snapshots stall on evicted system rows; stale memory after an incomplete replay (bug fix, server only)

fszontagh 6 дней назад
Родитель
Сommit
0440c865ac
5 измененных файлов с 74 добавлено и 1 удалено
  1. 2 0
      CHANGELOG.md
  2. 0 0
      CLAUDE.md
  3. 1 1
      VERSION
  4. 21 0
      docs/ROADMAP.md
  5. 50 0
      docs/integration-guide.md

+ 2 - 0
CHANGELOG.md

@@ -12,6 +12,8 @@ consumer-facing usage is in `docs/integration-guide.md`.
 
 
 ## Unreleased
 ## Unreleased
 
 
+## 2.21.4 - 2026-11-20 (bug fix, server only)
+
 ### Fixed
 ### Fixed
 - **[server]** ⚠ Snapshots stopped completing for good once eviction had
 - **[server]** ⚠ Snapshots stopped completing for good once eviction had
   moved a row of a system collection (`_collection_meta`, `_views`, ...) out of
   moved a row of a system collection (`_collection_meta`, `_views`, ...) out of

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
CLAUDE.md


+ 1 - 1
VERSION

@@ -1 +1 @@
-2.21.3
+2.21.4

+ 21 - 0
docs/ROADMAP.md

@@ -428,6 +428,27 @@ For an API-key collection the second is a revoked credential, so writing it to
 LMDB at boot, or letting reads fall back to memory, would put it back into
 LMDB at boot, or letting reads fall back to memory, would put it back into
 service. Report, then an operator decision per row.
 service. Report, then an operator decision per row.
 
 
+### 5g. ⚠ A WAL replay that applied fewer entries than it should (found 2026-11-20)
+
+A production boot (2.21.2, after a 15-day snapshot stall, see CLAUDE.md
+v2.21.4) replayed 193,776 of the 354,089 entries above its snapshot. The WAL
+files were contiguous by their headers and none had a torn tail; the count
+was close to the middle file alone. **Cause not established.** 2.21.4 makes the
+consequence safe (the boot version audit reloads stale rows from LMDB) and
+makes the next occurrence visible: each WAL file's replay line reports
+unreadable entries (checksum vs format, first byte offset), entries out of
+sequence order, and bytes read against the file size. **Next:** boot the
+preserved cold copy (the 11-05 snapshot plus its three WAL files, held by
+smartbotic-vectorapi) under 2.21.4 and read those lines. If entries fail their
+checksum or parse, find which write path produced them; if sequences go
+backwards, find what reset the counter.
+
+**Also open, a surface for a stalled snapshot.** A snapshot failing every two
+minutes for two weeks logged 16,586 ERROR lines and nobody read them. Expose
+the WAL sequence, the last good snapshot's sequence and consecutive failed
+attempts on a surface consumers already poll (GetStats or GetMemoryStats), so
+the gap prices a restart. That is a feature, so it goes out on a Tuesday.
+
 ### 6. Smaller known gaps
 ### 6. Smaller known gaps
 
 
 - The boot key audit's "not adoptable (collection exists only on disk)" rows
 - The boot key audit's "not adoptable (collection exists only on disk)" rows

+ 50 - 0
docs/integration-guide.md

@@ -2683,6 +2683,56 @@ boot's `adopt` puts the lost rows back into memory and the next snapshot. A
 backup is still the whole data directory, as the package's pre-upgrade backup
 backup is still the whole data directory, as the package's pre-upgrade backup
 already copies it.
 already copies it.
 
 
+**Snapshots that stop completing (fixed in 2.21.4).** Before 2.21.4, eviction
+could move a row of a system collection (`_collection_meta` and the like) out
+of memory. These rows are not stored in LMDB, so the snapshot could read one
+back only from the WAL, and after one snapshot deleted that WAL file every
+later snapshot failed:
+
+```
+[error] Failed to create snapshot: evicted document '_collection_meta/...' could
+not be read for the snapshot; snapshot abandoned so the WAL that holds it is kept
+```
+
+Nothing clears it while the process runs. The WAL then grows until the next
+restart, and the restart has to replay all of it. If you see this line on an
+older server, plan the upgrade to 2.21.4 rather than a plain restart.
+Recovery time grows with the WAL; the server logs the WAL size at boot
+(`Recovery input: WAL N MB, ...`). On 2.21.4 replay logs its progress
+(`WAL replay: N entries applied`) and keeps systemd's start timeout from
+expiring.
+
+**Each WAL file is reported at boot (2.21.4+).** One line per file:
+
+```
+WAL file wal-current.log: 127940 applied, 0 already in the snapshot,
+0 unreadable (0 checksum, first at byte 0), 0 out of sequence order,
+sequences 1316788-1444727, read 79619466 of 79619466 bytes
+```
+
+It is logged as WARN when a file's header is unreadable, an entry is
+unreadable, sequences go backwards, or fewer bytes were read than the file
+holds. Before 2.21.4 all of these were skipped without a trace. Report any
+such WARN.
+
+**Memory behind disk after a replay (2.21.4+).** If a replay applies fewer
+entries than it should, memory keeps older versions of rows LMDB has newer
+copies of. Reads are still right, because they are served from LMDB. A
+`patch`/`increment` is not: it merges into memory's copy, so it writes the
+old fields back over the newer row. The boot step
+`Boot: memory/disk version audit` compares every resident row's `_version`
+and `_updated_at` with LMDB's and reloads from LMDB the ones that differ:
+
+```
+[warning] version audit: proj:coll: 12 resident row(s) were older than LMDB's copy,
+12 reloaded from LMDB (e.g. ...)
+```
+
+A healthy boot logs `version audit: N resident row(s) agree with LMDB`. The
+step reads each resident row once from LMDB, so it adds a little boot time.
+It is skipped (WARN) when the LMDB mirror is unhealthy or has drift, because
+then memory may be the newer side.
+
 ### Configuring for Your Project
 ### Configuring for Your Project
 
 
 Consumer projects typically enable migrations by configuring the database via their own `postinst` script:
 Consumer projects typically enable migrations by configuring the database via their own `postinst` script:

Некоторые файлы не были показаны из-за большого количества измененных файлов