--- id: "bug-503" status: "fixed" status_updated: "2026-09-24" status_note: "" component: "controller" severity: "unknown" timestamp: "2026-06-13T13:30:00.000Z" last_seen: "2026-09-19T09:00:00Z" occurrences: 1 files: ["src/controller/testsuite/test_ha_startup.c"] tags: ["ha-single-leader-role", "dispatch-gate", "write-quorum", "test-retarget", "commit-barrier", "c"] related: [] legacy: true --- # bug-503: test_dispatch_gate_primary_no_quorum_denies_job_ops: Expected -10013 Was 0 (jobsub allowed… ## Description test_dispatch_gate_primary_no_quorum_denies_job_ops: Expected -10013 Was 0 (jobsub allowed, expected -XCE_ERR_NOT_READY) ## Environment _Not recorded (migrated from buglog.json)._ ## Reproduction _Not recorded (migrated from buglog.json)._ ## Root cause Retargeting the dispatch-gate test from CTRL_PRIMARY_COMMITTING to CTRL_PRIMARY (ha-single-leader-role task 5.1) changed gate semantics: the deleted COMMITTING branch denied job ops UNCONDITIONALLY, but the CTRL_PRIMARY branch only denies job ops when ha_has_write_quorum() is false. ha_init leaves n_peers=0, so ha_has_write_quorum returns true (single-node = self-majority, ha.c:1437) and jobsub was ALLOWED (rc=0). A blind role swap does not reproduce the original deny. ## Fix Set ha.n_peers = 2 in both retargeted dispatch-gate tests so a multi-node primary with zero connected standbys genuinely lacks write quorum (connected 0 < n_peers/2=1), making the universal commit barrier deny job ops with -XCE_ERR_NOT_READY while still permitting replication ops. ## Verification _Not recorded (migrated from buglog.json)._ ## References _Not recorded (migrated from buglog.json)._