feat(ha-config-bootstrap): implement repl_broadcast eviction and pending_ack_count (task 7.2)
This commit is contained in:
parent
f6030749de
commit
3969064e11
4 changed files with 100 additions and 43 deletions
|
|
@ -12,6 +12,9 @@
|
|||
#include "mylock.h"
|
||||
#include "wal_types.h" /* wal_entry_hdr_t — P2-4: use wal_types.h to break circular include */
|
||||
|
||||
/* Max queued-but-unacknowledged sends per standby before eviction to catch-up */
|
||||
#define MAX_PENDING_ACKS 16
|
||||
|
||||
/* Endpoint is an opaque pointer — full type in netio.h (avoid heavy include) */
|
||||
typedef void* repl_ep_t;
|
||||
|
||||
|
|
@ -25,6 +28,7 @@ typedef struct {
|
|||
uint32_t port;
|
||||
uint64_t last_disconnected_lsn;
|
||||
time_t last_disconnect_time;
|
||||
uint32_t pending_ack_count; /* Sends not yet ACKed; evict if > MAX_PENDING_ACKS */
|
||||
} standby_conn_t;
|
||||
|
||||
/* Replicator — embedded in persist_t or cluster_t (P2-4).
|
||||
|
|
@ -56,6 +60,9 @@ void repl_on_ack(replicator_t *r, repl_ep_t ep, uint64_t acked_lsn);
|
|||
/* Sync replication (stub in P2-1; wired in P2-3) */
|
||||
int repl_wait_ack(replicator_t *r, uint64_t target_lsn, uint32_t timeout_ms);
|
||||
|
||||
/* Majority-quorum ACK wait — stub until task 7.3 */
|
||||
int repl_wait_majority_ack(replicator_t *r, uint32_t timeout_ms, uint8_t ack_op);
|
||||
|
||||
/* WAL trim guard */
|
||||
uint64_t repl_trim_lsn(replicator_t *r, uint64_t checkpoint_lsn, uint32_t snap_interval_s);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue