feat(ha-repl-hardening): add batch entries list to WalCatchupEntry schema (task 1.2)

Add self-referential entries @3 :List(WalCatchupEntry) field with
$C.maplistcount("n_entries"). Single-entry path unaffected — n_entries
defaults to 0, entries to NULL when not using batch mode.
This commit is contained in:
Rongsong Shen 2026-06-04 13:46:04 +00:00
parent 9a977b3a43
commit 51907ebfbc
3 changed files with 8 additions and 5 deletions

View file

@ -17,7 +17,7 @@
- _Requirements: 1.1, 1.3_
- _Boundary: Wire Protocol (controller.capnp)_
- [ ] 1.2 Extend `WalCatchupEntry` for batch support in controller.capnp
- [x] 1.2 Extend `WalCatchupEntry` for batch support in controller.capnp
- Add `entries :List(WalCatchupEntry)` field for multiple entries per message
- Regenerate capnp bindings; verify compilation
- Compilation succeeds; single-entry decode path still works

View file

@ -286,10 +286,12 @@ typedef struct {
xce_data_t *payload;
} snapshot_transfer_t;
typedef struct {
uint64_t lsn;
uint8_t entry_type;
xce_data_t *payload;
typedef struct wal_catchup_entry {
uint64_t lsn;
uint8_t entry_type;
xce_data_t *payload;
int n_entries; /* batch: number of sub-entries */
struct wal_catchup_entry **entries; /* batch: array of sub-entry pointers */
} wal_catchup_entry_t;
/* ── Persistence Cap'n Proto mapped types (P0-9) ─────────────────────

View file

@ -838,6 +838,7 @@ struct WalCatchupEntry $C.mapname("wal_catchup_entry_t") {
lsn @0 :UInt64 $C.mapname("lsn");
entryType @1 :UInt8 $C.mapname("entry_type");
payload @2 :Data $C.mapname("payload");
entries @3 :List(WalCatchupEntry) $C.mapname("entries") $C.maplistcount("n_entries");
}
struct CtrlHelloRequest $C.mapname("ctrl_hello_req_t") {