fix(ha-repl-hardening): wire snapshot production path (task 3.5b)

- SEND_SNAPSHOT uses checkpoint_lsn (not committed_lsn) for file lookup
- ha_send_snapshot_to_standby stats file for actual total_size
- ha_compute_oldest_wal_lsn scans WAL dir for min segment LSN
- Removed hardcoded 131072 and oldest_wal_lsn=0 placeholders
This commit is contained in:
Rongsong Shen 2026-06-05 01:25:00 +00:00
parent 834ab4d5e7
commit 318098c727
5 changed files with 43 additions and 18 deletions

View file

@ -158,7 +158,9 @@ int ha_stream_wal_to_standby(endpoint_t *ep, const char *wal_path,
#define SNAPSHOT_CHUNK_SIZE 65536
int ha_send_snapshot_to_standby(endpoint_t *ep, const char *snap_dir,
uint64_t checkpoint_lsn, uint64_t total_size);
uint64_t checkpoint_lsn);
uint64_t ha_compute_oldest_wal_lsn(const char *wal_path);
/*
* handle_ctrlhello: primary-side handler for OP_hello from a joining standby.