myxce/src/controller
Rongsong Shen eec2596c5d
feat(worker-rejoin-resync): apply reported outcomes idempotently (task 3.2)
Add resync_apply_report()/resync_apply_running_entry()/
resync_apply_finished_entry()/resync_apply_unrecognized_entry() to
resync.c: routes each entry in a worker's job-state report to the
correct existing idempotent path (still-running -> clear from outstanding
set, no fact; finished-success/failure -> record_job_finish_fact_at/
on_job_fail; unrecognized -> record_job_reconcile_pending_fact;
unqueried extra -> record_job_reconcile_assign_fact or no-op), discards
reports for superseded rounds (Req 6.1/6.3), and resolves the round once
its outstanding set empties.

Also fixes bug-1747 (Req 4.2): adds record_job_finish_fact_at(),
additive alongside the unmodified record_job_finish_fact, so a
finished-success reconciliation entry records the WORKER-reported
finish time instead of reconciliation-processing time -- proven via a
real WAL-write + persist_recover() restart-replay test. The FAIL-side
half of the same gap (WAL_JOB_FAIL carries no fail-time wire slot at
all, for any caller) is confirmed pre-existing and systemic, correctly
left out of this task's scope.

Three review rounds surfaced and fixed two real, distinct bugs in the
unqueried-extra-job routing guard (see tasks.md's Implementation Notes
for the full account and the general lesson about re-deriving a full
truth table after a partial boolean-guard fix): round 1 caught the
wrong axis (terminal-vs-non-terminal instead of assignment-status,
Req 4.8); round 2 caught that the first fix's short-circuit clobbered
an already-terminal job's DONE/EXIT back to RUN (Req 4.4), including
confirming the implementer's own test had certified the bug as correct;
round 3 independently re-derived the final three-way guard from scratch
and found no further defect. bug-1748 logged for the guard fix.

Full controller suite: 1239 tests, 0 failures.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y4M5MJM2zK6nU43da267Ku
2026-09-01 15:24:29 +00:00
..
include feat(worker-rejoin-resync): apply reported outcomes idempotently (task 3.2) 2026-09-01 15:24:29 +00:00
testsuite feat(worker-rejoin-resync): apply reported outcomes idempotently (task 3.2) 2026-09-01 15:24:29 +00:00
apiserver.c fix(schema): rename struct Data -> XceData to unshadow capnp builtin blob type 2026-07-22 09:22:04 +00:00
CLAUDE.md fix(controller): raft_cb_persist must deny vote and roll back state on persist failure (bug-1684) 2026-08-25 07:49:49 +00:00
cluster.c fix(controller): standby dispatch-gate rejections now redirect to a known primary (bug-1700, bug-1701) 2026-08-27 08:25:55 +00:00
commit.c feat(raft-apply-decoupling): ordered live apply pump activates apply_committed_entry (task 6.1) 2026-07-04 19:00:43 +00:00
config_repl.c fix(bug-1561): fix flaky test_conf_trim_keeps_only_n_versions/test_conf_get_saved_tag_no_config 2026-08-30 03:55:45 +00:00
config_repl.h feat(controller): OPCode_probeConfigTag handler with Request envelope reply (bug-1506) 2026-08-10 10:00:08 +00:00
ctrl_metrics.c feat: P3-7 ctrl_metrics — 7 atomic counters/gauges + descriptor table + persist wiring 2026-05-08 00:04:06 +00:00
ctrlstatus.c feat(ha-heartbeat-committed-propagation): migrate last_known_committed_config_tag to _Atomic (task 1.1) 2026-06-20 11:27:46 +00:00
dataex.c fix(scheduler,controller): worker resource values always display as 0.00 (bug-1568) 2026-08-17 10:35:34 +00:00
egress.c feat(ha-convergence-recovery): commit-gated scheduler egress — submit_lsn tagging + watermark gate (task 1.2) 2026-06-14 02:33:36 +00:00
ha.c fix(ha): first-boot promotion evaluated eligibility before its own WAL recovery ran (bug-1696) 2026-08-27 08:26:09 +00:00
ha.h fix(controller): raft_cb_persist must deny vote and roll back state on persist failure (bug-1684) 2026-08-25 07:49:49 +00:00
ha_convergence.c fix(controller): bug-1450/1451 offload delaymgr-inline blocking work to the slow lane 2026-07-19 08:14:00 +00:00
job.c feat(worker-rejoin-resync): apply reported outcomes idempotently (task 3.2) 2026-09-01 15:24:29 +00:00
join.c fix(controller): bug-1433 async-thread fdatasync block + bug-1434 committed_lsn CAS race 2026-07-11 12:16:28 +00:00
main.c fix(bug-1731): fire HOOK_DETAIL_JOB_START/JOB_EXIT on WAL apply 2026-08-29 11:29:10 +00:00
meson.build feat(worker-rejoin-resync): reconciliation round lifecycle (task 3.1) 2026-09-01 12:53:09 +00:00
misc.c fix(bug-1736): capture memory_swap/tasks_current, compute peak_cpu_time 2026-08-30 15:32:02 +00:00
myapp.c fix(controller): restored-but-stale raft term permanently blocked re-election after restart (bug-1695) 2026-08-25 16:11:37 +00:00
myconf.c fix(config): serialize load_primary_config against concurrent invocations (bug-1476) 2026-07-28 08:13:54 +00:00
opget.c refactor(controller,xceadmin): drop generic Resource.unit, hardcode bytes for maxmem 2026-08-13 08:27:16 +00:00
opupd.c save works 2026-03-03 16:49:26 +08:00
persist.c feat(worker-rejoin-resync): reconcile unqueried job assignment (task 2.2) 2026-09-01 11:40:47 +00:00
queue.c feat(ha-commit-barrier-rollout): commit-first-then-reply in all four handlers (task 3.2) 2026-06-12 10:28:25 +00:00
repl.c fix(ha): close permanent quorum-loss deadlock on log-conflicted standby (bug-1479) 2026-07-29 04:11:32 +00:00
reply.c fix(persist): zero nresvals_to_sched after free_name_val_list 2026-05-20 09:39:07 +00:00
resources.c update controller code 2025-11-05 16:58:57 +08:00
resync.c feat(worker-rejoin-resync): apply reported outcomes idempotently (task 3.2) 2026-09-01 15:24:29 +00:00
sched.c fix(bug-1737): scheduler can never learn a job finished successfully 2026-08-31 04:20:27 +00:00
slowlane.c feat(raft-drive-async): SlowLane bounded executor for long blocking I/O (task 1.2) 2026-06-26 05:24:00 +00:00
startup_validation.c fix(controller): restored-but-stale raft term permanently blocked re-election after restart (bug-1695) 2026-08-25 16:11:37 +00:00
task.c save works 2026-03-04 18:18:53 +08:00
worker.c fix(controller): fail loud on scheduler/worker disconnect instead of relying on the reply-wait timeout (bug-1693) 2026-08-25 14:13:26 +00:00