Adds snapshot_inflight_lsn[MAX_HA_CANDIDATES] to ha_state_t, alongside the existing snapshot_inflight[] flag it mirrors exactly: set to the checkpoint's LSN at ha_snapshot_send_dispatch before a transfer's first byte goes out, cleared to 0 at every completion/failure path (snapshot_lane_fn's normal completion, and all 3 early-return failure sites: malloc failure, slowlane dedup-refuse, slowlane submit failure). This is the foundation task 4.3 will consult from rotate_snapshots to avoid deleting a checkpoint file a peer is still mid-transfer reading from -- the one genuinely new retention guard this feature needs (the existing write_snapshot-before-trim_wal_segments sequencing already satisfies the WAL-trim side of Requirement 3). Proven via a new gated unit test (test_ha_liveness.c) that observes the tracked LSN mid-flight while the send body is parked at a test gate, not just before/after -- confirms the lifecycle ordering, not just the endpoints. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JDYFbrgyDHbvNYcxApKhrX |
||
|---|---|---|
| .. | ||
| settings | ||
| specs | ||
| steering | ||