Skip to content

Adding hexdigest caching strategy

Max Fan requested to merge 424954_idempotent_workers_graphql into master

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

  1. ProjectEntities are the easiest to test with, create a group with many projects
  2. 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
+
  1. You'll see multiple entries in bulk_import_entities database table
  2. Turn the FF on
  3. 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.

Edited by Max Fan

Merge request reports

Loading