Skip to content

Add migration to fix incomplete background jobs in database#3113

Merged
ikreymer merged 2 commits into
v1.22.9-releasefrom
issue-3067-rerun-bg-jobs-not-finished
May 25, 2026
Merged

Add migration to fix incomplete background jobs in database#3113
ikreymer merged 2 commits into
v1.22.9-releasefrom
issue-3067-rerun-bg-jobs-not-finished

Conversation

@tw4l
Copy link
Copy Markdown
Member

@tw4l tw4l commented Jan 15, 2026

Fixes #3067

Some background jobs previously failed and did not have success
or finished fields set due to bugs. This migration targets these
jobs and ensures that their finished and success values are set
in the database as expected.

Only jobs that are at least (replica deletion delay + 1) or 7 days
old are targeted to prevent modifying any jobs that are still in
progress or subject to the replica deletion delay.

A new background cron job that will run regularly to to identify
any crawl or profile files that are unreplicated and correct that
will be added in a separate PR.

Comment thread backend/btrixcloud/migrations/migration_0059_replicate_unreplicated_files.py Outdated
Comment thread backend/btrixcloud/migrations/migration_0059_replicate_unreplicated_files.py Outdated
@tw4l tw4l force-pushed the issue-3067-rerun-bg-jobs-not-finished branch 2 times, most recently from e5823e7 to a95d2bb Compare April 16, 2026 10:04
@tw4l tw4l changed the title Fix background jobs that previously failed and were never completed properly Fix incomplete background jobs and ensure everything is replicated that should be May 19, 2026
@tw4l tw4l force-pushed the issue-3067-rerun-bg-jobs-not-finished branch 2 times, most recently from e0c5987 to 7c1f5fb Compare May 21, 2026 14:35
@tw4l tw4l changed the title Fix incomplete background jobs and ensure everything is replicated that should be Add migration to fix incomplete background jobs in database May 21, 2026
@tw4l tw4l marked this pull request as ready for review May 21, 2026 14:38
@tw4l tw4l force-pushed the issue-3067-rerun-bg-jobs-not-finished branch from 7c1f5fb to 4901ed3 Compare May 21, 2026 14:38
@tw4l tw4l requested a review from ikreymer May 21, 2026 14:39
@tw4l tw4l force-pushed the issue-3067-rerun-bg-jobs-not-finished branch from 4901ed3 to a7727d1 Compare May 25, 2026 14:22
Comment thread backend/btrixcloud/migrations/migration_0058_fix_failed_bg_jobs.py
@tw4l tw4l force-pushed the issue-3067-rerun-bg-jobs-not-finished branch from a7727d1 to 7f516a1 Compare May 25, 2026 16:57
tw4l added 2 commits May 25, 2026 14:14
Some background jobs previously failed and did not have success
or finished fields set due to bugs. This migration targets these
jobs and ensures that their finished and success values are set
in the database as expected.

Only jobs that are at least (replica deletion delay + 1) or 7 days
old are targeted to prevent modifying any jobs that are still in
progress or subject to the replica deletion delay.
@ikreymer ikreymer force-pushed the issue-3067-rerun-bg-jobs-not-finished branch from 8421658 to 225f61d Compare May 25, 2026 18:14
@ikreymer ikreymer changed the base branch from main to v1.22.9-release May 25, 2026 18:17
@ikreymer ikreymer merged commit abadadc into v1.22.9-release May 25, 2026
10 checks passed
@ikreymer ikreymer deleted the issue-3067-rerun-bg-jobs-not-finished branch May 25, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: Re-run previously failed background jobs that never had finished/success set

2 participants