feat(controller-status): add election-time schema fields + ha_state_t (task 7.1)
Adds CtrlStatus.electedAtMs@14 and HeartbeatMsg.electedAtMs@4 to the capnp schema, their hand-authored typemap.h counterparts, and a new ha_state_t.last_known_elected_at_ms field alongside last_known_committed_lsn. Schema/state plumbing only -- nothing stamps or consumes these fields yet (tasks 7.2-7.5). Codec round-trip tests confirm both new fields survive encode/decode unchanged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC
This commit is contained in:
parent
7556856e5c
commit
cae1039ed7
6 changed files with 184 additions and 1 deletions
|
|
@ -284,6 +284,8 @@ typedef struct {
|
|||
} peers;
|
||||
uint32_t peerCount;
|
||||
uint64_t responder_time_ms; /* @13: responder wall-clock at sample time (epoch ms) */
|
||||
uint64_t elected_at_ms; /* @14: current primary's election time (epoch ms),
|
||||
* learned off-primary via heartbeat; 0 = unknown */
|
||||
} xce_ctrlstatus_t;
|
||||
|
||||
/* ── Worker rejoin/resync job-state reconciliation (worker-rejoin-resync
|
||||
|
|
@ -613,6 +615,8 @@ struct heartbeat_msg_s {
|
|||
uint64_t term; /* sender's current term */
|
||||
uint64_t committed_lsn; /* Req 5: primary's committed WAL LSN */
|
||||
uint64_t committed_config_tag; /* Req 8: primary's committed config tag */
|
||||
uint64_t elected_at_ms; /* Req 12.2: primary's own last_known_elected_at_ms,
|
||||
* echoed on every heartbeat */
|
||||
};
|
||||
|
||||
/* CtrlHello state sync (Req 6.5, 6.6, 6.7) */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue