feat(raft-library): task 6.1 — raft_state_t field in ha_state_t, raft_init with no-op stubs

This commit is contained in:
Rongsong Shen 2026-05-31 07:20:15 +00:00
parent 6bdf7edacf
commit b77525deb0
3 changed files with 54 additions and 1 deletions

View file

@ -28,6 +28,7 @@
#include "config.h" /* XCE_MAXNAME_LEN, MAX_STANDBYS, etc. */
#include "xce/cluster.h" /* xce_candidate_t */
#include "zarray.h"
#include "raft/raft.h" /* raft_state_t, raft_init */
/* Forward declaration — avoids circular include with cluster_def.h */
typedef struct cluster_s cluster_t;
@ -173,6 +174,8 @@ typedef struct {
int phase2_done; /* 1 after cluster_init_phase2 runs */
_Atomic int repl_ack_count; /* count of standbys that ACKed in COMMITTING state */
int n_peers; /* total candidate count (excluding self) */
/* ── New fields added by raft-library spec (Task 6.1) ──────── */
raft_state_t raft; /* Raft consensus state (wired in task 6.2) */
} ha_state_t;
/* ── Public API ────────────────────────────────────────────── */