Skip to content

Create artifact expiry backfill migration

What does this MR do?

This migration backfills the missing artifact expiry information for artifacts created before June 22nd (when we enabled instance-wide default artifact expiration dates).

  • For any existing artifact without an expiration date that was created > 15 months ago and before Jun 22, 2020 set the expiration date to 3 months from the next 22nd of the current or next month (whichever comes first).
  • For any existing artifact without an expiration date that has a create date less than 15 months ago and created before June 22, 2020 set the expiration date to 1 year from the next 22nd of the current or next month (whichever comes first).
    • Example 1 (Assuming release on Oct 22, 2020) - a job artifact with a creation date Jan 1, 2020 and no expiration date would get an expiration date of Jan 1, 2021.
    • Example 2 (Assuming release on Oct 22, 2020) - a job artifact with a creation date of Jul 1, 2019 and no expiration date would get an expiration date of January 22, 2021.

Related #263234 (closed)

GitLab.com stats

Related #263234 (closed)

Scheduling

batch_size: 200_000, stepping: nil

== 20201208175117 ScheduleBackfillingArtifactExpiryMigration: migrating =======
-- Scheduled 2415 jobs with a maximum of 200000 records per batch and an interval of 120 seconds.

The migration is expected to take at least 289800 seconds. Expect all jobs to have completed after 2020-12-26 20:27:26 UTC."
== 20201208175117 ScheduleBackfillingArtifactExpiryMigration: migrated (949.2506s) 

Screenshot_from_2020-12-23_13-18-01

Job details

  • Job for id range 662793963, 663040301
  • Runtime: 70s

SELECT queries:

Screenshot_from_2020-12-23_17-09-17

UPDATE queries:

Screenshot_from_2020-12-23_17-09-51

Does this MR meet the acceptance criteria?

Conformity

Edited by Matija Čupić

Merge request reports