summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2018-07-24 11:37:03 -0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2018-07-24 12:39:52 -0300
commit378610372fae447b9af00ebecfca94a2edc3c4b7 (patch)
treebfd59a8d70ee6b9a11acb463c99ff150b3d3cbae
parentabae261b86d8a1eedb50e85083cad1a07154c4d3 (diff)
downloadgitlab-ce-osw-background-migrations-best-practice-doc.tar.gz
Add points regarding background migrations on huge tablesosw-background-migrations-best-practice-doc
-rw-r--r--doc/development/background_migrations.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/development/background_migrations.md b/doc/development/background_migrations.md
index 46c5baddb9c..16195cbbbdf 100644
--- a/doc/development/background_migrations.md
+++ b/doc/development/background_migrations.md
@@ -296,10 +296,18 @@ for more details.
## Best practices
+1. Make sure to know how much data you're dealing with
1. Make sure that background migration jobs are idempotent.
1. Make sure that tests you write are not false positives.
1. Make sure that if the data being migrated is critical and cannot be lost, the
clean-up migration also checks the final state of the data before completing.
+1. Make sure to know how much time it'll take to run all scheduled migrations
+1. When migrating many columns, make sure it won't generate too many
+ dead tuples in the process (you may need to directly query the number of dead tuples
+ and adjust the scheduling according to this piece of data)
+1. Make sure to discuss the numbers with a database specialist, the migration may add
+ more pressure on DB than you expect (measure on staging,
+ or ask someone to measure on production)
[migrations-readme]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/spec/migrations/README.md
[issue-rspec-hooks]: https://gitlab.com/gitlab-org/gitlab-ce/issues/35351