feat(job-array-single-wal-record): wire array submissions into handle_jobsubmit

Branches handle_jobsubmit() on array_size: ==1 continues through
today's exact unmodified single-job path; >1 routes through a new
handle_jobsubmit_array() helper that reuses jobsubmit_async_ctx_t
with pending=1 and calls task 2.1's persist_submit_job_array_async()
instead of looping N single-element appends. Range validation
(jobid_range_exists/inflight_range_try_add) unchanged, same order,
strictly before any WAL append, for both branches.

Retires two pre-existing tests whose premise (N independent
per-element WAL entries with mixed outcomes) is now structurally
impossible with one entry per array; restores array-scoped
job-non-existence coverage for the failed-commit case that an
earlier draft of this change had dropped (Req 2.2/9.2).

Task 2.2 of job-array-single-wal-record.
This commit is contained in:
Rongsong Shen 2026-07-14 10:32:59 +00:00
parent 7c4afbbb83
commit d38ca72e76
3 changed files with 174 additions and 119 deletions

View file

@ -32,7 +32,7 @@
- _Requirements: 1.1, 1.2, 1.3, 4.2, 9.2_
- _Boundary: WAL Array Submission_
- [ ] 2.2 Wire array submissions into the request handler
- [x] 2.2 Wire array submissions into the request handler
- Branch the submission handler on array size: exactly 1 continues through today's existing single-job code path completely unmodified; greater than 1 routes to 2.1's single-append path
- Preserve the existing pre-commit range validation (collision check plus in-flight claim) unchanged and in the same order, still rejecting strictly before any WAL append
- Reuse the existing batched-reply mechanism, setting it to expect exactly one outcome instead of one per element