myxce/src/frontend/apiserver
Rongsong Shen e53c086ec5 fix(schema): rename struct Data -> XceData to unshadow capnp builtin blob type
controller.capnp declared `struct Data $C.mapname("xce_data_t")` (an
OPCode_get query-result tagged union) at file scope, which shadows
Cap'n Proto's builtin Data blob type for every later `: Data` field in
the same file. This silently miscompiled 7 fields across 6 structs as
a struct-pointer type instead of a raw byte blob: UpgradeConfigRequest
.sha256/.bytes, ReplConfigReply.sha256/.bytes, ReplConfigPushRequest
.sha256/.bytes, ReplEnvelope.payload, SnapshotTransfer's chunk
payload, WalCatchupEntry.payload/.batchPayloads, and CtrlHelloRequest
.key. Production C code had already routed around it for years via
hand-rolled raw capn_ptr manipulation (see request.c's own comments);
nothing before now needed the generated codec/accessors to actually
work for these fields.

Renamed the local struct to XceData (capnp-level name only; the
$C.mapname("xce_data_t") C typedef is unchanged) and explicitly
repointed getdata/pushmsg at XceData by name, since those two fields
correctly want the local tagged union. Updated every derived
generated-identifier reference across 19 hand-written files spanning
controller, lib, scheduler, and the Go apiserver/xcecli CGo bindings.
Fixed 5 call sites in lib/request.c that had been typed against the
old workaround alias but now legitimately receive the correct
capn_data type (a pure type-name swap -- Data_ptr/XceData_ptr and
capn_data share the identical {capn_ptr p} layout).

Verified via full rebuild+test: lib (1/1), controller (3/3, incl. the
job-array push regression tests), scheduler (15/15), Go apiserver +
xcecli (all packages green), and a direct pycapnp round-trip proving
UpgradeConfigRequest.sha256/.bytes now encode/decode correctly.

Bug: bug-1461 (.wolf/buglog.json). Unblocks admin-config-tool task 3.3.
2026-07-22 09:22:04 +00:00
..
backend fix(schema): rename struct Data -> XceData to unshadow capnp builtin blob type 2026-07-22 09:22:04 +00:00
cmd feat: add HA candidate failover to API server backend 2026-05-08 03:31:35 +00:00
common Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
config save status 2026-07-21 08:24:44 +00:00
controllers feat: reject job submissions to 'lost_and_found' reserved queue in preCheckJobRequest 2026-05-14 03:19:34 +00:00
docs Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
middleware Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
models fix: preserve admin-set host state across worker re-registration in makeWorker_ 2026-05-13 10:38:39 +00:00
router Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
services submit job from xcecli 2026-04-14 15:55:52 +08:00
store test(apiserver): add integration tests for P0+P1 backend features 2026-04-18 11:56:31 +00:00
tools/encrypt Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
utils refactor: simplify HA backend peer handling 2026-05-08 03:41:11 +00:00
go.mod Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
go.sum Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
meson.build Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
README.md Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00

(1) run server command:

cd cmd go run main.go

(2) run server with different log level: cd cmd go run main.go -level=debug

level options: info/debug/warn/error/fatal