From 89c360f7b548c004fa58243bbd650b325c6a6e76 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Thu, 7 May 2026 13:45:36 +0000 Subject: [PATCH] feat: add ha.h stub + ha.c skeleton; document iomgr/SSL reuse decision (P1-1) --- src/controller/ha.c | 3 +++ src/controller/ha.h | 18 ++++++++++++++++++ src/controller/meson.build | 1 + 3 files changed, 22 insertions(+) create mode 100644 src/controller/ha.c create mode 100644 src/controller/ha.h diff --git a/src/controller/ha.c b/src/controller/ha.c new file mode 100644 index 0000000..4d2f3a1 --- /dev/null +++ b/src/controller/ha.c @@ -0,0 +1,3 @@ +#include "ha.h" + +/* P1-2: implementation added in next task */ diff --git a/src/controller/ha.h b/src/controller/ha.h new file mode 100644 index 0000000..f1ee670 --- /dev/null +++ b/src/controller/ha.h @@ -0,0 +1,18 @@ +#ifndef HA_H +#define HA_H + +/* + * XCE Controller HA — role management and election (P1). + * + * P1-1 audit: the existing create_ssl_context() + iomgr_set_ssl_ctx() path + * in cluster.c (line 559, set at line 583) covers all controller-to-controller SSL. + * HA listeners (heartbeat, election probe, replication accept) reuse the same + * ssl_ctx already installed on c->iomgr. + * No new TLS infrastructure is needed — XCE runs on a trusted management LAN. + * Peer identity is validated by host:port match against the --peers candidate list. + * See design doc Part 5.9 and memory: Persistence & HA Trusted LAN Decision. + */ + +/* Full struct definitions and API declarations added in P1-2. */ + +#endif /* HA_H */ diff --git a/src/controller/meson.build b/src/controller/meson.build index 1caee7a..53e70f6 100644 --- a/src/controller/meson.build +++ b/src/controller/meson.build @@ -1,6 +1,7 @@ controller_src = [ 'cluster.c', 'dataex.c', + 'ha.c', 'job.c', 'join.c', 'main.c',