Replication conflicts
This section provides detailed information about the mechanisms and possible scenarios behind replication conflicts.
Updates to entries on PingDirectory servers in a replication topology can happen independently because replication guarantees only eventual consistency, not strong consistency. The eventual consistency model enables conflicting changes to be applied to different PingDirectory server instances. In most cases, the PingDirectory server can resolve these conflicts automatically and consistently. However, some scenarios require manual administrative action. For any of these unresolved conflicts, the administrator receives notification through administrative alerts.
At a high level, the conflict resolution algorithm tries to resolve conflicts as though the operations occurred on a single PingDirectory server instance. For example, if the same entry is added to two different PingDirectory server instances at about the same time, after these operations are replicated, both servers keep only the first entry added.
The following image highlights the differences between standalone and replicated environments.
- Processing steps
-
-
The client sends an LDAP
modifyrequest to the PingDirectory server and succeeds. -
The client sends another LDAP
modifyrequest that conflicts with the first. -
In the standalone case, the server rejects the request. In the replicated case, the request succeeds.
-
Replication propagates the updates (replicated only).
-
Conflict resolution (replicated only): Server A ignores the update from server B, and server B sets the attribute value to the value on server A.
-
Types of replication conflicts
There are two types of replication conflicts:
- Naming conflicts
-
Naming conflicts include operations that cause conflicts with the naming of the distinguished name (DN) of the existing or new entries.
- Modification conflicts
-
Modification conflicts include operations that result in conflicts in the modification of attributes.
Naming conflict scenarios
The following illustration depicts the naming conflict scenario.
- Processing steps
-
-
The client sends an update (
add,delete, ormoddn) request to server A. -
The client sends an update (
add,delete, ormoddn) request conflicting with the first request to server B. -
Replication propagates the updates.
-
Conflict resolution takes place.
-
The following table shows the result of a naming conflict, depending on the type of updates that occur. The code doesn’t compare change sequence numbers (CSNs) but applies operations in the order they were received. This might lead to inconsistent replays.
For all of the naming conflict scenarios, assume the following:
-
Update 1 was applied at PingDirectory server 1.
-
Update 2 was applied at PingDirectory server 2.
-
Update 1 occurred shortly before Update 2 so that PingDirectory server 2 received Update 1 after Update 2 was applied.
-
The
APPLY_REPAIR_READDED_ENTRYproperty is enabled. Learn more in Replication repair behavior.
| Update 1 | Update 2 | Automatic resolution | Result of conflict resolution at server 2 when Update 1 received |
|---|---|---|---|
|
|
Yes |
If the entry was deleted with the Replication Repair control and re-added, the |
|
|
Yes |
New entry is located based on the entryUUID and |
|
|
Yes |
If the entry was deleted with the Replication Repair control and re-added, the |
|
|
Yes |
|
|
|
Yes |
Entry B is renamed and Entry A is deleted. |
|
|
Yes |
|
|
|
No |
The entry targeted in the |
|
|
Yes |
The entry is moved under the new DN of the parent. |
|
|
No |
A and C will be conflict entries. |
|
|
Yes |
The entry is added under the new DN of the parent. |
|
|
No |
The added entry is marked as a conflict entry. |
|
|
Yes |
The entryUUID of the incoming |
|
|
No |
The existing entry is marked as a conflicting entry and the incoming |
Replication repair behavior
When you use the Replication Repair control to fix a naming conflict, you might need to delete an entry on one replica and then add it back to that same replica. This creates a situation where the entry exists on the repaired replica with a different UUID than on other replicas.
When the repaired replica receives a replicated modify or delete operation, and there’s a UUID mismatch for the target DN, the server checks whether the original UUID still exists within the replication topology:
-
If the UUID isn’t present, the replica accepts the operation and applies it to the re-added entry.
-
If the UUID is present, the replica discards the operation. The renamed entry can receive the operation through a UUID redirect.
This behavior is controlled by the APPLY_REPAIR_READDED_ENTRY system property, which is enabled by default. To disable this behavior and cause the replica to reject operations with a UUID mismatch, do the following:
-
In the server’s
config/java.propertiesfile, add the following line to thestart-server.java-argssection:-Dcom.unboundid.directory.server.replication.plugin.ReplicationDomain.APPLY_REPAIR_READDED_ENTRY=false
For example:
start-server.java-args=-server -Xmx768m -Xms768m ... \ -Dcom.unboundid.directory.server.replication.plugin.ReplicationDomain.APPLY_REPAIR_READDED_ENTRY=false
-
Save the file.
-
Apply your changes by running
bin/dsjavaproperties. -
Restart the server.
Modification conflict scenarios
Modification conflicts resolve automatically, and no manual action is required. The ldapmodify operation allows the following modification types:
-
Add of one or more values
-
Delete of one or more values, or the entire attribute
-
Replace all values
|
Replication doesn’t currently support the increment LDAP modification type. |
The following illustration presents a modification conflict scenario.
- Processing steps
-
-
LDAP client A sends a
modifyrequest to server A. -
LDAP client B sends a conflicting
modifyrequest to server B. -
Server A applies the modification.
-
Server B applies the modification.
-
The LDAP clients receive successful responses.
-
Replication propagates the updates.
-
Conflict resolution on server A updates the entry to reflect the value on server B.
Conflict resolution on server B ignores the update received from server A.
-
The following table shows the result of a modification conflict, depending on the type of updates that occur. For all of the operations in the table, assume the following:
-
LDAP Modify 1 was applied at PingDirectory server 1.
-
LDAP Modify 2 was applied at PingDirectory server 2.
-
LDAP Modify 1 occurred shortly before LDAP Modify 2, so that PingDirectory server 2 received LDAP Modify 1 after LDAP Modify 2 was applied.
| Modify 1 | Modify 2 | Result of conflict resolution at server 2 when Modify 1 received |
|---|---|---|
|
|
Incoming |
|
Replacement of the value of the same attribute |
Incoming |
Replacement of a single-valued attribute |
|
Incoming Replacement is ignored. |
|
|
Incoming |
|
|
Incoming |
|
|
Incoming |
|
|
Incoming |
|
|
|
|
|
|
|
Replace all values of the same multivalued attribute |
Incoming |
|
|
Only value Y is added. |
|
|
Incoming |