Resolve "Handle Duplication of Resources on Migration"
What does this MR do and why?
This MR handles pipeline duplication and race condition issues associated with BulkImport, see this note for more information
Specifically multiple EntityWorkers were being scheduled and ran for the same resource, which resulted in duplicate resources or unnecessary failures during migration
Screenshots or screen recordings
After running a migration on a project with issues, you should now have no failures with the IssuesPipeline
[4] pry(main)> BulkImports::Failure.where(pipeline_class: 'BulkImports::Common::Pipelines::IssuesPipeline')
BulkImports::Failure Load (0.4ms) SELECT "bulk_import_failures".* FROM "bulk_import_failures" WHERE "bulk_import_failures"."pipeline_class" = 'BulkImports::Common::Pipelines::IssuesPipeline' /*application:console,db_config_name:main,line:bin/rails:4:in `<main>'*/
=> []
How to set up and validate locally
Feature.enable(:bulk_import)
Feature.enable(:bulk_import_projects)
- Migrate a project with multiple issues
- In the rails console
BulkImports::Failure.where(pipeline_class: 'BulkImports::Common::Pipelines::IssuesPipeline')
should return zero results
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #346398 (closed)
Edited by Allen Cook