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
Operating System and Environment details
Log Fragments
No response
Overview of the Issue
Followup to, and a bit of an oversight of #13927. Migrations that have been
cancelledmay have artifacts (specificallyALTER TABLEmigrations will have artifacts if cancelled after starting).The migration cleanup mechanism does not collect artifacts of
cancelledmigrations; only ofcompletedandfailedmigrations, as per:vitess/go/vt/vttablet/onlineddl/schema.go
Lines 343 to 354 in a8f601d
#13928 fixed
completed_timestampto ensure it's notnull, but that was not enough, we should also have updatedsqlSelectUncollectedArtifacts.Reproduction Steps
Cancel a
vitessALTER TABLEmigration halfway through.Binary Version
Operating System and Environment details
Log Fragments
No response