Skip to content

Restore opt-in values from temporary table

What does this MR do and why?

A while ago, we deleted the email_opted_in field from user table on GitLab Dot Com. This was done by mistake.

We would like to restore the values from a temp_user_details_issue18240 temporary table filled from a Snowflake backup.

Why:

Months ago Marketing made a mistake and asked Growth Eng to delete the email_opted_in field from the Prod GitLab DB not knowing that we (GitLab and Marketing) use it for sending promotional emails.

We noticed to late to restore the data from Backup so had to pull the data from snowflake.

This migration is expected to update 2,902,909 records - https://gitlab.com/gitlab-org/gitlab/-/issues/481320#note_2117897020

Estimated duration based on this equation

interval * number of records / max batch
2 minutes * 2_902_909 / 10_000 ≈ 580.58 minutes or 9 hour 41 minutes 

Query Plans

Update query: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/31709/commands/98252

Batch selection: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/31709/commands/98236

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.

Related to #481320

Edited by Serhii Yarynovskyi

Merge request reports

Loading