Adding hexdigest caching strategy
What does this MR do and why?
This is part 2 in making bulk import workers idempotent. This MR will focus on graphQL cases and some pipelines with special logic
To see which pipelines are touched and which are not, refer to: #424954 (comment 1597814801)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- ProjectEntities are the easiest to test with, create a group with many projects
- Ensure FF is disabled
Feature
.disable(:bulk_import_idempotent_workers)
diff --git a/lib/bulk_imports/pipeline/runner.rb b/lib/bulk_imports/pipeline/runner.rb
index e6005478bd90..30976a6f9dab 100644
--- a/lib/bulk_imports/pipeline/runner.rb
+++ b/lib/bulk_imports/pipeline/runner.rb
@@ -19,6 +19,10 @@ def run
raw_entry = entry.dup
next if Feature.enabled?(:bulk_import_idempotent_workers) && already_processed?(raw_entry, index)
+ if index == 1 && context.tracker.relation == "BulkImports::Groups::Pipelines::ProjectEntitiesPipeline"
+ raise BulkImports::RetryPipelineError.new("oh no", 1.second)
+ end
+
- You'll see multiple entries in
bulk_import_entities
database table - Turn the FF on
- Duplicate Project entities should not be created
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.
Edited by Max Fan