test(ha-commit-barrier-rollout): RED commit-first-then-reply tests per opcode (task 3.1)

New test_commit_barrier_reply.c drives do_jobcontrol_op /
do_queuecontrol_op / do_hostcontrol_op / handle_worker_join directly
(pthread harness, ep->outq reply capture, wired engine n_peers=3).
12 cases: 8 RED (reply-before-commit + bug-447 pins), 4 validation
pins green. DISCOVERY bug-447 (reviewer-confirmed): key_find found-rc
leak means queue/host control never append WAL in production — 3.2's
rc normalization is the fix point. Census 484 = 472 + 12; zero
baseline regressions.
This commit is contained in:
Rongsong Shen 2026-06-12 10:00:38 +00:00
parent 8f688eace1
commit e1c3c173f4
8 changed files with 1036 additions and 140 deletions

View file

@ -7046,6 +7046,174 @@
"related_bugs": [],
"occurrences": 1,
"last_seen": "2026-06-12T00:51:52.673Z"
},
{
"id": "bug-438",
"timestamp": "2026-06-12T03:52:57.142Z",
"error_message": "Incorrect value in code",
"file": "src/controller/meson.build",
"root_cause": "Had 'commit.c'",
"fix": "Changed to 'testsuite/test_commit_barrier_rollout.c'",
"tags": [
"auto-detected",
"wrong-value",
"build"
],
"related_bugs": [],
"occurrences": 1,
"last_seen": "2026-06-12T03:52:57.142Z"
},
{
"id": "bug-439",
"timestamp": "2026-06-12T04:13:06.326Z",
"error_message": "Missing error handling in unknown",
"file": ".kiro/specs/ha-commit-barrier-rollout/tasks.md",
"root_cause": "Code path had no error handling — exceptions would propagate uncaught",
"fix": "Added try/catch block",
"tags": [
"auto-detected",
"error-handling",
"md"
],
"related_bugs": [],
"occurrences": 1,
"last_seen": "2026-06-12T04:13:06.326Z"
},
{
"id": "bug-440",
"timestamp": "2026-06-12T04:18:19.158Z",
"error_message": "Missing guard clause",
"file": "src/controller/persist.c",
"root_cause": "No early return/throw for edge case: detail == HOOK_DETAIL_WORKER_JOIN ||\n detail == H",
"fix": "Added guard clause: if (detail == HOOK_DETAIL_WORKER_JOIN ||\n )",
"tags": [
"auto-detected",
"guard-clause",
"c"
],
"related_bugs": [],
"occurrences": 1,
"last_seen": "2026-06-12T04:18:19.158Z"
},
{
"id": "bug-441",
"timestamp": "2026-06-12T04:18:31.067Z",
"error_message": "Significant refactor of ",
"file": "src/controller/persist.c",
"root_cause": "4 lines replaced/restructured",
"fix": "Rewrote 7→12 lines (4 removed) | Also: return persist_wal_async(p, wal_type, &js, sizeof(; persist_t* p = cls; | Also: int rc = persist_wal_async(p, wal_type, pkt, (uint; persist_t* p = cls;",
"tags": [
"auto-detected",
"refactor",
"c"
],
"related_bugs": [],
"occurrences": 3,
"last_seen": "2026-06-12T04:19:00.652Z"
},
{
"id": "bug-442",
"timestamp": "2026-06-12T04:50:32.154Z",
"error_message": "Incorrect value in code",
"file": "src/controller/testsuite/test_commit_barrier_rollout.c",
"root_cause": "Had \"xce/types.h\"",
"fix": "Changed to \"xce/errnox.h\"",
"tags": [
"auto-detected",
"wrong-value",
"c"
],
"related_bugs": [],
"occurrences": 1,
"last_seen": "2026-06-12T04:50:32.154Z"
},
{
"id": "bug-443",
"timestamp": "2026-06-12T05:14:36.392Z",
"error_message": "Missing guard clause",
"file": "src/controller/persist.c",
"root_cause": "No early return/throw for edge case: p == NULL",
"fix": "Added guard clause: if (p == NULL)",
"tags": [
"auto-detected",
"guard-clause",
"c"
],
"related_bugs": [],
"occurrences": 1,
"last_seen": "2026-06-12T05:14:36.392Z"
},
{
"id": "bug-444",
"timestamp": "2026-06-12T09:09:04.495Z",
"error_message": "Significant refactor of ",
"file": "src/controller/testsuite/test_commit_barrier_reply.c",
"root_cause": "2 lines replaced/restructured",
"fix": "Rewrote 3→5 lines (2 removed) | Also: static xce_signal_t g_sigkill = { .signo = SIGKIL; static xce_jobctrl_t g_jobctrl;",
"tags": [
"auto-detected",
"refactor",
"c"
],
"related_bugs": [],
"occurrences": 2,
"last_seen": "2026-06-12T09:09:10.703Z"
},
{
"id": "bug-445",
"timestamp": "2026-06-12T09:30:00Z",
"error_message": "AddressSanitizer SEGV in hash_string via makeResource when running controller_unit_test -t test_commit_barrier_reply standalone",
"file": "src/controller/testsuite/test_commit_barrier_reply.c",
"root_cause": "Global xstring table uninitialised in standalone runs: makeString() returns NULL, resobj name becomes NULL, key_add hashes NULL. In full-suite runs test_worker_join.c:520 initialises the table unguarded, so the bug only appears with -t selection.",
"fix": "Probe makeString(\"cbrp-probe\") in the group entry; call xstring_table_init(139) only when the probe returns NULL (avoids double init in full-suite order).",
"tags": [
"testsuite",
"xstring",
"fixture",
"segv",
"ha-commit-barrier-rollout"
],
"related_bugs": [],
"occurrences": 1,
"last_seen": "2026-06-12T09:30:00Z"
},
{
"id": "bug-446",
"timestamp": "2026-06-12T09:30:00Z",
"error_message": "makeJob() returns NULL (Expected Non-NULL) in commit-barrier reply fixture",
"file": "src/controller/testsuite/test_commit_barrier_reply.c",
"root_cause": "job_init (lib/jobj.c) returns -EINVAL when xce_job_t.submit == NULL, and makeJobsub requires job_obj_init() module tables which no controller test group initialises.",
"fix": "Fixture calls job_obj_init(64, 64) once per process (static guard) and provides a zeroed static job_submit_data_t as jdef.submit.",
"tags": [
"testsuite",
"jobj",
"fixture",
"ha-commit-barrier-rollout"
],
"related_bugs": [],
"occurrences": 1,
"last_seen": "2026-06-12T09:30:00Z"
},
{
"id": "bug-447",
"timestamp": "2026-06-12T09:30:00Z",
"error_message": "queue_ctrl/worker_ctrl append NO WAL entry and reply status 1 on success; job_ctrl also returns 1 (key_find found-rc leak)",
"file": "src/controller/queue.c",
"root_cause": "key_find (xkvmgr_find, lib/kvmgr.c:130-151) returns 1 when the key is found. queue_ctrl (queue.c:60), worker_ctrl (worker.c:643) and job_ctrl (job.c:314) store it in rc and never reset it: the 'if (rc == 0)' AFTER_EVENT hook gate is skipped (no WAL_QUEUE_CTRL / WAL_WORKER_CTRL append on the found path) and the requester reply carries status 1 instead of 0. Production gap discovered by task-3.1 RED tests; queue/host control state changes are currently never persisted or replicated.",
"fix": "NOT fixed here (test-only task). Pinned RED by test_commit_barrier_reply.c append assertions; the task-3.2 handler restructure (rc = ctrl fn; if rc==0 barrier; reply rc) must normalise ctrl-fn rc semantics so the hook fires and success replies are 0.",
"tags": [
"production-gap",
"queue_ctrl",
"worker_ctrl",
"job_ctrl",
"key_find",
"wal",
"ha-commit-barrier-rollout",
"red-finding"
],
"related_bugs": [],
"occurrences": 1,
"last_seen": "2026-06-12T09:30:00Z"
}
]
}