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
8b9cfddf
Commit
8b9cfddf
authored
Oct 02, 2020
by
Gary Holtz
Committed by
Marcia Ramos
Oct 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarifying some info about sidekiq jobs in background migrations
parent
a9b6a6dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
doc/development/background_migrations.md
doc/development/background_migrations.md
+22
-1
No files found.
doc/development/background_migrations.md
View file @
8b9cfddf
# Background Migrations
---
type
:
reference, dev
stage
:
none
group
:
Development
info
:
"
See
the
Technical
Writers
assigned
to
Development
Guidelines:
https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments-to-development-guidelines"
---
# Background migrations
Background migrations can be used to perform data migrations that would
otherwise take a very long time (hours, days, years, etc) to complete. For
...
...
@@ -92,6 +99,20 @@ bulk_migrate_async(
)
```
Note that this will queue a Sidekiq job immediately: if you have a large number
of records, this may not be what you want. You can use the function
`queue_background_migration_jobs_by_range_at_intervals`
to split the job into
batches:
```
ruby
queue_background_migration_jobs_by_range_at_intervals
(
ClassName
,
BackgroundMigrationClassName
,
2
.
minutes
,
batch_size:
10_000
)
```
You'll also need to make sure that newly created data is either migrated, or
saved in both the old and new version upon creation. For complex and time
consuming migrations it's best to schedule a background job using an
...
...
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