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
|
|
@ -184,6 +184,17 @@ typedef struct {
|
|||
sem_t heartbeat_seen; /* Req 1: posted by heartbeat handler during CTRL_INIT */
|
||||
_Atomic uint64_t last_known_committed_config_tag; /* Req 8: from primary heartbeats */
|
||||
_Atomic uint64_t committed_config_tag; /* Req 8.1: set on quorum ACK */
|
||||
/* ── New field added by controller-status spec delta (Req 12, task 7.1) ── */
|
||||
_Atomic uint64_t last_known_elected_at_ms; /* Currently-known primary's
|
||||
* election time (epoch ms): self-stamped
|
||||
* by both promotion roads at the instant
|
||||
* each commits to CTRL_PRIMARY (task 7.2,
|
||||
* not yet wired), unconditionally learned
|
||||
* off-primary via heartbeat (task 7.3, not
|
||||
* yet wired) -- mirrors last_known_committed_lsn/
|
||||
* last_known_committed_config_tag above.
|
||||
* 0/unset at init (ha_init memset) until
|
||||
* the first promotion or heartbeat. */
|
||||
/* ── New fields added by election-iomgr-refactor spec (Task 2.1) ── */
|
||||
void *client_ssl_ctx; /* SSL_CTX* (TLS_client_method); created in myapp_run */
|
||||
/* ── New field added by raft-drive-async spec (Task 3.1) ──────── */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue