BulkImports: Add fields to track concurrent work
What does this MR do?
Add a way to track the status of each BulkImport's pipeline
individually. The end goal is to enable BulkImports to run in smaller
and more concurrent jobs. The pipeline status/progress will be tracked
on the bulk_import_trackers
table, using BulkImports::Tracker
model.
More information on:
Follow up:
- !56242 (merged) - Usage of the new fields to track the pipeline work status
-
!55928 (merged) - Remove duplication on
#after_run
methods - #323384 (closed) - Run each pipeline on its own background job
Database migrations
VERSION=20210303193544
== 20210303193544 AddConcurrentFieldsToBulkImportsTrackers: migrating =========
-- add_column(:bulk_import_trackers, :jid, :text)
-> 0.0029s
-- add_column(:bulk_import_trackers, :stage, :smallint, {:default=>0, :null=>false})
-> 0.0018s
-- add_column(:bulk_import_trackers, :status, :smallint, {:default=>0, :null=>false})
-> 0.0012s
== 20210303193544 AddConcurrentFieldsToBulkImportsTrackers: migrated (0.0061s)
== 20210303193544 AddConcurrentFieldsToBulkImportsTrackers: reverting =========
-- remove_column(:bulk_import_trackers, :jid, :text)
-> 0.0027s
-- remove_column(:bulk_import_trackers, :stage, :smallint)
-> 0.0013s
-- remove_column(:bulk_import_trackers, :status, :smallint)
-> 0.0009s
== 20210303193544 AddConcurrentFieldsToBulkImportsTrackers: reverted (0.0050s)
VERSION= 20210303193605
== 20210303193605 AddTextLimitsToBulkImportsTrackersJidAndPipelineName: migrating
-- transaction_open?()
-> 0.0000s
-- current_schema()
-> 0.0002s
-- execute("ALTER TABLE bulk_import_trackers\nADD CONSTRAINT check_603f91cb06\nCHECK ( char_length(jid) <= 255 )\nNOT VALID;\n")
-> 0.0023s
-- current_schema()
-> 0.0003s
-- execute("SET statement_timeout TO 0")
-> 0.0008s
-- execute("ALTER TABLE bulk_import_trackers VALIDATE CONSTRAINT check_603f91cb06;")
-> 0.0015s
-- execute("RESET ALL")
-> 0.0009s
== 20210303193605 AddTextLimitsToBulkImportsTrackersJidAndPipelineName: migrated (0.0171s)
== 20210303193605 AddTextLimitsToBulkImportsTrackersJidAndPipelineName: reverting
-- execute("ALTER TABLE bulk_import_trackers\nDROP CONSTRAINT IF EXISTS check_603f91cb06\n")
-> 0.0008s
== 20210303193605 AddTextLimitsToBulkImportsTrackersJidAndPipelineName: reverted (0.0061s)
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because _____.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Kassio Borges