소스 검색

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

fszontagh 6 일 전
부모
커밋
88232aed54
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
 
+## 2.21.4 - 2026-11-20 (bug fix, server only)
+
 ### Fixed
 - **[server]** ⚠ Snapshots stopped completing for good once eviction had
   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
 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
 
 - 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
 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
 
 Consumer projects typically enable migrations by configuring the database via their own `postinst` script:

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.