From a88c5fbf2145772223f41e4bd53cba34a9e782d2 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Wed, 29 Jul 2026 09:09:56 +0000 Subject: [PATCH] feat(raft-adapter-conformance): add term field to ReplConfigPushReply schema Additive term @2 field on ReplConfigPushReply so a configuration-push reply can carry the replying member's current term for term-discovery (Requirement 7.4). Companion repl_config_push_reply_t struct field added in typemap.h per the existing $C.mapname convention. --- src/include/typemap.h | 2 ++ src/schema/controller.capnp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/include/typemap.h b/src/include/typemap.h index 08e04b05..42bc3947 100644 --- a/src/include/typemap.h +++ b/src/include/typemap.h @@ -491,6 +491,8 @@ struct repl_config_push_req_s { struct repl_config_push_reply_s { int accepted; /* 1 if standby accepted the push */ uint64_t version_tag; /* standby's current version tag after decision */ + uint64_t term; /* replying member's current term (raft-adapter- + * conformance Req 7.4 term-discovery channel) */ }; struct upgrade_config_req_s { diff --git a/src/schema/controller.capnp b/src/schema/controller.capnp index 3739b24f..d65f1025 100644 --- a/src/schema/controller.capnp +++ b/src/schema/controller.capnp @@ -805,6 +805,13 @@ struct ReplConfigPushRequest $C.mapname("repl_config_push_req_t") { struct ReplConfigPushReply $C.mapname("repl_config_push_reply_t") { accepted @0: Bool $C.mapname("accepted"); versionTag @1: UInt64 $C.mapname("version_tag"); + # raft-adapter-conformance Requirement 7.4: the replying member's current + # term, so a higher term can be discovered through this reply channel the + # same way it already is through heartbeat and WAL-NACK replies. Additive + # field (ordinal 2) — an old-code standby's reply decodes as term=0 on a + # new-code primary, which can never look like a higher term (terms start + # at 1), so no spurious adoption occurs under mixed-version rollout. + term @2: UInt64 $C.mapname("term"); } struct UpgradeConfigRequest $C.mapname("upgrade_config_req_t") {