Repository navigation
fix(persistence): count only bulk-submit runs without progress toward the attempt cap - #3373
Open
angela-helios wants to merge 3 commits into
Open
angela-helios wants to merge 3 commits into
angela-helios wants to merge 3 commits into
Conversation
…ifact cannot be written A manifest past its attempt cap, or one whose manifest could not be fetched, was failed only after its error artifact reached the output store. When that write failed the manifest stayed processing and was claimed again on every lease lapse, without limit. The error artifact is now best effort: a write failure is logged and the manifest is published as failed with no artifact. The abandoned message reports the configured cap instead of the claim count. Closes #3084
… the attempt cap The cap counted every claim that did not end in a graceful release and never went back down. A long import was abandoned after three unrelated interruptions, and a manifest sharing a process with a crashing one lost an attempt on every crash, other tenants' manifests included. The stored attempt count is now cleared when a run records progress: a file walked to its end on every backend, and a committed batch that moves a file's line watermark on SQLite, PostgreSQL and MongoDB. Only consecutive runs that advance nothing reach the cap. S3 keeps no line watermark, so there only a finished file counts. Closes #3083
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This branch has not been deployed
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.
Closes #3083
This branch is stacked on the PR for #3084 (PR #3363). Until #3363 merges, the diff of this PR includes that commit as well.
Behaviour change to review
HFS_BULK_SUBMIT_MAX_ATTEMPTSused to bound every claim of a manifest that did not end in a graceful release, over the manifest's whole life. It now bounds consecutive claims that made no progress.Bulk export has the same cap (#1041) and is not changed here.
Summary
The attempt cap counted claims and never went back down, so a manifest was abandoned after three unrelated interruptions, and a manifest that shared a process with a crashing one lost an attempt each time the process died.
The stored attempt count is now cleared whenever a run records durable progress:
record_output_file_done), on SQLite, PostgreSQL, MongoDB and S3;A batch that only re-walks lines an earlier run already counted clears nothing. Recording a file that was already recorded clears nothing on S3.
There is no schema change, no new setting and no new storage trait method: the fix reuses the
attemptsfield and the progress writes that already exist. The cap check in the worker is unchanged.The
HFS_BULK_SUBMIT_MAX_ATTEMPTSrow incrates/rest/README.mdand in thebulk-data-submitskill (both mirrors) describes the new meaning.Tests
New:
test_only_the_manifest_without_progress_is_abandoned(SQLite): two manifests in two tenants are claimed and left to lapse together three times with a cap of 2. The one that finishes a file in each run is claimed at attempt 1 every time and is stillprocessing; the other is failed with the abandoned message.test_a_batch_past_the_file_watermark_clears_the_attempt_count(SQLite): a batch with new lines clears the count; a batch that re-walks counted lines, and a batch with no file URL, leave the claim charged.a_finished_file_clears_the_attempt_count(S3, mock client): a finished file clears the count; recording the same file again does not.Changed:
file_charge_guards_on_the_progress_that_was_read(MongoDB unit test) now also asserts that both charge updates setattemptsto 0.Not added: a PostgreSQL or MongoDB integration test for the new behaviour. The existing
test_completed_output_files_survive_a_reclaimin both suites runs the changed statements.Existing attempt-cap tests (
test_a_manifest_past_its_attempt_cap_fails_without_running,test_a_manifest_past_its_attempt_cap_fails_when_its_error_artifact_cannot_be_written,test_a_released_claim_is_not_an_attempt).Results:
cargo test -p helios-persistence --libwith all backend features (sqlite, postgres, mongodb, s3, elasticsearch), filtered to the modules the pending fixes touch (among thembulk_submit,error::,composite::,backends::s3): 1081 passed.cargo test -p helios-persistence --test postgres_tests bulk_submitagainst a PostgreSQL container: 65 passed, 1 ignored.test_completed_output_files_survive_a_reclaim: 1 passed.These ran on a branch that also carried other pending fixes, so the suites were verified in combination, not on this branch alone.