Fusion 5.x Index Pipeline Retries Require Explicit Idempotency Keys for Deduplication
0 reputation · 24 Jan 2024, 16:36 UTC
0 reputation · 24 Jan 2024, 16:36 UTC
Fusion 5.x index pipelines support configurable retry policies on stages such as the Solr Indexer, with exponential backoff and maximum attempt settings. When a stage fails transiently, Fusion retries the operation per its policy. Without idempotency controls, a retry can re-send the same document, causing duplicate indexed copies in Solr.
The documented mitigation relies on a stable document id field so that Solr's upsert semantics (add with overwrite=true) prevent duplication on retry. The idempotencyKey concept is not a first-class pipeline-wide setting in 5.x; it is typically implemented via the stable id or a custom JavaScript stage. If a pipeline stage mutates document content non-deterministically (for example, timestamp enrichment or random UUID generation), retries with the same ID will overwrite with different content rather than deduplicate.
An unresolved design question in Fusion 5.x is whether the platform should automatically generate and track idempotency keys for pipeline executions (for example, a per-document hash) or continue requiring explicit user configuration, leaving duplicate risk to implementation choice. This boundary affects upgrade paths from Fusion 4.x, where default retry configurations differed, and extends to non-Solr index targets that may not provide upsert semantics by default.
Should Fusion 5.x introduce automatic per-document idempotency key generation as a pipeline-level option? How would automatic keys interact with non-deterministic enrichment stages? What compatibility guarantees are needed for custom index targets that lack native upsert behavior?
31275 reputation · 24 Jan 2024, 23:22 UTC
Yes – Fusion 5.x should offer an optional pipeline‑level setting that automatically generates a per‑document idempotency key, but only if the key is derived from immutable data before any non‑deterministic enrichment stages run.
idempotencyKey property; deduplication today relies on a stable document id field that Solr treats as an upsert when overwrite=true.id, a retry will re‑index the altered document, causing the new content to overwrite the previous version rather than being filtered out.An automatic idempotency key would need to be computed from fields that are guaranteed not to change during processing (e.g., source‑system primary key, immutable metadata). By generating the key before any enrichment stage, Fusion can attach it as metadata or as the document identifier, allowing the target store to recognize retries and skip duplicate writes.
sourceId, eventTimestamp if it never changes)._idempotencyKey._idempotencyKey as the document id (or add it as a regular field and keep overwrite=true)._idempotencyKey as a header or metadata field and implement duplicate detection on the target side (e.g., a cache of seen keys or a conditional write).Does the pipeline contain any non‑deterministic enrichment stages that execute after the document id is set? If yes, the idempotency key must be generated prior to those stages; if no, relying on the existing stable id may be sufficient.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.