|
@@ -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:
|