Issue
When creating new business rules in Predictive Merchandiser (PM), users may observe that a single rule appears multiple times in the Rules UI, each instance having a unique ID. This duplication can happen even though only one rule was intended to be created.
Diagnosis
To confirm whether your environment is experiencing this issue:
- Create a new business rule in any Fusion application using PM.
- Check the Rules UI after saving the rule.
- If you observe several identical rules with different IDs, this article applies.
Environment
Fusion 5.x and above, using Predictive Merchandiser in a managed or self-managed deployment.
Cause
This issue occurs when the query rewrite collections that store PM rule data are configured with the TLOG replica type. TLOG replicas introduce latency in reflecting updates across replicas. As a result, multiple write operations can inadvertently be processed as separate rule creations, leading to duplicate rules in the Rules UI.
Configuring the query rewrite collections to use Near Real Time (NRT) replicas ensures timely replication and prevents unintended duplicate rule entries.
Resolution
Update the query rewrite collections used by Predictive Merchandiser to use NRT replicas instead of TLOG replicas.
Identify the affected collections
- Typically, these collections follow a naming convention like:
<app-name>_query_rewrite <app-name>_query_rewrite_staging
- Replace
<app-name>with the name of your Fusion application.
Check the current replica type
Run the following Solr API query for each collection to review replica types:
curl -u <username>:<password> "https://<solr-host>/solr/admin/collections?action=CLUSTERSTATUS&collection=<collection-name>"
- Look under the
replicassection for the replica type of each shard. - If the type is
TLOG, a change is required.
Fan out the collection to use NRT replicas
To change a collection from TLOG to NRT:
- Create a new collection with identical configuration to the original, but explicitly set the replica type to NRT:
curl -u <username>:<password> "https://<solr-host>/solr/admin/collections?action=CREATE&name=<new-collection-name>&numShards=<number>&replicationFactor=<number>&tlogReplicas=0&nrtReplicas=<number>"
Replace:
<new-collection-name>with a unique name for the new collection.<number>with appropriate shard and replica counts.
- Reindex the data from the original collection into the new NRT collection.
- Update any application configuration (e.g., PM pipelines, query pipelines) to point to the new collection.
- Remove the original TLOG collection when confident the new collection works correctly.
Validate the fix
- Re-test rule creation in the Rules UI.
- Confirm only one rule is created and displayed.