fix(reconciliation): 对账任务入队 id 超长导致每批 queue_unavailable(CYWL-34) #48
Reference in New Issue
Block a user
Delete Branch "fix/t6-enqueue-job-id"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
候选库实测:19:37 起所有
reconciliation_runs都是failed/error_code=queue_unavailable,没有任何一批进入 worker。根因(存量):
enqueueRun用"job-" + run_id作为jobs.id,而jobs.id是VARCHAR(36);run_id本身已是 36 字符(rec-+ 32 位 hex),拼出来 40 字符 → INSERT 必然失败 → 批次在 claim 之后立刻判 failed。修复:job 自带
job-+ 32 位 hex 的 id(正好 36 字符),幂等仍由唯一idempotency_key(reconciliation-run:<run_id>)保证。新增单测
TestCreateRunEnqueuesJobWithinJobIDLimit:CreateRun的入队请求 id 必须恰好 36 字符,type/idempotency_key/payload 与 run 一致。验证:
go test ./internal/reconciliation/通过;make verify17 项 = 16 success + identity skipped。契约未动。