Repository navigation
Bound orphan task cleanup transactions - #3313
Draft
hanshengzhao wants to merge 1 commit into
Draft
hanshengzhao wants to merge 1 commit into
hanshengzhao wants to merge 1 commit into
Conversation
Fixes moby#3312 Signed-off-by: hanshengzhao_dxm <hanshengzhao@duxiaoman.com>
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.
Startup cleanup can fail when several orphaned tasks are deleted in one batch. Each delete action carries the full task object, and the batch size estimate is checked after adding an action; the combined Raft request can exceed
MaxTransactionBytesand prevent orchestrator initialization.Delete orphaned tasks in individual store transactions before the existing reconciliation batch. This keeps each proposal bounded while preserving the existing handling for service-backed and standalone tasks. The tradeoff is one Raft proposal per orphan during startup, so cleanup takes longer when a large number of orphaned tasks exists.
The regression test creates three individually valid large orphan tasks and verifies startup removes them while retaining unrelated tasks. It fails against the previous implementation because the combined proposal exceeds the Raft request limit.
Validation:
go test ./manager/orchestrator/taskinit -run TestCheckTasksLargeOrphanTasks -count=1go test ./manager/orchestrator/... ./manager/state/storego test -race ./manager/orchestrator/taskinitgit diff --checkgo test ./...was attempted. Thenodepackage failed inTestManagerRespectsDispatcherRootCAUpdatewithnode did not ready in time; the same test fails on the unmodified base revision. The scheduler failure seen during the full run passed when rerun alone on both base and patch revisions.Fixes #3312