Skip to content

Backfill web_hook_logs_daily

Max Orefice requested to merge morefice/backfill-web-hook-logs-daily into master

Ref: #507318

What does this MR do and why?

This MR backfills our new web_hook_logs_daily partitioned table.

It uses the new cursor batched background migration as we are dealing with a composite PK from an existing partitioned table.

This migration will only be executed for self-managed as we already have the necessary data since adding the trigger in #507316 (closed).

Testing

Run the migration, verify it was enqueued successfully and revert it to make sure everything is back to normal.

  1. bin/rails db:migrate:up:main VERSION=20250109154733
  2. gdk psql -c "select * from batched_background_migrations order by id desc limit 1;" -d "gitlabhq_development"
  3. bin/rails db:migrate:down:main VERSION=20250109154733
  4. gdk psql -c "select * from batched_background_migrations order by id desc limit 1;" -d "gitlabhq_development"

https://docs.gitlab.com/ee/development/database/partitioning/date_range.html#step-2-backfill-the-partitioned-copy-release-n

Edited by Max Orefice

Merge request reports

Loading