feat(ha-repl-hardening): standby snapshot receive handler (task 3.5c)
ha_handle_snapshot_chunk writes chunks to snap.part, on isLast verifies
total_size, atomic renames to snap-{lsn}.bin, loads via new
persist_load_snapshot wrapper, sets applied_lsn=checkpoint_lsn.
3 tests: 2-chunk assembly, size mismatch, null args. Wired into
myreq_handler OPCode_snapshotTransfer dispatch.
This commit is contained in:
parent
318098c727
commit
cbd91fca43
7 changed files with 361 additions and 2 deletions
|
|
@ -676,6 +676,12 @@ static int load_snapshot(persist_t* p, const char* path, uint64_t lsn)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Public wrapper for load_snapshot — exposed via persist.h for ha.c (Task 3.5c). */
|
||||
int persist_load_snapshot(persist_t *p, const char *path, uint64_t lsn)
|
||||
{
|
||||
return load_snapshot(p, path, lsn);
|
||||
}
|
||||
|
||||
/* P2-2: Standby WAL replay — apply a single replicated entry to in-memory state.
|
||||
*
|
||||
* No hooks fire on standbys; the hook system is empty until promotion.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue