feat: add replConfig/replConfigPush/upgradeConfig opcodes and message structs to capnp schema

This commit is contained in:
Rongsong Shen 2026-05-13 14:06:51 +00:00
parent 6a47ef5c39
commit 683c092b77

View file

@ -37,6 +37,9 @@ enum OPCode {
steppingDown @26;
replSnapshot @27;
replCatchUpDone @28;
replConfig @29;
replConfigPush @30;
upgradeConfig @31;
}
struct PeerInfo $C.mapname("xce_peerinfo_t") {
@ -544,7 +547,10 @@ struct RequestReply $C.mapname("xce_reply_t"){
debugmsg @4: Text;
getdata @5: Data;
jobid @6: UInt64;
clusterconf @7: ClusterConf;
clusterconf @7: ClusterConf;
replConfigReplyMsg @8: ReplConfigReply;
replConfigPushReplyMsg @9: ReplConfigPushReply;
upgradeConfigReplyMsg @10: UpgradeConfigReply;
}
}
@ -601,7 +607,11 @@ struct Request $C.mapname("xce_request_t"){
runtaskmsg @18: RunTask;
preasonmsg @19: PendReasonSet;
clrpreasonmsg @20: ClearPReason;
hostctrlmsg @21: HostControl;
hostctrlmsg @21: HostControl;
replConfigRequestMsg @22: ReplConfigRequest;
replConfigPushRequestMsg @23: ReplConfigPushRequest;
upgradeConfigRequestMsg @24: UpgradeConfigRequest;
heartbeatmsg @25: HeartbeatMsg;
}
}
@ -674,6 +684,7 @@ struct ClusterConfig $C.mapname("cluster_config_t") {
xstrings @17: HashZArrayConfig;
hproviders @18: List(ScalerConfig) $C.mapname("hproviders") $C.maplistcount("nhproviders");
limits @19: List(LimitConfig) $C.mapname("limits") $C.maplistcount("nlimits");
configGeneration @20: UInt64 $C.mapname("config_generation");
}
# ── Persistence configuration (Part 2.6) ────────────────────────────
@ -703,6 +714,45 @@ struct SnapshotHeader $C.mapname("capnp_snap_hdr_t") {
headerChecksum @8 :UInt32;
}
# ── Config replication message structs ──────────────────────────────
struct ReplConfigRequest $C.mapname("repl_config_req_t") {
versionTag @0: UInt64 $C.mapname("version_tag");
}
struct ReplConfigReply $C.mapname("repl_config_reply_t") {
upToDate @0: Bool $C.mapname("up_to_date");
versionTag @1: UInt64 $C.mapname("version_tag");
sha256 @2: Data $C.mapname("sha256");
bytes @3: Data $C.mapname("bytes");
}
struct ReplConfigPushRequest $C.mapname("repl_config_push_req_t") {
versionTag @0: UInt64 $C.mapname("version_tag");
sha256 @1: Data $C.mapname("sha256");
bytes @2: Data $C.mapname("bytes");
}
struct ReplConfigPushReply $C.mapname("repl_config_push_reply_t") {
accepted @0: Bool $C.mapname("accepted");
versionTag @1: UInt64 $C.mapname("version_tag");
}
struct UpgradeConfigRequest $C.mapname("upgrade_config_req_t") {
bytes @0: Data $C.mapname("bytes");
sha256 @1: Data $C.mapname("sha256");
}
struct UpgradeConfigReply $C.mapname("upgrade_config_reply_t") {
versionTag @0: UInt64 $C.mapname("version_tag");
error @1: Text $C.mapname("error");
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") {