From 78adf3f8433c6f4e8b742147874158331c4657b4 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Wed, 13 May 2026 14:10:33 +0000 Subject: [PATCH] fix: normalize capnp union arm naming to lowercase; fix UpgradeConfigRequest field order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename replConfigRequestMsg/replConfigPushRequestMsg/upgradeConfigRequestMsg to replconfigrequestmsg/replconfigpushrequestmsg/upgradeconfigrequestmsg in Request.body union to match existing lowercase convention - Rename replConfigReplyMsg/replConfigPushReplyMsg/upgradeConfigReplyMsg to replconfigreplymsg/replconfigpushreplymsg/upgradeconfigreplymsg in RequestReply.data union - Swap UpgradeConfigRequest fields so sha256@0/bytes@1 matches sibling ReplConfigPushRequest pattern - Move HeartbeatMsg out of the config replication section into its own '# ── HA heartbeat ──' section above the replication structs --- src/schema/controller.capnp | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/schema/controller.capnp b/src/schema/controller.capnp index 12780d5..9d7d028 100644 --- a/src/schema/controller.capnp +++ b/src/schema/controller.capnp @@ -547,10 +547,10 @@ struct RequestReply $C.mapname("xce_reply_t"){ debugmsg @4: Text; getdata @5: Data; jobid @6: UInt64; - clusterconf @7: ClusterConf; - replConfigReplyMsg @8: ReplConfigReply; - replConfigPushReplyMsg @9: ReplConfigPushReply; - upgradeConfigReplyMsg @10: UpgradeConfigReply; + clusterconf @7: ClusterConf; + replconfigreplymsg @8: ReplConfigReply; + replconfigpushreplymsg @9: ReplConfigPushReply; + upgradeconfigreplymsg @10: UpgradeConfigReply; } } @@ -607,11 +607,11 @@ struct Request $C.mapname("xce_request_t"){ runtaskmsg @18: RunTask; preasonmsg @19: PendReasonSet; clrpreasonmsg @20: ClearPReason; - hostctrlmsg @21: HostControl; - replConfigRequestMsg @22: ReplConfigRequest; - replConfigPushRequestMsg @23: ReplConfigPushRequest; - upgradeConfigRequestMsg @24: UpgradeConfigRequest; - heartbeatmsg @25: HeartbeatMsg; + hostctrlmsg @21: HostControl; + replconfigrequestmsg @22: ReplConfigRequest; + replconfigpushrequestmsg @23: ReplConfigPushRequest; + upgradeconfigrequestmsg @24: UpgradeConfigRequest; + heartbeatmsg @25: HeartbeatMsg; } } @@ -714,6 +714,12 @@ struct SnapshotHeader $C.mapname("capnp_snap_hdr_t") { headerChecksum @8 :UInt32; } +# ── HA heartbeat ──────────────────────────────────────────────────── +struct HeartbeatMsg $C.mapname("heartbeat_msg_t") { + senderPriority @0: UInt32 $C.mapname("sender_priority"); + term @1: UInt64 $C.mapname("term"); +} + # ── Config replication message structs ────────────────────────────── struct ReplConfigRequest $C.mapname("repl_config_req_t") { versionTag @0: UInt64 $C.mapname("version_tag"); @@ -738,8 +744,8 @@ struct ReplConfigPushReply $C.mapname("repl_config_push_reply_t") { } struct UpgradeConfigRequest $C.mapname("upgrade_config_req_t") { - bytes @0: Data $C.mapname("bytes"); - sha256 @1: Data $C.mapname("sha256"); + sha256 @0: Data $C.mapname("sha256"); + bytes @1: Data $C.mapname("bytes"); } struct UpgradeConfigReply $C.mapname("upgrade_config_reply_t") { @@ -748,11 +754,6 @@ struct UpgradeConfigReply $C.mapname("upgrade_config_reply_t") { ackedCount @2: UInt32 $C.mapname("acked_count"); } -struct HeartbeatMsg $C.mapname("heartbeat_msg_t") { - senderPriority @0: UInt32 $C.mapname("sender_priority"); - term @1: UInt64 $C.mapname("term"); -} - # ── WAL replication envelope (Part 6 — NOT the on-disk format) ─────── # Named ReplEnvelope to avoid collision with the on-disk wal_entry_hdr_t. struct ReplEnvelope $C.mapname("capnp_repl_envelope_t") {