feat(job-array-single-wal-record): implement single-record array append/commit

Adds persist_submit_job_array_async(): encodes one JobSubmit-shaped
payload (base jobid, array size, one shared spec), appends exactly
one WAL_JOB_ARRAY_SUBMIT entry, and registers exactly one commit
continuation regardless of array size -- reuses the existing
job_commit_adapter_ctx_t/job_commit_resolve_adapter machinery, no
per-element loop. Not yet wired into handle_jobsubmit (task 2.2).

Also fixes a test-helper bug (WAL offset back-computed from the
post-append cursor, only valid for zero-payload entries) that
corrupted state across tests when exercising a nonzero-payload
array-submit entry.

Task 2.1 of job-array-single-wal-record.
This commit is contained in:
Rongsong Shen 2026-07-14 09:50:00 +00:00
parent 76862bd9aa
commit 7c4afbbb83
4 changed files with 559 additions and 1 deletions

View file

@ -25,7 +25,7 @@
- _Boundary: jobj.c Hardening_
- [ ] 2. WAL Array Submission: encode, append, commit
- [ ] 2.1 Implement the single-record array append and commit path
- [x] 2.1 Implement the single-record array append and commit path
- Encode one compact payload carrying (base jobid, array size, one shared job spec) — the same shape as the client's own submit request
- Append it as exactly one `WAL_JOB_ARRAY_SUBMIT` WAL entry and register exactly one commit continuation for it, regardless of array size
- Observable: submitting an array produces one WAL append call and one registered commit continuation in a controlled test, not one per element