Repository navigation
feat(task-queue): scheduling handoff watermarks (revision 175) - #591
Closed
aivong-openhands wants to merge 1 commit into
Closed
aivong-openhands wants to merge 1 commit into
aivong-openhands wants to merge 1 commit into
Conversation
Contributor
|
|
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||
aivong-openhands
force-pushed
the
task-queue/06-watermarks
branch
from
September 30, 2026 06:14
e4a6197 to
abbcd35
Compare
aivong-openhands
force-pushed
the
task-queue/05-recovery
branch
from
September 30, 2026 06:14
2df3394 to
4595f83
Compare
1 of 6 tasks
aivong-openhands
force-pushed
the
task-queue/05-recovery
branch
from
September 30, 2026 18:44
4595f83 to
45286ad
Compare
aivong-openhands
force-pushed
the
task-queue/06-watermarks
branch
from
September 30, 2026 18:44
abbcd35 to
6fe75b7
Compare
aivong-openhands
force-pushed
the
task-queue/05-recovery
branch
from
September 30, 2026 20:55
45286ad to
9a1cb45
Compare
aivong-openhands
force-pushed
the
task-queue/06-watermarks
branch
from
September 30, 2026 20:55
a2b1c4d to
de589aa
Compare
Procrastinate has no record of what a CronJob already ran, and a single cutover instant drops the occurrence neither scheduler performed. scheduled_job_watermark holds, per job, the last occurrence known to have completed and how that was established. - Each occurrence checks its job's watermark first: completed or skipped at or before the mark is skipped as skipped_watermark; missed, unknown and anything after the mark run. unknown runs because a duplicate of these jobs is bounded while a skip is silent loss. - A skip also needs supersedes_earlier on the row and single_watermark on the job, declared per job so a future occurrence-specific job does not inherit the assumption. - After an executed run the task advances the mark, forward only. The advance is advisory: if it fails the run still succeeds and the occurrence may run again, which is the safe direction. - python -m server.task_queue.watermark record/show for the operator at cutover (T1.10.1 step 3); operator records are authoritative. - Revision 175 grants TASK_QUEUE_DB_ROLE DML on the table, no DDL. OHE-3417 (Track 1, T1.8) Co-authored-by: openhands <openhands@all-hands.dev>
aivong-openhands
force-pushed
the
task-queue/05-recovery
branch
from
September 30, 2026 21:59
9a1cb45 to
af1314e
Compare
aivong-openhands
force-pushed
the
task-queue/06-watermarks
branch
from
September 30, 2026 21:59
de589aa to
3dceda5
Compare
Contributor
Author
|
Closing: superseded by the revised CronJob migration plan for OHE-3417 (rev 16). That plan replaces the single watermark table with a per-occurrence table. Revision 175 also now belongs to #599. The branch is kept for reference. Worth reusing in the new work, under a new migration number: the 'unknown means run' rule, the operator record/show CLI for seeding at cutover, and the drain-boundary tests (#19, #20, #22b). This comment was posted by an AI agent (OpenHands) on behalf of @aivong-openhands. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 6/7: OHE-3417 Track 1. Based on #590. Implements T1.8.
Why
Procrastinate has no record that a CronJob already ran an occurrence, and a single cutover instant drops a run that neither scheduler performed. Example: suspend at 05:59, a daily job due at 06:00, drain complete at 06:02. A cutover timestamp of 06:02 skips 06:00, though nothing ran it.
Change
Revision 175 adds
scheduled_job_watermark: per job, the last occurrence known complete, its classification, and whether a later run supersedes an earlier one.TASK_QUEUE_DB_ROLEgets DML on it, no DDL.completedskipped_watermark)skippedmissed/unknownunknownruns because these jobs are safe to repeat: a duplicate is bounded, while a skip is silent loss. SincesuccessfulJobsHistoryLimittruncates Job history,unknownwill be the common case.supersedes_earlieron the row andsingle_watermarkon the job. That is declared perScheduledJob, so a future occurrence-specific job does not inherit the assumption silently.python -m server.task_queue.watermark record --job … --occurrence <ISO with offset> --classification … --by …andshow. Operator records are authoritative, and a naive timestamp is rejected.Tests
unknownruns rather than skips.completedandskippedare not re-run, and the full decision table is covered.max_delay), and the watermark decides.This PR was created by an AI agent (OpenHands) on behalf of the user.
@aivong-openhands can click here to continue refining the PR
Enterprise server image for this PR: