Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ public class MultimasterReplication

private ReplicationServerListener replicationServerListener;
private static final Map<DN, LDAPReplicationDomain> domains = new ConcurrentHashMap<>(4);
/**
* Shared stateless "continue processing" result: the provider hooks run for
* every operation, so avoid allocating a fresh result each time.
*/
private static final SynchronizationProviderResult CONTINUE =
new SynchronizationProviderResult.ContinueProcessing();
private static final DSRSShutdownSync dsrsShutdownSync = new DSRSShutdownSync();
/** The queue of received update messages, to be treated by the ReplayThread threads. */
private static final BlockingQueue<UpdateToReplay> updateToReplayQueue = new LinkedBlockingQueue<>(10000);
Expand Down Expand Up @@ -167,6 +173,15 @@ public static LDAPReplicationDomain findDomain(DN dn, PluginOperation pluginOp)
}
}

if (domains.isEmpty())
{
// The Multimaster Synchronization provider is enabled by default even
// on standalone servers with no replication domain configured: skip
// the walk to the suffix that every write operation would otherwise
// pay three times (conflict resolution, pre- and post-operation).
return null;
}

LDAPReplicationDomain domain = null;
DN temp = dn;
BackendConfigManager backendConfigManager =
Expand Down Expand Up @@ -406,7 +421,7 @@ public SynchronizationProviderResult handleConflictResolution(
{
return domain.handleConflictResolution(modifyOperation);
}
return new SynchronizationProviderResult.ContinueProcessing();
return CONTINUE;
}

@Override
Expand All @@ -418,7 +433,7 @@ public SynchronizationProviderResult handleConflictResolution(
{
return domain.handleConflictResolution(addOperation);
}
return new SynchronizationProviderResult.ContinueProcessing();
return CONTINUE;
}

@Override
Expand All @@ -430,7 +445,7 @@ public SynchronizationProviderResult handleConflictResolution(
{
return domain.handleConflictResolution(deleteOperation);
}
return new SynchronizationProviderResult.ContinueProcessing();
return CONTINUE;
}

@Override
Expand All @@ -442,7 +457,7 @@ public SynchronizationProviderResult handleConflictResolution(
{
return domain.handleConflictResolution(modifyDNOperation);
}
return new SynchronizationProviderResult.ContinueProcessing();
return CONTINUE;
}

@Override
Expand All @@ -454,7 +469,7 @@ public SynchronizationProviderResult handleConflictResolution(

if (domain == null || !domain.solveConflict())
{
return new SynchronizationProviderResult.ContinueProcessing();
return CONTINUE;
}

EntryHistorical historicalInformation = (EntryHistorical)
Expand All @@ -479,14 +494,14 @@ public SynchronizationProviderResult handleConflictResolution(
ResultCode.SUCCESS, null);
}

return new SynchronizationProviderResult.ContinueProcessing();
return CONTINUE;
}

@Override
public SynchronizationProviderResult doPreOperation(
PreOperationDeleteOperation deleteOperation) throws DirectoryException
{
return new SynchronizationProviderResult.ContinueProcessing();
return CONTINUE;
}

@Override
Expand All @@ -499,7 +514,7 @@ public SynchronizationProviderResult doPreOperation(

if (domain == null || !domain.solveConflict())
{
return new SynchronizationProviderResult.ContinueProcessing();
return CONTINUE;
}

// The historical object is retrieved from the attachment created
Expand All @@ -520,7 +535,7 @@ public SynchronizationProviderResult doPreOperation(
// Add to the operation the historical attribute : "dn:changeNumber:moddn"
historicalInformation.setHistoricalAttrToOperation(modifyDNOperation);

return new SynchronizationProviderResult.ContinueProcessing();
return CONTINUE;
}

@Override
Expand All @@ -532,7 +547,7 @@ public SynchronizationProviderResult doPreOperation(
findDomain(addOperation.getEntryDN(), addOperation);
if (domain == null)
{
return new SynchronizationProviderResult.ContinueProcessing();
return CONTINUE;
}

// For LOCAL op only, generate CSN and attach Context
Expand All @@ -544,7 +559,7 @@ public SynchronizationProviderResult doPreOperation(
// Add to the operation the historical attribute : "dn:changeNumber:add"
EntryHistorical.setHistoricalAttrToOperation(addOperation);

return new SynchronizationProviderResult.ContinueProcessing();
return CONTINUE;
}

@Override
Expand Down
Loading