feat(ha-repl-hardening): add batch WAL catch-up on standby side (task 2.2)

Extend ha_apply_wal_catchup_entry with batch branch:
- Check n_entries > 0, iterate entries[] list in order
- Apply each via apply_wal_entry(); skip NULL/errors without crash
- Advance applied_lsn once after full batch (not per-entry)
- n_entries == 0 falls through to task 2.1 single-entry path
4 new unit tests covering full batch, partial batch, error skip, fallback
This commit is contained in:
Rongsong Shen 2026-06-04 15:38:20 +00:00
parent 647b88ce57
commit 6bbcff62ca
3 changed files with 295 additions and 41 deletions

View file

@ -51,7 +51,7 @@
- _Requirements: 3.1, 3.3, 3.4, 3.5_
- _Boundary: Standby Dispatch (cluster.c / ha.c)_
- [ ] 2.2 Handle batch WAL catch-up entries on standby
- [x] 2.2 Handle batch WAL catch-up entries on standby
- Extend the `OPCode_walCatchupEntry` handler from task 2.1 to decode the `entries` list for batch messages
- Apply each entry in order via `apply_wal_entry()`; advance `applied_lsn` only after the full batch is durably written
- Standby remains in `CTRL_STANDBY` during batch apply; `applied_lsn` not persisted to disk