Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
283694cf
Commit
283694cf
authored
Oct 20, 2020
by
Can Eldem
Committed by
Mike Jang
Oct 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add estimated time for background migrations
parent
7e2ff88b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
doc/development/background_migrations.md
doc/development/background_migrations.md
+23
-1
No files found.
doc/development/background_migrations.md
View file @
283694cf
...
@@ -343,10 +343,32 @@ for more details.
...
@@ -343,10 +343,32 @@ for more details.
1.
Make sure that tests you write are not false positives.
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
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.
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
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
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).
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
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,
more pressure on DB than you expect (measure on staging,
or ask someone to measure on production).
or ask someone to measure on production).
1.
Make sure to know how much time it'll take to run all scheduled migrations.
1.
Provide an estimation section in the description, explaining timings from the
linked query plans and batches as described in the migration.
For example, assuming a migration that deletes data, include information similar to
the following section:
```
ruby
Background
Migration
Details
:
47600
items
to
delete
batch
size
=
1000
47600
/
1000
=
48
loops
Estimated
times
per
batch:
-
900
ms
for
select
statement
with
1000
items
-
2100
ms
for
delete
statement
with
1000
items
Total
:
~
3
sec
per
batch
2
mins
delay
per
loop
(
safe
for
the
given
total
time
per
batch
)
48
*
(
120
+
3
)
=
~
98.4
mins
to
run
all
the
scheduled
jobs
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment