feat(ha-commit-barrier-rollout): commit-first-then-reply in all four handlers (task 3.2)
Uniform pattern (ctrl fn -> persist_commit_barrier -> reply) in do_jobcontrol_op/do_queuecontrol_op/do_hostcontrol_op; join barrier between AFTER_EVENT and success reply (failure -> error reply, skip on_worker_join). FIXES bug-447: key_find found-rc normalized inside job_ctrl/queue_ctrl/worker_ctrl — queue/host control now actually append WAL and replicate (was silently unpersisted); idempotent no-ops now return 0. handle_jobsubmit untouched. 12/12 + 15/15; census zero failures.
This commit is contained in:
parent
e1c3c173f4
commit
facdb90917
7 changed files with 439 additions and 309 deletions
|
|
@ -327,6 +327,15 @@ int job_ctrl(cluster_t* c, xce_jobctrl_t* ctrinfo)
|
|||
return -ENOENT;
|
||||
}
|
||||
|
||||
/* bug-447: key_find returns 1 on found (binary librtti, unnormalizable
|
||||
* upstream). Normalize the found-rc to 0 so the not-started siginfo
|
||||
* branch below (which appends via the mark_job_* hooks but never
|
||||
* reassigns rc) returns 0 to the handler's commit-barrier pattern
|
||||
* instead of leaking 1 as the reply status. Real errors are
|
||||
* untouched: rc < 0 returned above, the j == NULL miss returned
|
||||
* -ENOENT, and every other branch sets rc itself. */
|
||||
rc = 0;
|
||||
|
||||
/* FIXME: eliminate held multiple locks */
|
||||
lock(j, RTTI_LOCK_READ);
|
||||
if (j->job.allocs != NULL) {
|
||||
|
|
@ -925,7 +934,20 @@ int do_jobcontrol_op(cluster_t* c, endpoint_t* ep, xce_request_t* request)
|
|||
|
||||
init_reply_by_req(&reply, request);
|
||||
|
||||
rc = job_ctrl(c, request->body.jobctrlmsg);
|
||||
rc = job_ctrl(c, request->body.jobctrlmsg);
|
||||
|
||||
/* Commit barrier (ha-commit-barrier-rollout Req 1.1-1.4): the success
|
||||
* reply is sent only after the operation's WAL entry is majority-
|
||||
* committed; barrier failures (-ETIMEDOUT, ...) become the error
|
||||
* reply. Errors from job_ctrl reply immediately — no barrier wait.
|
||||
* job_ctrl released all entity locks before returning, so blocking
|
||||
* here holds no lock. timeout 0 = configured sync_timeout_ms. */
|
||||
if (rc == 0) {
|
||||
rc = persist_commit_barrier(&c->persist, 0);
|
||||
if (rc != 0)
|
||||
WARN("%s commit barrier failed, rc %d", __func__, rc);
|
||||
}
|
||||
|
||||
reply.status = rc;
|
||||
reply.data_which = RequestReply_data_nodata;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue