Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: OnlineDDL cancelled migration artifacts are not getting cleaned up #14022

Closed
shlomi-noach opened this issue Sep 19, 2023 · 0 comments · Fixed by #14029
Closed

Bug Report: OnlineDDL cancelled migration artifacts are not getting cleaned up #14022

shlomi-noach opened this issue Sep 19, 2023 · 0 comments · Fixed by #14029
Assignees
Labels
Component: Online DDL Online DDL (vitess/native/gh-ost/pt-osc) Type: Bug

Comments

@shlomi-noach
Copy link
Contributor

Overview of the Issue

Followup to, and a bit of an oversight of #13927. Migrations that have been cancelled may have artifacts (specifically ALTER TABLE migrations will have artifacts if cancelled after starting).

The migration cleanup mechanism does not collect artifacts of cancelled migrations; only of completed and failed migrations, as per:

sqlSelectUncollectedArtifacts = `SELECT
migration_uuid,
artifacts,
log_path
FROM _vt.schema_migrations
WHERE
migration_status IN ('complete', 'failed')
AND cleanup_timestamp IS NULL
AND completed_timestamp <= IF(retain_artifacts_seconds=0,
NOW() - INTERVAL %a SECOND,
NOW() - INTERVAL retain_artifacts_seconds SECOND
)

#13928 fixed completed_timestamp to ensure it's not null, but that was not enough, we should also have updated sqlSelectUncollectedArtifacts.

Reproduction Steps

Cancel a vitess ALTER TABLE migration halfway through.

Binary Version

18, 17, 16, probably 15

Operating System and Environment details

-

Log Fragments

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Online DDL Online DDL (vitess/native/gh-ost/pt-osc) Type: Bug
Projects
None yet
1 participant