Implement pausing for submissions#132
Draft
SemMulder wants to merge 2 commits into
Draft
Conversation
Introduce `submissions_paused` and `chunks_paused` tables
(alongside the existing `submissions_{completed,failed,cancelled}` and
`chunks_{completed,failed}` tables).
Pausing a submission atomically moves it from `submissions` →
`submissions_paused` and its remaining chunks from `chunks` →
`chunks_paused`. Because paused chunks are no longer in the `chunks`
table, the consumer dispatcher naturally skips them without any changes
to the dispatch query.
Unpausing reverses the move and notifies waiting consumers.
Paused submissions can also be inserted directly in the paused state
(via the new `paused: bool` field on `InsertSubmission`); in that
case `notify_on_insert` is intentionally not fired.
Paused submissions are cancellable; `cancel_submission` now handles
the case where the submission is found in `submissions_paused`.
a9f5556 to
bcd4161
Compare
Contributor
Author
|
TODO: How to deal with reserved chunks when pausing? |
…usly completed, failed, or paused chunks
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.
Introduce
submissions_pausedandchunks_pausedtables (alongside the existingsubmissions_{completed,failed,cancelled}andchunks_{completed,failed}tables).Pausing a submission atomically moves it from
submissions→submissions_pausedand its remaining chunks fromchunks→chunks_paused. Because paused chunks are no longer in thechunkstable, the consumer dispatcher naturally skips them without any changes to the dispatch query.Unpausing reverses the move and notifies waiting consumers.
Paused submissions can also be inserted directly in the paused state (via the new
paused: boolfield onInsertSubmission); in that casenotify_on_insertis intentionally not fired.Paused submissions are cancellable;
cancel_submissionnow handles the case where the submission is found insubmissions_paused.