Skip to content
Snippets Groups Projects

Delete old pipelines

Merged Marius Bobin requested to merge 498969-test-poc into master
All threads resolved!

What does this MR do and why?

Allow users to set pipeline expiry times per project and delete expired pipelines.

This won't work effectively with millions of projects, but that's expected. We want to see how popular this feature is before investing more time into building a robust solution.

References

Please include cross links to any resources that are relevant to this MR This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

image

How to set up and validate locally

  1. In rails console enable the experiment fully
    Feature.enable(:ci_delete_old_pipelines)
  2. Visit any project CI/CD settings pages such as http://127.0.0.1:3000/root/new-taggings/-/settings/ci_cd
  3. Fill in Delete old pipelines with a desired value
  4. Wait till the cron worker is executed(11 minutes tops).
  5. Notice that 250 pipelines are gone.

Related to #498969 (closed)

Edited by Marius Bobin

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 4 Warnings
    :warning: a990f4ec: Commits that change 30 or more lines across at least 3 files should describe these changes in the commit body. For more information, take a look at our Commit message guidelines.
    :warning: 1d33ad2b: The commit subject must contain at least 3 words. For more information, take a look at our Commit message guidelines.
    :warning: 835228e6: Commits that change 30 or more lines across at least 3 files should describe these changes in the commit body. For more information, take a look at our Commit message guidelines.
    :warning: f3cfd2b0: Commits that change 30 or more lines across at least 3 files should describe these changes in the commit body. For more information, take a look at our Commit message guidelines.
    1 Message
    :book: CHANGELOG missing:

    If this merge request needs a changelog entry, add the Changelog trailer to the commit message you want to add to the changelog.

    If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.

    Reviewer roulette

    Category Reviewer Maintainer
    backend @shreyasagarwal profile link current availability (UTC+1, 1 hour behind author) @radbatnag profile link current availability (UTC+8, 6 hours ahead of author)
    database @fcatteau profile link current availability (UTC+1, 1 hour behind author) @l.rosa profile link current availability (UTC-3, 5 hours behind author)
    ~"Verify" Reviewer review is optional for ~"Verify" @hfyngvason profile link current availability (UTC-5, 7 hours behind author)

    Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.

    Sidekiq queue changes

    This merge request contains changes to Sidekiq queues. Please follow the documentation on changing a queue's urgency.

    These queues were added:

    • cronjob:ci_schedule_old_pipelines_removal_cron
    • ci_destroy_old_pipelines

    If needed, you can retry the :repeat: danger-review job that generated this comment.

    Generated by :no_entry_sign: Danger

  • Edited by ****
  • mentioned in issue #498969 (closed)

  • :tools: Generated by gitlab_quality-test_tooling.


    :snail: Slow tests detected in this merge request. These slow tests might be related to this merge request's changes.

    Click to expand
    Job File Name Duration Expected duration
    #8229630956 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 53.78 s < 27.12 s
    #8229633895 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 52.52 s < 27.12 s
    #8236184669 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 49.87 s < 27.12 s
    #8237396361 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 40.79 s < 27.12 s
    #8238920373 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 53.37 s < 27.12 s
    #8238918721 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 56.94 s < 27.12 s
    #8272051612 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 38.73 s < 27.12 s
    #8272051098 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 47.5 s < 27.12 s
    #8274521330 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 57.7 s < 27.12 s
    #8274520955 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 57.93 s < 27.12 s
    #8284555047 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 43.7 s < 27.12 s
    #8284555638 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 44.71 s < 27.12 s
    #8294497051 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 47.8 s < 27.12 s
    #8294498761 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 42.06 s < 27.12 s
    #8374646565 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 31.97 s < 27.12 s
    #8374650764 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 47.31 s < 27.12 s
    #8374645711 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 45.33 s < 27.12 s
    #8374651193 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 52.33 s < 27.12 s
    #8374651539 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 52.53 s < 27.12 s
    #8374647012 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 56.07 s < 27.12 s
    #8374646165 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 35.91 s < 27.12 s
    #8374651885 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 63.25 s < 27.12 s
    #8379639227 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 30.36 s < 27.12 s
    #8379639617 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 30.65 s < 27.12 s
    #8379640005 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 53.82 s < 27.12 s
    #8379639362 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 44.96 s < 27.12 s
    #8379641296 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 52.57 s < 27.12 s
    #8379641423 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 45.37 s < 27.12 s
    #8379641168 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 54.15 s < 27.12 s
    #8379641533 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 43.71 s < 27.12 s
    #8483319054 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 47.56 s < 27.12 s
    #8483322327 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 48.73 s < 27.12 s
    #8483319291 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 37.25 s < 27.12 s
    #8483321586 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 50.16 s < 27.12 s
    #8483319537 spec/lib/gitlab/database/decomposition/migrate_spec.rb#L103 Gitlab::Database::Decomposition::Migrate#process! when the checks pass copies main database to ci database 33.98 s < 27.12 s
    #8483319537 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 49.8 s < 27.12 s
    #8483318678 spec/lib/search/project_settings_spec.rb#L6 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 44.25 s < 27.12 s
    #8483322763 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 53.37 s < 27.12 s
    #8483321368 ee/spec/lib/ee/search/project_settings_spec.rb#L20 Search results for project settings behaves like all project settings sections exist and have correct anchor links has only valid settings sections 57.13 s < 27.12 s
  • A deleted user added rspec:slow test detected label
  • Marius Bobin added 1 commit

    added 1 commit

    Compare with previous version

  • Marius Bobin added 2 commits

    added 2 commits

    • 030944fd - Add tests for pipeline destruction services
    • 043e3075 - More project tests fixes

    Compare with previous version

  • Marius Bobin added 2 commits

    added 2 commits

    Compare with previous version

  • Marius Bobin
  • Marius Bobin added 2 commits

    added 2 commits

    Compare with previous version

  • Edited by ****
  • Marius Bobin added 1 commit

    added 1 commit

    Compare with previous version

  • Marius Bobin added 636 commits

    added 636 commits

    Compare with previous version

  • Marius Bobin added 1 commit

    added 1 commit

    Compare with previous version

  • Marius Bobin added 702 commits

    added 702 commits

    Compare with previous version

  • Marius Bobin
  • Marius Bobin
  • drew stachon mentioned in merge request !122122 (closed)

    mentioned in merge request !122122 (closed)

  • Marius Bobin added 1 commit

    added 1 commit

    Compare with previous version

  • Marius Bobin changed title from WIP: Delete old pipelines to Delete old pipelines

    changed title from WIP: Delete old pipelines to Delete old pipelines

  • Marius Bobin added 512 commits

    added 512 commits

    Compare with previous version

  • Marius Bobin changed the description

    changed the description

  • Marius Bobin requested review from @tianwenchen

    requested review from @tianwenchen

  • drew stachon
  • @mbobin Probably better to have this thread on your more recent MR:

    @mbobin: Maybe !122122 (closed) could be the instance default and !171142 (merged) would help users that want more aggressive removal(if we are to add both)?

    I think it's pretty likely that we will add both. If retention periods are a thing that we're going to implement, I think it's pretty likely that we'll have some level of enforcement by plan at the instance level that would act as an outer bound for any given ProjectCiCdSetting. However the execution gets set up, we should probably have a worker that can act based on either policy.

  • drew stachon
  • drew stachon
  • Tianwen Chen approved this merge request

    approved this merge request

  • added pipelinetier-2 label and removed pipelinetier-1 label

  • Before you set this MR to auto-merge

    This merge request will progress on pipeline tiers until it reaches the last tier: pipelinetier-3. We will trigger a new pipeline for each transition to a higher tier.

    Before you set this MR to auto-merge, please check the following:

    • You are the last maintainer of this merge request
    • The latest pipeline for this merge request is pipelinetier-3 (You can find which tier it is in the pipeline name)
    • This pipeline is recent enough (created in the last 8 hours)

    If all the criteria above apply, please set auto-merge for this merge request.

    See pipeline tiers and merging a merge request for more details.

  • Tianwen Chen removed review request for @tianwenchen

    removed review request for @tianwenchen

  • E2E Test Result Summary

    allure-report-publisher generated test report!

    e2e-test-on-gdk: :white_check_mark: test report for 30f37310

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Create      | 117    | 0      | 2       | 0     | 119   | ✅     |
    | Plan        | 68     | 0      | 0       | 0     | 68    | ✅     |
    | Govern      | 59     | 0      | 3       | 0     | 62    | ✅     |
    | Verify      | 41     | 0      | 1       | 0     | 42    | ✅     |
    | Package     | 25     | 0      | 0       | 0     | 25    | ✅     |
    | Monitor     | 8      | 0      | 0       | 0     | 8     | ✅     |
    | Data Stores | 28     | 0      | 0       | 0     | 28    | ✅     |
    | Manage      | 1      | 0      | 0       | 0     | 1     | ✅     |
    | Secure      | 4      | 0      | 0       | 0     | 4     | ✅     |
    | Release     | 4      | 0      | 0       | 0     | 4     | ✅     |
    | Analytics   | 1      | 0      | 0       | 0     | 1     | ✅     |
    | Fulfillment | 1      | 0      | 0       | 0     | 1     | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 357    | 0      | 6       | 0     | 363   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+

    e2e-test-on-cng: :white_check_mark: test report for 30f37310

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Verify      | 49     | 0      | 16      | 0     | 65    | ✅     |
    | Create      | 140    | 0      | 20      | 0     | 160   | ✅     |
    | Plan        | 86     | 0      | 8       | 0     | 94    | ✅     |
    | Data Stores | 33     | 0      | 10      | 0     | 43    | ✅     |
    | Package     | 24     | 0      | 14      | 0     | 38    | ✅     |
    | Secure      | 2      | 0      | 5       | 0     | 7     | ✅     |
    | Govern      | 84     | 0      | 9       | 1     | 93    | ✅     |
    | Configure   | 0      | 0      | 3       | 0     | 3     | ➖     |
    | Monitor     | 8      | 0      | 12      | 0     | 20    | ✅     |
    | Analytics   | 2      | 0      | 0       | 1     | 2     | ✅     |
    | Release     | 5      | 0      | 1       | 0     | 6     | ✅     |
    | Fulfillment | 2      | 0      | 7       | 1     | 9     | ✅     |
    | Manage      | 1      | 0      | 9       | 0     | 10    | ✅     |
    | Growth      | 0      | 0      | 2       | 0     | 2     | ➖     |
    | Ai-powered  | 0      | 0      | 2       | 0     | 2     | ➖     |
    | ModelOps    | 0      | 0      | 1       | 0     | 1     | ➖     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 436    | 0      | 119     | 3     | 555   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
  • Marius Bobin requested review from @drew and @l.rosa

    requested review from @drew and @l.rosa

  • Marius Bobin added 1508 commits

    added 1508 commits

    Compare with previous version

  • Marius Bobin reset approvals from @tianwenchen by pushing to the branch

    reset approvals from @tianwenchen by pushing to the branch

  • drew stachon
  • drew stachon
  • drew stachon
  • drew stachon
  • drew stachon
  • drew stachon
  • drew stachon
  • drew stachon
  • drew stachon
  • drew stachon
  • Hey @mbobin, I left kind of a lot of notes :sweat_smile: but a lot of them are just discussion items about our strategy. Let me know what you think?

  • drew stachon mentioned in issue #505338

    mentioned in issue #505338

  • drew stachon
  • Marius Bobin
  • Marius Bobin
  • drew stachon
  • Marius Bobin mentioned in merge request !173512 (merged)

    mentioned in merge request !173512 (merged)

  • @mbobin, I appreciate your patience with this. I'll be taking a looking today :call_me:

  • @mbobin, thanks! Great implementation. I left you some questions :thumbsup:

  • Marius Bobin added 2094 commits

    added 2094 commits

    Compare with previous version

  • Marius Bobin added 2 commits

    added 2 commits

    • cf848c42 - Set pipeline expiry time
    • a9d5a62c - Implement old pipelines deletion

    Compare with previous version

  • Marius Bobin mentioned in merge request !173982 (merged)

    mentioned in merge request !173982 (merged)

  • Marius Bobin added 460 commits

    added 460 commits

    Compare with previous version

  • Marius Bobin added 1 commit

    added 1 commit

    Compare with previous version

  • Marius Bobin
  • Marius Bobin
  • Marius Bobin changed milestone to %17.7

    changed milestone to %17.7

  • Author Maintainer

    @drew this is now running with LimitedCapacity::Worker. The tests pass, but I have to fix my gdk to try it out E2E. :unamused:

  • Marius Bobin added 154 commits

    added 154 commits

    Compare with previous version

  • Marius Bobin added 1 commit

    added 1 commit

    Compare with previous version

  • Marius Bobin added 99 commits

    added 99 commits

    Compare with previous version

  • Marius Bobin
  • drew stachon
  • drew stachon
  • drew stachon
  • drew stachon
    • Resolved by drew stachon

      @mbobin This looks great. The only pieces I'm really still thinking about are the processing limits and how we handle the queueing and deletion throughput.

      And I find them so much easier to understand in the LimitedCapacity::Worker framework :grinning:

  • Marius Bobin added 525 commits

    added 525 commits

    Compare with previous version

  • Marius Bobin added 1 commit

    added 1 commit

    • a990f4ec - Batch over project ci cd settings

    Compare with previous version

  • Marius Bobin added 1 commit

    added 1 commit

    Compare with previous version

  • Database migrations (on the main database)

    Migrations included in this change have been executed on gitlab.com data for testing purposes. For details, please see the migration testing pipeline (limited access).

    Migration Type Total runtime Result DB size change
    20241204133318 - IndexProjectCiCdSettingsForPipelineRemoval Post deploy 15.3 s :white_check_mark: +8.00 KiB [note]
    Runtime Histogram for all migrations
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 0
    0.1 seconds - 1 second 3
    1 second - 5 seconds 0
    5 seconds - 15 seconds 1
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20241204133318 - IndexProjectCiCdSettingsForPipelineRemoval

    * Type: Post deploy
    * Duration: 15.3 s
    * Database size change: +8.00 KiB [note]
    Calls Total Time Max Time Mean Time Rows Query
    1 8564.4 ms 8564.4 ms 8564.4 ms 0
    CREATE INDEX CONCURRENTLY "index_project_ci_cd_settings_on_project_id_partial" ON "project_ci_cd_settings" ("project_id")
    WHERE delete_pipelines_in_seconds IS NOT NULL
    1 2.1 ms 2.1 ms 2.1 ms 0
    DROP INDEX CONCURRENTLY "index_project_ci_cd_settings_on_id_partial"
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for IndexProjectCiCdSettingsForPipelineRemoval
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 0
    0.1 seconds - 1 second 3
    1 second - 5 seconds 0
    5 seconds - 15 seconds 1
    15 seconds - 5 minutes 0
    5 minutes + 0

    Background Migration: BackfillSentryIssuesNamespaceId

    Sampled 66 batches. Estimated Time to complete: 16 minutes
    • Interval: 120s
    • Max batch size: 0
    • Estimated seconds to complete: 960s
    • Average batch time: 3.67s
    • Batch size: 1000
    • N. of batches sampled: 66
    • N. of failed batches: 0

    Time estimation is conservative and based on sampling production data in a test environment. It represents the max time that migration could take. The actual time may differ from this estimation.

    Consider changing max_batch_size and interval if this estimate is unacceptable.

    Calls Total Time Max Time Mean Time Rows Query
    337 242.7 ms 22.8 ms 0.7 ms 1900
    UPDATE sentry_issues
    SET namespace_id = issues.namespace_id
    FROM issues
    WHERE issues.id = sentry_issues.issue_id AND sentry_issues.id IN (
    SELECT sentry_issues.id
    FROM sentry_issues
    WHERE sentry_issues.id BETWEEN $1 AND $2 AND sentry_issues.id >= $3 AND sentry_issues.id < $4 AND sentry_issues.namespace_id IS NULL
    )
    66 27.2 ms 12.0 ms 0.4 ms 221
    UPDATE sentry_issues
    SET namespace_id = issues.namespace_id
    FROM issues
    WHERE issues.id = sentry_issues.issue_id AND sentry_issues.id IN (
    SELECT sentry_issues.id
    FROM sentry_issues
    WHERE sentry_issues.id BETWEEN $1 AND $2 AND sentry_issues.id >= $3 AND sentry_issues.namespace_id IS NULL
    )
    66 8.5 ms 0.7 ms 0.1 ms 66
    UPDATE batched_background_migration_jobs
    SET updated_at = $1, finished_at = $2, status = $3, metrics = $4
    WHERE batched_background_migration_jobs.id = $5
    132 17.1 ms 0.6 ms 0.1 ms 132
    INSERT INTO batched_background_migration_job_transition_logs (batched_background_migration_job_id, created_at, updated_at, previous_status, next_status) VALUES ($1, $2, $3, $4, $5) RETURNING id
    66 8.3 ms 0.2 ms 0.1 ms 66
    UPDATE batched_background_migration_jobs
    SET updated_at = $1, started_at = $2, status = $3, attempts = $4
    WHERE batched_background_migration_jobs.id = $5
    403 17.5 ms 0.2 ms 0.0 ms 337
    SELECT sentry_issues.id
    FROM sentry_issues
    WHERE sentry_issues.id BETWEEN $1 AND $2 AND sentry_issues.id >= $3
    ORDER BY sentry_issues.id ASC
    LIMIT $4
    OFFSET $5
    132 5.1 ms 0.1 ms 0.0 ms 132
    SELECT batched_background_migration_jobs.*
    FROM batched_background_migration_jobs
    WHERE batched_background_migration_jobs.id = $1
    LIMIT $2
    66 3.3 ms 0.1 ms 0.0 ms 66
    SELECT sum(batched_background_migration_jobs.batch_size)
    FROM batched_background_migration_jobs
    WHERE batched_background_migration_jobs.batched_background_migration_id = $1 AND batched_background_migration_jobs.status IN ($2)
    66 1.3 ms 0.0 ms 0.0 ms 66
    SELECT sentry_issues.id
    FROM sentry_issues
    WHERE sentry_issues.id BETWEEN $1 AND $2
    ORDER BY sentry_issues.id ASC
    LIMIT $3
    Histogram of batch runtimes for BackfillSentryIssuesNamespaceId
    Batch Runtime Count
    0 seconds - 10 seconds 66
    10 seconds - 1 minute 0
    1 minute - 2 minutes 0
    2 minutes - 3 minutes 0
    3 minutes - 5 minutes 0
    5 minutes + 0
    Histogram across all sampled batches of BackfillSentryIssuesNamespaceId
    Query Runtime Count
    0 seconds - 0.1 seconds 0
    0.1 seconds - 0.5 seconds 1334
    0.5 seconds - 1 second 0
    1 second - 2 seconds 0
    2 seconds - 5 seconds 0
    5 seconds + 0

    Background Migration: DeleteOrphanedGroups

    Sampled 11 batches. Estimated Time to complete: 2 months, 3 weeks, 6 days, 19 hours, 41 minutes, and 48 seconds
    • Interval: 120s
    • Max batch size: 0
    • Estimated seconds to complete: 7663200s
    • Average batch time: 5.59s
    • Batch size: 1000
    • N. of batches sampled: 11
    • N. of failed batches: 0

    Time estimation is conservative and based on sampling production data in a test environment. It represents the max time that migration could take. The actual time may differ from this estimation.

    Consider changing max_batch_size and interval if this estimate is unacceptable.

    Calls Total Time Max Time Mean Time Rows Query
    99 6185.0 ms 2935.3 ms 62.5 ms 0
    SELECT namespaces.id
    FROM namespaces
    LEFT JOIN namespaces parent ON namespaces.parent_id = parent.id
    WHERE namespaces.id BETWEEN $1 AND $2 AND namespaces.type = $3 AND namespaces.parent_id IS NOT NULL AND namespaces.id >= $4 AND namespaces.id < $5 AND parent.id IS NULL
    11 271.7 ms 56.1 ms 24.7 ms 0
    SELECT namespaces.id
    FROM namespaces
    LEFT JOIN namespaces parent ON namespaces.parent_id = parent.id
    WHERE namespaces.id BETWEEN $1 AND $2 AND namespaces.type = $3 AND namespaces.parent_id IS NOT NULL AND namespaces.id >= $4 AND parent.id IS NULL
    110 169.2 ms 16.5 ms 1.5 ms 99
    SELECT namespaces.id
    FROM namespaces
    WHERE namespaces.id BETWEEN $1 AND $2 AND namespaces.type = $3 AND namespaces.parent_id IS NOT NULL AND namespaces.id >= $4
    ORDER BY namespaces.id ASC
    LIMIT $5
    OFFSET $6
    22 11.2 ms 8.1 ms 0.5 ms 22
    INSERT INTO batched_background_migration_job_transition_logs (batched_background_migration_job_id, created_at, updated_at, previous_status, next_status) VALUES ($1, $2, $3, $4, $5) RETURNING id
    11 8.9 ms 4.5 ms 0.8 ms 11
    UPDATE batched_background_migration_jobs
    SET updated_at = $1, finished_at = $2, status = $3, metrics = $4
    WHERE batched_background_migration_jobs.id = $5
    11 3.5 ms 1.5 ms 0.3 ms 11
    UPDATE batched_background_migration_jobs
    SET updated_at = $1, started_at = $2, status = $3, attempts = $4
    WHERE batched_background_migration_jobs.id = $5
    11 0.4 ms 0.1 ms 0.0 ms 11
    SELECT namespaces.id
    FROM namespaces
    WHERE namespaces.id BETWEEN $1 AND $2 AND namespaces.type = $3 AND namespaces.parent_id IS NOT NULL
    ORDER BY namespaces.id ASC
    LIMIT $4
    22 0.8 ms 0.0 ms 0.0 ms 22
    SELECT batched_background_migration_jobs.*
    FROM batched_background_migration_jobs
    WHERE batched_background_migration_jobs.id = $1
    LIMIT $2
    11 0.4 ms 0.0 ms 0.0 ms 11
    SELECT sum(batched_background_migration_jobs.batch_size)
    FROM batched_background_migration_jobs
    WHERE batched_background_migration_jobs.batched_background_migration_id = $1 AND batched_background_migration_jobs.status IN ($2)
    Histogram of batch runtimes for DeleteOrphanedGroups
    Batch Runtime Count
    0 seconds - 10 seconds 11
    10 seconds - 1 minute 0
    1 minute - 2 minutes 0
    2 minutes - 3 minutes 0
    3 minutes - 5 minutes 0
    5 minutes + 0
    Histogram across all sampled batches of DeleteOrphanedGroups
    Query Runtime Count
    0 seconds - 0.1 seconds 0
    0.1 seconds - 0.5 seconds 307
    0.5 seconds - 1 second 0
    1 second - 2 seconds 0
    2 seconds - 5 seconds 1
    5 seconds + 0

    Background Migration: BackfillIssueMetricsNamespaceId

    Sampled 51 batches. Estimated Time to complete: 3 months, 1 week, 2 days, 8 hours, 28 minutes, and 42 seconds
    • Interval: 120s
    • Max batch size: 0
    • Estimated seconds to complete: 8697360s
    • Average batch time: 5.35s
    • Batch size: 1000
    • N. of batches sampled: 51
    • N. of failed batches: 0

    Time estimation is conservative and based on sampling production data in a test environment. It represents the max time that migration could take. The actual time may differ from this estimation.

    Consider changing max_batch_size and interval if this estimate is unacceptable.

    Calls Total Time Max Time Mean Time Rows Query
    450 16751.1 ms 226.6 ms 37.2 ms 45000
    UPDATE issue_metrics
    SET namespace_id = issues.namespace_id
    FROM issues
    WHERE issues.id = issue_metrics.issue_id AND issue_metrics.id IN (
    SELECT issue_metrics.id
    FROM issue_metrics
    WHERE issue_metrics.id BETWEEN $1 AND $2 AND issue_metrics.id >= $3 AND issue_metrics.id < $4 AND issue_metrics.namespace_id IS NULL
    )
    51 1625.1 ms 100.4 ms 31.9 ms 5001
    UPDATE issue_metrics
    SET namespace_id = issues.namespace_id
    FROM issues
    WHERE issues.id = issue_metrics.issue_id AND issue_metrics.id IN (
    SELECT issue_metrics.id
    FROM issue_metrics
    WHERE issue_metrics.id BETWEEN $1 AND $2 AND issue_metrics.id >= $3 AND issue_metrics.namespace_id IS NULL
    )
    501 127.2 ms 4.4 ms 0.3 ms 450
    SELECT issue_metrics.id
    FROM issue_metrics
    WHERE issue_metrics.id BETWEEN $1 AND $2 AND issue_metrics.id >= $3
    ORDER BY issue_metrics.id ASC
    LIMIT $4
    OFFSET $5
    102 14.6 ms 1.0 ms 0.1 ms 102
    INSERT INTO batched_background_migration_job_transition_logs (batched_background_migration_job_id, created_at, updated_at, previous_status, next_status) VALUES ($1, $2, $3, $4, $5) RETURNING id
    51 6.4 ms 0.4 ms 0.1 ms 51
    UPDATE batched_background_migration_jobs
    SET updated_at = $1, started_at = $2, status = $3, attempts = $4
    WHERE batched_background_migration_jobs.id = $5
    51 6.3 ms 0.3 ms 0.1 ms 51
    UPDATE batched_background_migration_jobs
    SET updated_at = $1, finished_at = $2, status = $3, metrics = $4
    WHERE batched_background_migration_jobs.id = $5
    51 2.3 ms 0.1 ms 0.0 ms 51
    SELECT sum(batched_background_migration_jobs.batch_size)
    FROM batched_background_migration_jobs
    WHERE batched_background_migration_jobs.batched_background_migration_id = $1 AND batched_background_migration_jobs.status IN ($2)
    102 4.0 ms 0.1 ms 0.0 ms 102
    SELECT batched_background_migration_jobs.*
    FROM batched_background_migration_jobs
    WHERE batched_background_migration_jobs.id = $1
    LIMIT $2
    51 1.8 ms 0.1 ms 0.0 ms 51
    SELECT issue_metrics.id
    FROM issue_metrics
    WHERE issue_metrics.id BETWEEN $1 AND $2
    ORDER BY issue_metrics.id ASC
    LIMIT $3
    Histogram of batch runtimes for BackfillIssueMetricsNamespaceId
    Batch Runtime Count
    0 seconds - 10 seconds 51
    10 seconds - 1 minute 0
    1 minute - 2 minutes 0
    2 minutes - 3 minutes 0
    3 minutes - 5 minutes 0
    5 minutes + 0
    Histogram across all sampled batches of BackfillIssueMetricsNamespaceId
    Query Runtime Count
    0 seconds - 0.1 seconds 0
    0.1 seconds - 0.5 seconds 1410
    0.5 seconds - 1 second 0
    1 second - 2 seconds 0
    2 seconds - 5 seconds 0
    5 seconds + 0

    Background Migration: BackfillIssueCustomerRelationsContactsNamespaceId

    Sampled 63 batches. Estimated Time to complete: 6 minutes
    • Interval: 120s
    • Max batch size: 0
    • Estimated seconds to complete: 360s
    • Average batch time: 3.93s
    • Batch size: 1000
    • N. of batches sampled: 63
    • N. of failed batches: 0

    Time estimation is conservative and based on sampling production data in a test environment. It represents the max time that migration could take. The actual time may differ from this estimation.

    Consider changing max_batch_size and interval if this estimate is unacceptable.

    Calls Total Time Max Time Mean Time Rows Query
    355 2878.8 ms 176.3 ms 8.1 ms 2462
    UPDATE issue_customer_relations_contacts
    SET namespace_id = issues.namespace_id
    FROM issues
    WHERE issues.id = issue_customer_relations_contacts.issue_id AND issue_customer_relations_contacts.id IN (
    SELECT issue_customer_relations_contacts.id
    FROM issue_customer_relations_contacts
    WHERE issue_customer_relations_contacts.id BETWEEN $1 AND $2 AND issue_customer_relations_contacts.id >= $3 AND issue_customer_relations_contacts.id < $4 AND issue_customer_relations_contacts.namespace_id IS NULL
    )
    63 244.6 ms 129.0 ms 3.9 ms 222
    UPDATE issue_customer_relations_contacts
    SET namespace_id = issues.namespace_id
    FROM issues
    WHERE issues.id = issue_customer_relations_contacts.issue_id AND issue_customer_relations_contacts.id IN (
    SELECT issue_customer_relations_contacts.id
    FROM issue_customer_relations_contacts
    WHERE issue_customer_relations_contacts.id BETWEEN $1 AND $2 AND issue_customer_relations_contacts.id >= $3 AND issue_customer_relations_contacts.namespace_id IS NULL
    )
    63 10.9 ms 1.4 ms 0.2 ms 63
    UPDATE batched_background_migration_jobs
    SET updated_at = $1, finished_at = $2, status = $3, metrics = $4
    WHERE batched_background_migration_jobs.id = $5
    63 8.5 ms 0.7 ms 0.1 ms 63
    UPDATE batched_background_migration_jobs
    SET updated_at = $1, started_at = $2, status = $3, attempts = $4
    WHERE batched_background_migration_jobs.id = $5
    126 18.2 ms 0.6 ms 0.1 ms 126
    INSERT INTO batched_background_migration_job_transition_logs (batched_background_migration_job_id, created_at, updated_at, previous_status, next_status) VALUES ($1, $2, $3, $4, $5) RETURNING id
    126 5.0 ms 0.2 ms 0.0 ms 126
    SELECT batched_background_migration_jobs.*
    FROM batched_background_migration_jobs
    WHERE batched_background_migration_jobs.id = $1
    LIMIT $2
    418 19.2 ms 0.2 ms 0.0 ms 355
    SELECT issue_customer_relations_contacts.id
    FROM issue_customer_relations_contacts
    WHERE issue_customer_relations_contacts.id BETWEEN $1 AND $2 AND issue_customer_relations_contacts.id >= $3
    ORDER BY issue_customer_relations_contacts.id ASC
    LIMIT $4
    OFFSET $5
    63 3.1 ms 0.1 ms 0.0 ms 63
    SELECT sum(batched_background_migration_jobs.batch_size)
    FROM batched_background_migration_jobs
    WHERE batched_background_migration_jobs.batched_background_migration_id = $1 AND batched_background_migration_jobs.status IN ($2)
    63 1.4 ms 0.0 ms 0.0 ms 63
    SELECT issue_customer_relations_contacts.id
    FROM issue_customer_relations_contacts
    WHERE issue_customer_relations_contacts.id BETWEEN $1 AND $2
    ORDER BY issue_customer_relations_contacts.id ASC
    LIMIT $3
    Histogram of batch runtimes for BackfillIssueCustomerRelationsContactsNamespaceId
    Batch Runtime Count
    0 seconds - 10 seconds 63
    10 seconds - 1 minute 0
    1 minute - 2 minutes 0
    2 minutes - 3 minutes 0
    3 minutes - 5 minutes 0
    5 minutes + 0
    Histogram across all sampled batches of BackfillIssueCustomerRelationsContactsNamespaceId
    Query Runtime Count
    0 seconds - 0.1 seconds 0
    0.1 seconds - 0.5 seconds 1340
    0.5 seconds - 1 second 0
    1 second - 2 seconds 0
    2 seconds - 5 seconds 0
    5 seconds + 0

    Background Migration: BackfillIssueEmailParticipantsNamespaceId

    Sampled 53 batches. Estimated Time to complete: 3 days, 6 hours, and 8 minutes
    • Interval: 120s
    • Max batch size: 0
    • Estimated seconds to complete: 281280s
    • Average batch time: 5.03s
    • Batch size: 1000
    • N. of batches sampled: 53
    • N. of failed batches: 0

    Time estimation is conservative and based on sampling production data in a test environment. It represents the max time that migration could take. The actual time may differ from this estimation.

    Consider changing max_batch_size and interval if this estimate is unacceptable.

    Calls Total Time Max Time Mean Time Rows Query
    468 5611.5 ms 102.9 ms 12.0 ms 29700
    UPDATE issue_email_participants
    SET namespace_id = issues.namespace_id
    FROM issues
    WHERE issues.id = issue_email_participants.issue_id AND issue_email_participants.id IN (
    SELECT issue_email_participants.id
    FROM issue_email_participants
    WHERE issue_email_participants.id BETWEEN $1 AND $2 AND issue_email_participants.id >= $3 AND issue_email_participants.id < $4 AND issue_email_participants.namespace_id IS NULL
    )
    53 448.7 ms 61.0 ms 8.5 ms 3302
    UPDATE issue_email_participants
    SET namespace_id = issues.namespace_id
    FROM issues
    WHERE issues.id = issue_email_participants.issue_id AND issue_email_participants.id IN (
    SELECT issue_email_participants.id
    FROM issue_email_participants
    WHERE issue_email_participants.id BETWEEN $1 AND $2 AND issue_email_participants.id >= $3 AND issue_email_participants.namespace_id IS NULL
    )
    53 7.2 ms 1.1 ms 0.1 ms 53
    UPDATE batched_background_migration_jobs
    SET updated_at = $1, finished_at = $2, status = $3, metrics = $4
    WHERE batched_background_migration_jobs.id = $5
    106 14.4 ms 0.9 ms 0.1 ms 106
    INSERT INTO batched_background_migration_job_transition_logs (batched_background_migration_job_id, created_at, updated_at, previous_status, next_status) VALUES ($1, $2, $3, $4, $5) RETURNING id
    521 93.4 ms 0.7 ms 0.2 ms 468
    SELECT issue_email_participants.id
    FROM issue_email_participants
    WHERE issue_email_participants.id BETWEEN $1 AND $2 AND issue_email_participants.id >= $3
    ORDER BY issue_email_participants.id ASC
    LIMIT $4
    OFFSET $5
    53 6.5 ms 0.4 ms 0.1 ms 53
    UPDATE batched_background_migration_jobs
    SET updated_at = $1, started_at = $2, status = $3, attempts = $4
    WHERE batched_background_migration_jobs.id = $5
    106 4.3 ms 0.2 ms 0.0 ms 106
    SELECT batched_background_migration_jobs.*
    FROM batched_background_migration_jobs
    WHERE batched_background_migration_jobs.id = $1
    LIMIT $2
    53 2.3 ms 0.1 ms 0.0 ms 53
    SELECT sum(batched_background_migration_jobs.batch_size)
    FROM batched_background_migration_jobs
    WHERE batched_background_migration_jobs.batched_background_migration_id = $1 AND batched_background_migration_jobs.status IN ($2)
    53 1.8 ms 0.1 ms 0.0 ms 53
    SELECT issue_email_participants.id
    FROM issue_email_participants
    WHERE issue_email_participants.id BETWEEN $1 AND $2
    ORDER BY issue_email_participants.id ASC
    LIMIT $3
    Histogram of batch runtimes for BackfillIssueEmailParticipantsNamespaceId
    Batch Runtime Count
    0 seconds - 10 seconds 53
    10 seconds - 1 minute 0
    1 minute - 2 minutes 0
    2 minutes - 3 minutes 0
    3 minutes - 5 minutes 0
    5 minutes + 0
    Histogram across all sampled batches of BackfillIssueEmailParticipantsNamespaceId
    Query Runtime Count
    0 seconds - 0.1 seconds 11
    0.1 seconds - 0.5 seconds 1455
    0.5 seconds - 1 second 0
    1 second - 2 seconds 0
    2 seconds - 5 seconds 0
    5 seconds + 0
    #### Other information
    Other migrations pending on GitLab.com
    Migration Type Total runtime Result DB size change
    20241029130136 - AddWithHighestRolePlannerToUsersStatistics Regular 6.0 s :white_check_mark: +0.00 B
    20241126151227 - AddProjectIdToCiBuildPendingStates Regular 4.8 s :white_check_mark: +0.00 B
    20241203074400 - AddNamespaceIdToIssueMetrics Regular 4.7 s :white_check_mark: +0.00 B
    20241112163029 - QueueDeleteOrphanedGroups Post deploy 5.9 s :white_check_mark: +0.00 B
    20241126151232 - IndexCiBuildsPendingStatesOnProjectId Post deploy 5.8 s :white_check_mark: +8.00 KiB [note]
    20241126151234 - QueueBackfillCiBuildPendingStatesProjectId Post deploy 4.6 s :white_check_mark: +0.00 B
    20241203074401 - IndexIssueMetricsOnNamespaceId Post deploy 48.9 s :white_check_mark: +479.02 MiB
    20241203074402 - AddIssueMetricsNamespaceIdFk Post deploy 5.9 s :white_check_mark: +0.00 B
    20241203074403 - AddIssueMetricsNamespaceIdTrigger Post deploy 5.0 s :white_check_mark: +0.00 B
    20241203074404 - QueueBackfillIssueMetricsNamespaceId Post deploy 5.4 s :white_check_mark: +0.00 B
    20241203075015 - IndexIssueCustomerRelationsContactsOnNamespaceId Post deploy 5.5 s :white_check_mark: +48.00 KiB
    20241203075016 - AddIssueCustomerRelationsContactsNamespaceIdFk Post deploy 5.7 s :white_check_mark: +0.00 B
    20241203075017 - AddIssueCustomerRelationsContactsNamespaceIdTrigger Post deploy 5.0 s :white_check_mark: +0.00 B
    20241203075018 - QueueBackfillIssueCustomerRelationsContactsNamespaceId Post deploy 5.4 s :white_check_mark: +0.00 B
    20241203075617 - IndexIssueEmailParticipantsOnNamespaceId Post deploy 6.3 s :white_check_mark: +15.52 MiB
    20241203075618 - AddIssueEmailParticipantsNamespaceIdFk Post deploy 5.8 s :white_check_mark: +0.00 B
    20241203075619 - AddIssueEmailParticipantsNamespaceIdTrigger Post deploy 4.9 s :white_check_mark: +0.00 B
    20241203075620 - QueueBackfillIssueEmailParticipantsNamespaceId Post deploy 5.4 s :white_check_mark: +0.00 B
    20241203144834 - IndexSentryIssuesOnNamespaceId Post deploy 5.6 s :white_check_mark: +80.00 KiB
    20241203144835 - AddSentryIssuesNamespaceIdFk Post deploy 5.6 s :white_check_mark: +8.00 KiB [note]
    20241203144836 - AddSentryIssuesNamespaceIdTrigger Post deploy 4.9 s :white_check_mark: +0.00 B
    20241203144837 - QueueBackfillSentryIssuesNamespaceId Post deploy 5.5 s :white_check_mark: +0.00 B
    Clone details
    Clone ID Clone Created At Clone Data Timestamp Expected Removal Time
    database-testing-3953283-16319419-main 2024-12-05T01:16:37Z 2024-12-04T05:31:22Z 2024-12-05 14:03:41 +0000
    database-testing-3953283-16319419-ci 2024-12-05T01:16:37Z 2024-12-05T00:45:42Z 2024-12-05 14:03:41 +0000

    Job artifacts

    Database migrations (on the ci database)

    Migrations included in this change have been executed on gitlab.com data for testing purposes. For details, please see the migration testing pipeline (limited access).

    Migration Type Total runtime Result DB size change
    20241204133318 - IndexProjectCiCdSettingsForPipelineRemoval Post deploy 9.7 s :white_check_mark: +0.00 B
    Runtime Histogram for all migrations
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 0
    0.1 seconds - 1 second 4
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20241204133318 - IndexProjectCiCdSettingsForPipelineRemoval

    * Type: Post deploy
    * Duration: 9.7 s
    * Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    1 2.9 ms 2.9 ms 2.9 ms 0
    CREATE INDEX CONCURRENTLY "index_project_ci_cd_settings_on_project_id_partial" ON "project_ci_cd_settings" ("project_id")
    WHERE delete_pipelines_in_seconds IS NOT NULL
    1 2.1 ms 2.1 ms 2.1 ms 0
    DROP INDEX CONCURRENTLY "index_project_ci_cd_settings_on_id_partial"
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for IndexProjectCiCdSettingsForPipelineRemoval
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 0
    0.1 seconds - 1 second 4
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Background Migration: BackfillCiBuildPendingStatesProjectId

    Sampled 4 batches. Estimated Time to complete: 44 minutes
    • Interval: 120s
    • Max batch size: 0
    • Estimated seconds to complete: 2640s
    • Average batch time: 45.92s
    • Batch size: 25000
    • N. of batches sampled: 4
    • N. of failed batches: 0

    Time estimation is conservative and based on sampling production data in a test environment. It represents the max time that migration could take. The actual time may differ from this estimation.

    Consider changing max_batch_size and interval if this estimate is unacceptable.

    Calls Total Time Max Time Mean Time Rows Query
    498 12783.8 ms 158.8 ms 25.7 ms 74700
    UPDATE ci_build_pending_states
    SET project_id = p_ci_builds.project_id
    FROM p_ci_builds
    WHERE p_ci_builds.id = ci_build_pending_states.build_id AND p_ci_builds.partition_id = ci_build_pending_states.partition_id AND ci_build_pending_states.id IN (
    SELECT ci_build_pending_states.id
    FROM ci_build_pending_states
    WHERE ci_build_pending_states.id BETWEEN $1 AND $2 AND ci_build_pending_states.id >= $3 AND ci_build_pending_states.id < $4 AND ci_build_pending_states.project_id IS NULL
    )
    4 39.1 ms 16.9 ms 9.8 ms 300
    UPDATE ci_build_pending_states
    SET project_id = p_ci_builds.project_id
    FROM p_ci_builds
    WHERE p_ci_builds.id = ci_build_pending_states.build_id AND p_ci_builds.partition_id = ci_build_pending_states.partition_id AND ci_build_pending_states.id IN (
    SELECT ci_build_pending_states.id
    FROM ci_build_pending_states
    WHERE ci_build_pending_states.id BETWEEN $1 AND $2 AND ci_build_pending_states.id >= $3 AND ci_build_pending_states.project_id IS NULL
    )
    4 2.8 ms 2.4 ms 0.7 ms 4
    UPDATE batched_background_migration_jobs
    SET updated_at = $1, finished_at = $2, status = $3, metrics = $4
    WHERE batched_background_migration_jobs.id = $5
    8 3.2 ms 2.2 ms 0.4 ms 8
    INSERT INTO batched_background_migration_job_transition_logs (batched_background_migration_job_id, created_at, updated_at, previous_status, next_status) VALUES ($1, $2, $3, $4, $5) RETURNING id
    4 2.3 ms 2.0 ms 0.6 ms 4
    UPDATE batched_background_migration_jobs
    SET updated_at = $1, started_at = $2, status = $3, attempts = $4
    WHERE batched_background_migration_jobs.id = $5
    502 264.2 ms 1.2 ms 0.5 ms 498
    SELECT ci_build_pending_states.id
    FROM ci_build_pending_states
    WHERE ci_build_pending_states.id BETWEEN $1 AND $2 AND ci_build_pending_states.id >= $3
    ORDER BY ci_build_pending_states.id ASC
    LIMIT $4
    OFFSET $5
    8 0.3 ms 0.1 ms 0.0 ms 8
    SELECT batched_background_migration_jobs.*
    FROM batched_background_migration_jobs
    WHERE batched_background_migration_jobs.id = $1
    LIMIT $2
    4 0.1 ms 0.0 ms 0.0 ms 4
    SELECT sum(batched_background_migration_jobs.batch_size)
    FROM batched_background_migration_jobs
    WHERE batched_background_migration_jobs.batched_background_migration_id = $1 AND batched_background_migration_jobs.status IN ($2)
    4 0.1 ms 0.0 ms 0.0 ms 4
    SELECT ci_build_pending_states.id
    FROM ci_build_pending_states
    WHERE ci_build_pending_states.id BETWEEN $1 AND $2
    ORDER BY ci_build_pending_states.id ASC
    LIMIT $3
    Histogram of batch runtimes for BackfillCiBuildPendingStatesProjectId
    Batch Runtime Count
    0 seconds - 10 seconds 1
    10 seconds - 1 minute 2
    1 minute - 2 minutes 1
    2 minutes - 3 minutes 0
    3 minutes - 5 minutes 0
    5 minutes + 0
    Histogram across all sampled batches of BackfillCiBuildPendingStatesProjectId
    Query Runtime Count
    0 seconds - 0.1 seconds 0
    0.1 seconds - 0.5 seconds 1036
    0.5 seconds - 1 second 0
    1 second - 2 seconds 0
    2 seconds - 5 seconds 0
    5 seconds + 0
    #### Other information
    Other migrations pending on GitLab.com
    Migration Type Total runtime Result DB size change
    20241112163029 - QueueDeleteOrphanedGroups Post deploy 8.0 s :white_check_mark: +0.00 B
    20241126151232 - IndexCiBuildsPendingStatesOnProjectId Post deploy 9.4 s :white_check_mark: +3.69 MiB
    20241126151234 - QueueBackfillCiBuildPendingStatesProjectId Post deploy 8.6 s :white_check_mark: +0.00 B
    20241203074401 - IndexIssueMetricsOnNamespaceId Post deploy 8.3 s :white_check_mark: +8.00 KiB [note]
    20241203074402 - AddIssueMetricsNamespaceIdFk Post deploy 8.4 s :white_check_mark: +0.00 B
    20241203074403 - AddIssueMetricsNamespaceIdTrigger Post deploy 7.6 s :white_check_mark: +0.00 B
    20241203074404 - QueueBackfillIssueMetricsNamespaceId Post deploy 7.4 s :white_check_mark: +0.00 B
    20241203075015 - IndexIssueCustomerRelationsContactsOnNamespaceId Post deploy 8.3 s :white_check_mark: +8.00 KiB [note]
    20241203075016 - AddIssueCustomerRelationsContactsNamespaceIdFk Post deploy 8.4 s :white_check_mark: +0.00 B
    20241203075017 - AddIssueCustomerRelationsContactsNamespaceIdTrigger Post deploy 7.7 s :white_check_mark: +0.00 B
    20241203075018 - QueueBackfillIssueCustomerRelationsContactsNamespaceId Post deploy 7.3 s :white_check_mark: +0.00 B
    20241203075617 - IndexIssueEmailParticipantsOnNamespaceId Post deploy 8.0 s :white_check_mark: +8.00 KiB [note]
    20241203075618 - AddIssueEmailParticipantsNamespaceIdFk Post deploy 8.4 s :white_check_mark: +0.00 B
    20241203075619 - AddIssueEmailParticipantsNamespaceIdTrigger Post deploy 7.7 s :white_check_mark: +0.00 B
    20241203075620 - QueueBackfillIssueEmailParticipantsNamespaceId Post deploy 7.3 s :white_check_mark: +0.00 B
    20241203144834 - IndexSentryIssuesOnNamespaceId Post deploy 8.4 s :white_check_mark: +8.00 KiB [note]
    20241203144835 - AddSentryIssuesNamespaceIdFk Post deploy 8.4 s :white_check_mark: +8.00 KiB [note]
    20241203144836 - AddSentryIssuesNamespaceIdTrigger Post deploy 7.7 s :white_check_mark: +0.00 B
    20241203144837 - QueueBackfillSentryIssuesNamespaceId Post deploy 7.3 s :white_check_mark: +0.00 B
    Clone details
    Clone ID Clone Created At Clone Data Timestamp Expected Removal Time
    database-testing-3953283-16319419-main 2024-12-05T01:16:37Z 2024-12-04T05:31:22Z 2024-12-05 14:03:41 +0000
    database-testing-3953283-16319419-ci 2024-12-05T01:16:37Z 2024-12-05T00:45:42Z 2024-12-05 14:03:41 +0000

    Job artifacts


    Brought to you by gitlab-org/database-team/gitlab-com-database-testing. Epic

    Edited by ****
  • Leonardo da Rosa
  • Leonardo da Rosa
  • Leonardo da Rosa
  • @mbobin, I think we're in a good spot now. As first iteration, I think we're good :thumbsup:

  • Leonardo da Rosa approved this merge request

    approved this merge request

  • added databaseapproved label and removed databasereviewed label

  • drew stachon
  • drew stachon
  • drew stachon
  • drew stachon
  • Okay @mbobin, this looks pretty good. One more thing about starting and stopping, but we should be good after that!

  • Marius Bobin requested review from @drew

    requested review from @drew

  • mentioned in issue #508185 (closed)

  • drew stachon resolved all threads

    resolved all threads

  • drew stachon approved this merge request

    approved this merge request

  • drew stachon enabled automatic add to merge train when checks pass

    enabled automatic add to merge train when checks pass

  • drew stachon
  • drew stachon resolved all threads

    resolved all threads

  • drew stachon
  • drew stachon resolved all threads

    resolved all threads

  • merged

  • Hello @mbobin :wave:

    The database team is looking for ways to improve the database review process and we would love your help!

    If you'd be open to someone on the database team reaching out to you for a chat, or if you'd like to leave some feedback asynchronously, just post a reply to this comment mentioning:

    @gitlab-org/database-team

    And someone will be by shortly!

    Thanks for your help! :heart:

    This message was generated automatically. Improve it or delete it.

  • drew stachon mentioned in commit 02eba320

    mentioned in commit 02eba320

  • added workflowstaging label and removed workflowcanary label

  • Marius Bobin mentioned in merge request !174963 (merged)

    mentioned in merge request !174963 (merged)

  • added UX label

  • Thong Kuah mentioned in merge request !175531 (merged)

    mentioned in merge request !175531 (merged)

  • Please register or sign in to reply
    Loading