feat(config-upgrade-snapshot): define HostAdminState/QueueAdminState capnp structs, bump snapshot format version

Adds independently-extensible Cap'n Proto frames for the upgrade
snapshot's host/queue admin-state sections (frame-only, not reusing
Worker/QueueConf which bundle dynamic state) and bumps
SNAPSHOT_FORMAT_VERSION 1->2 so a checkpoint written under the prior
raw queue-frame layout is fail-loud rejected rather than
misinterpreted. Task 1 of 19.

Requirements: 1.9, 5.7
This commit is contained in:
Rongsong Shen 2026-07-24 08:26:49 +00:00
parent e0c5e8b7a4
commit 9e68335aee
6 changed files with 322 additions and 8 deletions

View file

@ -1628,8 +1628,17 @@ static int persist_write_checkpoint_marker(persist_t* p)
* [uint32_t job_count]
* [job_count * { uint32_t payload_len; uint8_t capnp_Job_bytes[payload_len] }]
* [uint32_t queue_count]
* [queue_count * { uint32_t name_len; char name[name_len]; uint32_t status }] */
#define SNAPSHOT_FORMAT_VERSION 1u
* [queue_count * { uint32_t name_len; char name[name_len]; uint32_t status }]
*
* config-upgrade-snapshot task 1 (Req 1.9, 5.7): bumped 1->2 to reserve the
* version for the HostAdminState/QueueAdminState capnp migration -- the
* queue-frame layout above (name_len/name/status raw bytes) is the PRIOR
* layout this version now hard-rejects; the byte-layout migration itself
* (new host section, queue frames re-encoded as capnp) lands in tasks
* 2.1/2.2. A binary built against version 2 must never misinterpret a
* checkpoint written under version 1's raw queue-frame layout (Design
* Invariant 4: fail loud, never silently reinterpret). */
#define SNAPSHOT_FORMAT_VERSION 2u
typedef struct {
uint8_t* buf;