Skip to content

Skip replication processing when no replication domain is configured#681

Open
vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:features/modify-1
Open

Skip replication processing when no replication domain is configured#681
vharseko wants to merge 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:features/modify-1

Conversation

@vharseko

@vharseko vharseko commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Found while profiling the MODIFY hot path with the series methodology
(#660, #667#670, #672, #674, #678#680). The Multimaster Synchronization
provider is enabled by default even on standalone servers with no
replication domain configured (config.ldif: cn=Multimaster Synchronization has ds-cfg-enabled: true with an empty cn=domains),
and its three per-operation hooks — conflict resolution, pre-operation and
post-operation — each call findDomain(), which:

  • iterates the request controls looking for the repair control, and
  • walks the entry DN up to the suffix, querying an empty domains
    map at every level via BackendConfigManager.getParentDNInSuffix,
  • then allocates a fresh SynchronizationProviderResult.ContinueProcessing.

That is three DN walks and three result allocations per write operation
that can never find anything on a non-replicated deployment.

Change

  • findDomain() returns null before the DN walk when no domains are
    registered. The repair-control processing above the walk is preserved
    (its side effects — flagging the operation and removing the control —
    stay identical).
  • The stateless ContinueProcessing result is allocated once and shared
    (11 allocation sites in the class); the replicated code paths are
    unchanged.

Honest performance note

An interleaved A/B (old→new→new→old→old→new, modrate, 200 persistent
connections replacing description on random users, same harness as the
rest of the series) shows no measurable throughput difference — the
pairs land at −13%/+4.6%/−4.3%, within the noise of the shared 8-core
host. Profiling shows the concurrent write path is dominated by the JE
write-ahead-log serialization (LogManager.serialLog: ~50 s of monitor
blocking per 80 s window), which dwarfs the work removed here. This PR is
therefore a cleanliness fix — removing pointless per-write work from
every non-replicated deployment — not a claimed performance win.

Testing

mvn -P precommit -pl opendj-server-legacy verify (with the slow group
enabled to include the replication suites): ModifyOperationTestCase
(933), AddOperationTestCase (138), DeleteOperationTestCase (195),
TestModifyDNOperation (69), DependencyTest (3), GenerationIdTest
(4) — all pass; UpdateOperationTest shows only its two pre-existing
failures (modifyConflicts, namingConflicts), which fail identically on
unmodified master (see the slow-suite audit; candidate for a separate
issue). 1,350 tests total, 2 pre-existing failures, 0 new.

Files

  • opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/MultimasterReplication.java

The Multimaster Synchronization provider is enabled by default even on
standalone servers with no replication domain configured, and its three
per-operation hooks (conflict resolution, pre-operation, post-operation)
each called findDomain(), which iterated the request controls and walked
the entry DN up to the suffix querying an empty domains map, allocating
a fresh result object every time.

Return null from findDomain() before the DN walk when no domains are
registered (repair-control processing is preserved), and reuse a shared
stateless ContinueProcessing result instead of allocating one per hook
invocation.

An interleaved A/B under concurrent modify load shows no measurable
throughput change on an 8-core host — the write path is dominated by
the JE write-ahead log — so this is a cleanliness fix: it removes
pointless per-write work from every non-replicated deployment rather
than a measured win.
@vharseko vharseko added performance Performance / concurrency / lock-contention work replication labels Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement performance Performance / concurrency / lock-contention work replication

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants