mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Valery Kharseko
19 hours ago 400fb2694641b05e53217d3c742a6e49e3a254c6
refs
author Valery Kharseko <vharseko@3a-systems.ru>
Sunday, November 29, 2026 08:16 +0100
committer GitHub <noreply@github.com>
Sunday, November 29, 2026 08:16 +0100
commit400fb2694641b05e53217d3c742a6e49e3a254c6
tree 4b14514086a02138946b1ee5c82d3de8034fbb64 tree | zip | gz
parent 6d9e1fcbf5d7d59a25d22d7369c70c2d65cabb56 view | diff
[#1208] Preserve replication history during scaling, recovery and shutdown (#1282)

During replication recovery, later updates can overtake missing history,
a dependency scan can hand one update to two replay threads, and a
closing session can delay failover handshakes on a live replication
server. This PR preserves ordered history and replay ownership, drains
accepted writes during shutdown without blocking unrelated runtime
handshakes, and exercises scale-in/scale-out under concurrent writes.
Docker fixtures require explicit bootstrap success before resuming
rolled writers, retain failure diagnostics and run OpenDJ without the
former 512 MiB Docker cap. When a DS moves back to an RS after a
restart, it now keeps reading from the previous RS until the stop
exchange completes.

Part of #1208; also exercises the empty-RS certificate and failover path
tracked in #1188.

## Scale scenarios and checks

| Topology | Retained volume | Empty volume |
|---|---|---|
| Four directory servers and three replication servers | `rs534 /
scale-rs-kept` | `rs534 / scale-rs-empty` |
| Four combined directory/replication servers | `combined / scale-kept`
| `combined / scale-empty` |

Each scenario removes one server from `REPLICATION_PEERS`, rolls the
survivors with the shorter list, verifies its removal from their
registries and local RS lists, returns it, and rolls the survivors with
the full list. Separate-server transitions roll two DS and one RS
together, leaving another RS and a writer available. Combined nodes roll
individually. A restarted separate-server group must finish the RS and
both DS bootstraps before either writer resumes or the next group rolls;
a combined node must finish its own bootstrap before resuming. Surviving
writers remain active throughout these waits. Before a combined
checkpoint, request pauses for the departing worker and the other
participating writers together. Their active segments can finish
concurrently while the observing replica continues to accept writes. The
checkpoint waits for all requested pauses, and the departing worker
resumes after successful bootstrap. Missing or failed bootstrap, failed
load workers and workload deadlines still abort the scenario.
Checkpoints precede stops, and writes on a surviving DS are verified
while the group is stopped. A returning combined DS must accept a
dedicated LDAP write before the first scale-out roll can pause its
worker if it has an empty volume or its retained-volume bootstrap
assigned a new replica ID. The probe runs after the current ID is
recorded. Changelog checks include both IDs when a rejoin changes the
replica identity. A checkpoint rereads a reference snapshot that lacks
the new origin and waits for the observing RS to reach that origin's
position.

While the removed server is absent, a dedicated client applies 50,001
distinct modifications. Every surviving RS must contain the complete CSN
interval before the server returns. After scale-out and membership
verification, every DS must complete a newly started load segment before
the workload ends. Checks cover indexed LDAP results, matching offline
LDIF exports, index verification, changelog continuity, RS mesh
connectivity and replication errors. The existing `rs534 / empty-rs` row
also tests failover in both directions after rebuilding an RS while a DS
is offline.

Scale load has a 2700-second ceiling and starts the disturbance at 120
seconds. Targets remain 100 modifications and 20 adds/deletes per second
per DS, with error-free clients and a duration-weighted minimum of 10%
of each target. Fifty-second segments rotate through three indexed
surnames per DS. Other rows retain their 900-second load. The scale job
and scenario step retain 75- and 70-minute limits respectively.
Convergence budgets are 900 seconds for `combined / scale-kept`, 600
seconds for `combined / scale-empty`, and 300 seconds for both
separate-server scale rows. Convergence still requires three complete
zero-lag samples spanning more than the 60-second monitor period plus
five seconds.

Host-side checkpoint and membership queries use a lightweight LDAP
reader through loopback-only admin ports, with explicit deadlines and
complete-result checks. Artifacts retain checkpoints, full backlog
coverage, pre-restart changelogs, offline-state snapshots, bootstrap
timings, prior container logs, CSN traces and post-load convergence
samples. Failed workers abort pending waits; failed snapshots or Docker
commands cannot count as successful progress.

## Replication correctness and bootstrap

- **Replay ownership:** stop each ADD/MODIFY/DELETE/MODDN dependency
scan after the first matching predecessor. `getNextUpdate()` already
waits for all earlier pending changes, so repeated parking is
unnecessary and can race with another replay thread taking ownership.
Parking requires the same pending-change object and current replay
owner; a stale scan after a clear/re-delivery or ownership transfer
cannot hand out the CSN again. This prevents the reproduced
double-handoff path ending in error `9` when the original replay
commits.
- **Offline-only sequence gaps:** complete CSN allocation traces can
distinguish an offline notification from a lost update. Classification
requires an offline allocation and no local-operation allocation for the
same domain, server ID and sequence in any recorded process generation,
including outside the load interval. Every expected generation, end
marker, record count and checksum must validate. Failed copies
invalidate eligibility, and the changelog checker validates the traces
again. `offline.state` snapshots alone remain diagnostic; incomplete
traces and sequences reused by local operations cannot excuse a gap.
- **RS shutdown:** stop connected DS handlers, close admission of direct
DS updates, and cross a read/write barrier that also covers readers
already removed from the connection map by concurrent teardown. A fatal
changelog exception releases the DS admission read lock before starting
synchronous shutdown, so that domain can cross the barrier within the
shared budget. Before closing RS writers, wait for accepted updates to
be written to peer sessions, using one 30-second deadline across all
domains and peers. Track selected-but-unwritten records until their
socket-write callbacks complete. Skipping an exact peer receipt cannot
credit an older pending write. Filtered updates retain a per-origin
delivery barrier tied to the local changelog generation: a peer-only
generation change cannot erase missing delivery, while a local reset
retires the old obligation. A delayed discard report from an old
selection cannot create a barrier in the new generation. Expiration is
logged. The existing collocated-DS offline-message shutdown
synchronization remains in place. A two-domain regression holds both
peer send windows closed and checks that the direct-update drain uses
one deadline and logs a warning for each undelivered target.
- **DS reconnect during teardown.** If a DS starts a handshake while the
previous session is closing or its registered handler is shutting down,
keep the ID reserved and reject the handshake until teardown releases
it. A conflict with a live session still logs error `54`.
- **Peer teardown:** unregister the old handler, stop accepting work and
remove its name-based monitors while holding the domain lock. Release
the lock before both `Session.close()` and reader/writer joins: closing
drains queued socket writes and can block on a slow peer, while a reader
applying its final topology message can need the same domain lock.
Neither wait may delay another peer's failover handshake. Reacquire the
lock before generation and topology decisions. Topology messages from
removed or replaced handlers are ignored; replacement monitors cannot be
deleted by late cleanup of the old handler. Receipt cleanup remains
after session closure and joins, and the full-server accepted-write
delivery barrier remains in place. Offline-message dispatch,
socket-write confirmation, and teardown now identify the recipient by a
per-connection token. The token does not retain the handler or session.
The shutdown continues to wait for a replacement with the same server ID
after the old connection finishes closing.
- **Peer receipts and catch-up:** incoming RS updates contribute to
monitoring state separately from the outgoing cursor. A migrating DS can
publish a newer CSN through a peer while older records remain queued
locally, so the incoming maximum proves neither the older history nor
its delivery. During ordered traversal, suppress only exact cached
receipts and preserve older unknown records. The receipt cache is
bounded by the existing queue capacity; eviction may cause a
conservative resend. Peer generation changes and shutdown clear cached
receipts. An exact receipt from the matching generation resolves its own
pending or filtered CSN in either callback order. Other outstanding CSNs
continue to fence delivery. The tracker keeps a bounded set of filtered
CSNs and one exact overflow CSN per origin. Multiple distinct overflow
CSNs for an origin keep a conservative barrier until a local generation
reset or session replacement. This fixes catch-up returning a peer's own
`DeleteMsg` when its assured sender expects an acknowledgement.
- **History received through peers:** record the newest peer update of
each origin on the domain before changelog publication. This state is
shared with newly registering RS handlers, so registration between
receipt and persistence cannot hide a missing prefix. Before sending a
queued direct update, compare its origin with peer history and reread
the available prefix when needed. A still newer peer receipt cannot
excuse older missing records. Local generation changes clear the history
marker; covered markers avoid a full domain-state snapshot, and
unavailable old-generation history cannot cause a retry loop. Idle peers
and direct writes from another origin do not trigger generic third-party
forwarding.
- **Local session closure:** a blocked socket read can wake with
`SocketException` after a local `Session.close()` but before the handler
is marked shutting down. The reader now checks the session's close
state, consistently with its EOF path and the writer. A genuine remote
TCP reset still reports error `181`; unexpected EOF from modern peers
also remains an error. The harness does not broadly suppress shutdown
disconnects.
- **Planned RS switches.** The DS sends `StopMsg` and continues to
receive and replay changes from the retiring RS. It moves to the next RS
after the peer replies or the switch deadline expires. The switch
deadline governs the wait after the old RS stops sending heartbeats. The
DS sends each `SAFE_READ` acknowledgement on the session that delivered
the update and retries local writes on the replacement when the old
session refuses them. During concurrent shutdown, the replacement must
receive the missing updates before the `ReplicaOfflineMsg`, within the
existing shutdown deadline. An initialization header from the retiring
session is discarded before a full import can claim the backend.
- **RS start handshake.** Send the outgoing RS start message and wait
for its reply outside the domain lock. A separate peer lock still
arbitrates crossed RS connections. An initialized domain already serving
a DS accepts another DS while the peer connect pass is in flight. A
domain still bootstrapping waits for that pass. If the advertised
generation changes during the wait, stop the stale handshake so a later
attempt advertises the current generation.
- **Offline delivery after a planned switch.** A stopping broker that
cannot open the elected connection to the former RS can try one other RS
that answered discovery. Check generation compatibility before selecting
it and again after its start reply. The stop watchdog closes the
provisional socket if the replacement is still in its handshake at the
write deadline. The broker uses the replacement session to send the
pending offline marker after any required recovery.
- **Failover retry.** On the first reconnect after losing an established
session, a timeout waiting for the elected RS's start reply keeps the
single retry on that RS. After TCP refusal from the elected former RS,
the broker prefers a compatible discovery responder (#1343). A different
RS that missed its discovery reply can take the retry if the former RS
fails phase one for another reason or if no compatible responder is
available after TCP refusal. If no RS answers discovery, the broker can
make one session attempt to an RS that missed its discovery reply. The
configured isolation policy applies if reconnection fails.
- **Empty-RS recovery:** only `rs534 / scale-rs-empty` sets
`REPLICATION_RECOVER_FROM_RS=1` on the returning RS. After scale-in has
verified endpoint removal from every DS, bootstrap selects an RS that
reports `ready` and checks its role and readiness again under the join
lock. The same readiness requirement applies when only `MASTER_SERVER`
is configured. Missing or unreadable sources are retried through RS
peers. Enable uses `--baseDN 'cn=admin data' --noSchemaReplication`, so
the new endpoint enters the administrative topology before the data and
schema replica lists. A retained-history checkpoint must pass before
scale-out DS restarts expose the endpoint. Final offline checks still
compare every CSN. The mode is off by default, preserving ordinary
bootstrap peer order and endpoint advertisement. `ready` remains a
membership signal; the caller must enforce the history barrier.
- **Bootstrap cost:** sequential administrative searches share one JVM
while each request creates a fresh LDAP connection and parser. Positive,
negative and stale JVM DNS caching are disabled for this worker so
recreated peers are resolved afresh. Private FIFOs preserve arguments,
output and LDAP status codes. A failed, malformed or timed-out worker is
disabled and reads fall back to ordinary `ldapsearch`. Genuine LDAP
errors retain their status. Existing batching of `dsconfig` changes and
immediate one-use membership snapshots remain in place; topology data is
not cached across mutations.
- **Partial bootstrap recovery:** disable local replication using the
local root account, without relying on an incomplete global-admin
registry or changing remote peers. `dsreplication disable --disableAll`
enumerates the actual local replication-domain configuration, including
domains below a backend's base DN. Verify that no local
replication-domain/server configuration remains before enabling again. A
persistent pending-reset marker keeps retries on the cleanup path even
if a failed disable already removed the data domain. Disable,
verification and join-lock release failures propagate; write and
readiness gates stay closed during repair. A terminal bootstrap marker
aborts harness waits, while ordinary predicate and Docker transport
failures remain retryable. Failure artifacts retain filtered regular
setup/replication/status tool logs.
- **Import preparation timeouts.** If a remotely initiated import times
out while draining replay or replication state saves, send the refusal
on its original session before restarting the broker. For a
single-target export on a v9 route, the importer retains the refusal for
that attempt and can send it through a replacement RS even if the first
reconnect fails. The exporter waits for an attempt-specific preparation
acknowledgement before streaming LDIF. The importer enters `FULL_UPDATE`
before draining, which keeps it out of `SAFE_READ` acknowledgement
tracking during preparation. The v8 wire format and initialization
behavior are preserved.
- **Initialization during reconnect.** Keep the import context when the
replication broker successfully publishes the initialization request. A
connection-state check made before publication could otherwise abandon
the import after the exporter had already started. The broker returns
whether its session accepted the message and restores the send-window
credit of a refused update.
- **Docker restart assertions.** Wait for the restarted member to
confirm membership and check for replication resets in the current
startup log. Recovery messages from the initial bootstrap no longer fail
a subsequent plain restart. An unreadable startup log fails the no-reset
assertion in both topologies.
- **Docker startup.** The base branch already starts the server after
the setup JVM exits (#1326). This PR tests that ordering and checks that
setup and startup failures reach the caller. The fixtures also exercise
launcher diagnostics and collect container state and cgroup OOM counters
when startup fails.
- **Bootstrap completion:** the entrypoint clears `.bootstrap-finished`
on every start, including retained-container restarts, and creates it
only after successful setup/upgrade and the requested background join.
Both test harnesses require this positive result and give
`.bootstrap-failed` priority. An absent join process during setup no
longer counts as completion. Health remains separate so retained volumes
preserve OrderedReady behavior while membership repair runs.
- **Maven failure audit diagnostics.** The test listener prints up to 16
KiB from the active audit log and reports rotations together. When Maven
fails, Build uploads the complete retained active and rotated audit
files for that matrix row and attempt, with five days of retention.
- **Stopped-container diagnostics:** waits guard the nodes required by
the current phase and abort if one exits or dies. Docker transport
failures remain retryable, and deliberately stopped peers are excluded
from these guards. The error trap preserves the original failure while
collecting Docker exit/OOM state, container logs, server logs and
filtered tool logs through `docker cp`, including from stopped
containers. It avoids command-line/password-file dumps. Replication
fixtures enable bootstrap timing and upload diagnostics in artifacts
named by image flavor and workflow attempt.
- **Docker CI memory:** remove the 512 MiB cap from 23 `docker run`
sites in the replication fixture and Docker workflow, including
failed-bootstrap and upgrade cases, and remove the two unused memory
variables. OpenDJ test containers now use the memory available on the
runner without a replacement Docker cap. The persistent search worker
and all correctness checks remain enabled; removing the Docker cap does
not change the JVM arguments or workload ceiling. The small non-Java
shared-memory holder retains its separate 64 MiB cap. Scale scenarios
already ran without the 512 MiB Docker cap.
- **Transient errors and convergence:** a rolling startup timeout must
occur before CORE135, and the same DS ID and domain must subsequently
connect to a verified eligible RS before the log boundary captured after
successful bootstrap in the recorded rolling window. Recovery may occur
after CORE135. Require exactly one startup and one of the data,
admin-data or schema domains; unknown peers/domains, later unrelated
restarts, incomplete bootstrap and unrecovered timeouts remain failures.
Record the exact timeout text and absolute log line; the filter accepts
only that proven line, including recovered `cn=admin data` timeouts.
During a separate-server roll, a surviving DS disconnect is accepted
only for the stopped RS address and after a later successful connection
to a verified eligible RS in the same domain and rolling window. The
returned RS becomes eligible only during scale-out; accepted intervening
timeouts must name the successful destination. Scale certificate
warnings require recovery evidence for the returned RS. `DS119` requires
a later `NOTICE 62` for the same DS ID, domain and rebuilt endpoint by
the end of scale-out. The two empty-volume scale rows enable per-attempt
TLS diagnostics for DS and RS clients. The acceptor's exact `105` line
must match a single in-window failed caller attempt by both TCP
addresses and ports. A later record in that caller's log must prove a
session for the same role, ID and domain with the rebuilt RS. DS
recovery can occur during the scale-out roll. RS recovery requires a
matching `NOTICE 313` inside the return window. The attempt diagnostic
covers retries that emit no new `RS312`. When `RS312` is present, the
caller filter still requires its own matching in-window `313`.
Unrecovered warnings and shutdown error `181` remain failures. The
longer convergence budgets apply only to the two combined scale
variants; the stable-zero criteria are unchanged.

CSN tracing and bootstrap timing are opt-in. The four scale rows and
`rs534 / empty-rs` enable allocation traces; scale rows also enable
bootstrap timing. Missing or unclosed traces fail validation. Failure
collection first preserves the live state, then normally stops DS
processes in parallel to close their traces; `KEEP=1` leaves the
containers running.

## Validation

### Rebase onto `master` at `0af6285cff`

The rebase preserves the ordinary failover path from #1343 alongside
this PR's start-reply timeout retry and offline delivery during
shutdown. The SAFE_READ ACK counter fix is already in `master` through
#1344. [Rebased
commit](https://github.com/OpenIdentityPlatform/OpenDJ/pull/1282/commits/c115be873557f40811b1b4e110363f91839f6e45)

Maven `verify` on macOS / JDK 21 passed all 423 selected integration
tests, including 41 broker stop tests and both assured replication
suites, with zero failures or skips. The 43 Python tests, 22 shell
self-tests, and `git diff --check` passed. [Current
Build](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/46137609745)

### Offline delivery during a planned switch and Maven audit output at
`b692c0da6e`

The [first Build
attempt](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45999690841/attempts/1)
at `e6b66c174e` passed all 32 jobs, including all nine Maven jobs and
all 13 Docker convergence scenarios. In the [Ubuntu / JDK 21
rerun](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45999690841/job/140606297336),
both RSs answered discovery during a stop. The elected former RS then
refused the connection, and the stopping broker withdrew the undelivered
`ReplicaOfflineMsg`. A controlled socket run reproduced the behavior on
the CI merge commit and on `master` with synchronization adapted to its
synchronous switch.
[Fix](https://github.com/OpenIdentityPlatform/OpenDJ/commit/b692c0da6eb43def5e118536dd056498ec4a8540)

- The broker suite passed **39 tests on macOS / JDK 21**, and the five
targeted shutdown-switch cases passed again before push. The regression
verifies delivery on the replacement, expiry of the stop deadline when
the replacement withholds topology, and generation mismatch at discovery
or in the new start reply. Removing the watchdog's close of the
provisional socket caused the deadline assertion to fail. [Socket
tests](https://github.com/OpenIdentityPlatform/OpenDJ/blob/b692c0da6eb43def5e118536dd056498ec4a8540/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationBrokerStopTest.java#L1185)
- The failing CI test began printing its audit log at 16:32 UTC. The 66
largest records, totaling 17.3 MB, took 2 h 28 min to appear. Maven
recorded its own finish after 54 minutes. Failure diagnostics now print
a 16 KiB tail of the active audit log and a notice for rotations. All
three audit tests passed on JDK 11 and 21, and an intentional listener
failure confirmed the console output and full files on disk. The Build
workflow uploads retained audit files on Maven failure. `actionlint` and
`git diff --check` passed. [Audit
regression](https://github.com/OpenIdentityPlatform/OpenDJ/blob/b692c0da6eb43def5e118536dd056498ec4a8540/opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtilsAuditLogTest.java#L29)
· [Artifact
upload](https://github.com/OpenIdentityPlatform/OpenDJ/blob/b692c0da6eb43def5e118536dd056498ec4a8540/.github/workflows/build.yml#L163)

### SAFE_READ ACK monitor timing at `e6b66c174e`

The Ubuntu / JDK 21 Maven job at `a11ac4fc0a` failed in
`AssuredReplicationPluginTest.testSafeReadModeReply`. The fake RS
received a successful ACK before the replay thread incremented
`assured-sr-received-updates-acked`. The test now waits for that counter
before checking the monitor snapshot. [Failing
job](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45985178673/job/140458842270)
· [Test
change](https://github.com/OpenIdentityPlatform/OpenDJ/commit/e6b66c174e41fa2288505f00e89a7b58fea38397)

- A temporary 750 ms pause before the increment reproduced the CI
assertion (`expected [1] but found [0]`). Both parameterized cases
passed with the updated test and the same pause. With the pause removed,
all 14 tests in `AssuredReplicationPluginTest` passed on macOS / JDK 21
with zero failures, errors, or skips. `git diff --check` passed.

### Slow peer RS start replies at `a11ac4fc0a`

Build at `893f01d6b9` passed 31 of 32 jobs. During `rs534 / empty-rs`,
`cv-d2` lost its session to the stopped `cv-r1`. Two handshakes to
`cv-r0` timed out, and `cv-d2` returned LDAP 53 for 20,575 client writes
before it reconnected. The saved logs locate the failed handshakes. The
cause of the delay in that CI run remains open.
[Build](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45956172960/attempts/1)
· [Failing empty-RS
job](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45956172960/job/140395331379)

- A controlled test drives the real RS connect thread and withholds a
peer start reply after TLS. On the previous code, a second DS on the
same initialized domain waited for that reply. With the fix, the DS
registers while the peer is still waiting. The test also verifies that a
crossed incoming RS gives way and that a generation change aborts the
stale handshake in the negotiated framing.
[a11ac4fc0a](https://github.com/OpenIdentityPlatform/OpenDJ/commit/a11ac4fc0a65bcf38e96b5d8285d2a29fc57eac4)
· [Socket
regression](https://github.com/OpenIdentityPlatform/OpenDJ/blob/a11ac4fc0a65bcf38e96b5d8285d2a29fc57eac4/opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerConnectFailureTest.java#L113)
- Maven on macOS / JDK 17 passed **133 targeted replication tests**,
with zero failures, errors, or skips. The run covered failover, crossed
connections, generation changes, registration, multi-homed peers, and RS
shutdown. `git diff --check` passed.

### Elected RS retry priority at `893f01d6b9`

A start-reply timeout while opening the elected session keeps the retry
on that RS. If the former RS answers discovery and then refuses the
elected TCP connection, the broker still retries the other RS that timed
out during discovery. Both paths share the same one-retry limit.
[893f01d6b9](https://github.com/OpenIdentityPlatform/OpenDJ/commit/893f01d6b9297b93ba9dd7fe8376e0ee3a9cbf95)
· [Review
finding](https://github.com/OpenIdentityPlatform/OpenDJ/pull/1282#pullrequestreview-6083080872)

- The new socket regression lets the former RS answer discovery, drop
its first elected start reply, and answer the retry. The other RS can
withhold both replies, and the test checks that it receives only the
discovery probe. The test reproduced premature isolation before the fix.
It now checks that the broker reconnects to the elected RS without
setting `connectionError` and delivers a subsequent LDAP write.
- Maven on macOS / JDK 17 passed **10,875 unit tests** and **36
integration tests** in the targeted broker run. Both the new regression
and the closed-listener fallback case passed. `git diff --check` passed.

### Failover retry after the former RS disappears at `10db3a058c`

The Ubuntu / JDK 17 job at `2c432ed240` reported one failure in
`ReplicationBrokerStopTest.failoverAllowsOneRetryOfTheSurvivingRs`. The
survivor timed out during discovery, and the former RS was selected but
refused the connection. The broker entered isolation before retrying the
survivor. The fix directs the single retry to the survivor in this case.
[10db3a058c](https://github.com/OpenIdentityPlatform/OpenDJ/commit/10db3a058c0476bdd4d2481ae5e3f2f662f397c9)
· [Failing
job](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45871967027/job/140089520411)

- The socket regression reproduces this sequence by closing the former
RS listener after its discovery reply. It failed with the same
premature-isolation assertion before the fix. Maven on macOS / JDK 17
passed all **35 tests** in `ReplicationBrokerStopTest` and
`ReplicationBrokerConnectFailureTest`, including all six failover cases,
with zero failures, errors, or skips. `git diff --check` passed.

### CodeQL follow-up at `2c432ed240`

The receive loop uses one null-checked session from the connection
snapshot for reads, acknowledgements, and reconnect handling.
Single-target export initializes its ACK window with the validated
replica ID. The import caller closes `ReplInputStream` when either
backend import path returns or throws, including when preparation is
refused.
[Fix](https://github.com/OpenIdentityPlatform/OpenDJ/commit/2c432ed240384f197404400fd470b01dfe879f8f)
· [Session
warning](https://github.com/OpenIdentityPlatform/OpenDJ/security/code-scanning/1700)
· [Target
warning](https://github.com/OpenIdentityPlatform/OpenDJ/security/code-scanning/1712)
· [Stream
warning](https://github.com/OpenIdentityPlatform/OpenDJ/security/code-scanning/1713)

- Maven on macOS / JDK 21 passed all **120 tests** in `InitOnLineTest`,
`ReplicationDomainTest`, `ReplayDuringImportTest`, and
`ReplicationBrokerStopTest`, with zero failures, errors, or skips. `git
diff --check` passed. CodeQL reported no new alerts on `2c432ed240`.
[CodeQL
check](https://github.com/OpenIdentityPlatform/OpenDJ/runs/140089832795)

### v9 replication test fixtures at `6464860991`

The Ubuntu / JDK 21 build at `f326bc91f6` recorded five failures in two
test classes. The single-RS simulated importer did not send its v9
preparation acknowledgement. The four generation ID warning cases
decoded a hand-built v8 payload with the v9 decoder. [Failing
job](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45860524492/job/140050038184)
· [Fixture
fixes](https://github.com/OpenIdentityPlatform/OpenDJ/commit/6464860991dc34c4d69fe91bc5233884333eba44)

- Both single-target export fixtures send the preparation
acknowledgement when the header supplies an attempt ID. The warning
fixture decodes its byte array as v8, then sends the message over the
peer session using the negotiated protocol. It exercises routing for
both the symbolic and numeric message IDs.
- Maven on macOS / JDK 21 passed all **55 tests** in `InitOnLineTest`
and `ReplicationDomainTest`, including all five failing cases, with zero
failures, errors, or skips. `git diff --check` passed.

### Import refusal after an RS change at `f326bc91f6`

If the original RS accepts a preparation refusal after losing its route
to the exporter, the importer can resend the same refusal through the
replacement RS. A v9 preparation acknowledgement or refusal is matched
by attempt ID and importing replica ID. The exporter waits for that
reply even if the importer temporarily disappears from the topology.
[Blocking
review](https://github.com/OpenIdentityPlatform/OpenDJ/pull/1282#pullrequestreview-6076376014)
·
[Fix](https://github.com/OpenIdentityPlatform/OpenDJ/commit/f326bc91f6e2e0a15594b7a91e4ba5d587371212)

- The two-RS regression covers a direct reconnect to the exporter's RS,
a failed first reconnect, and a return to the original RS before
failover. It verifies that the exporter reports the exact preparation
failure, ignores a refusal for an earlier attempt, and sends no LDIF
before the importer is ready. The importer's existing data survives. A
separate case exercises successful preparation and import. [Socket
tests](https://github.com/OpenIdentityPlatform/OpenDJ/blob/f326bc91f6e2e0a15594b7a91e4ba5d587371212/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplayDuringImportTest.java#L666)
- The macOS / JDK 27 Maven reactor passed **93 selected tests** with
zero failures, errors, or skips. This includes all of
`ReplayDuringImportTest` and `ProtocolCompatibilityTest`, the multi-RS
single-target export test, and the single-RS generation ID test. The
codec tests verify that v9 messages retain the attempt ID, that scoped
replies are never sent as ordinary v8 replies, and that ordinary v8
messages remain compatible. `git diff --check` passed. [Protocol
tests](https://github.com/OpenIdentityPlatform/OpenDJ/blob/f326bc91f6e2e0a15594b7a91e4ba5d587371212/opendj-server-legacy/src/test/java/org/opends/server/replication/protocol/ProtocolCompatibilityTest.java#L1144)

### Import refusal during reconnect at `a7863a4de1`

The Ubuntu / JDK 25 Maven job at `7a79c63667` reached the ten-minute
timeout in
`ReplayDuringImportTest.aTimedOutDrainLeavesTheOriginalDataUsable`. The
importer had rejected the request before replacing the backend. Its
reconnect was refused while the RS still held its previous registration,
so the exporter did not receive the refusal. With periodic monitoring
frames, the test's broker read could keep waiting without reaching the
assertion deadline. [Failing
job](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45812528898/job/139883928282)
·
[Fix](https://github.com/OpenIdentityPlatform/OpenDJ/commit/a7863a4de1d115319c829e889fdbe7913f5a2d26)

- Both drain-timeout cases failed before the fix and passed afterward.
The test disables reconnect while keeping the original session open,
reads from the exporter's timed session, and verifies the exact refusal,
the original data, and a successful subsequent import. [Regression
test](https://github.com/OpenIdentityPlatform/OpenDJ/blob/a7863a4de1d115319c829e889fdbe7913f5a2d26/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplayDuringImportTest.java#L587)
- A local socket run delayed removal of the old DS registration by 750
ms, confirmed that the RS refused the immediate reconnect, and verified
that the exporter received the error and the subsequent import
succeeded. All 105 tests in `ReplayDuringImportTest`,
`ReplicationDomainTest`, and `ReplicationBrokerStopTest` passed on macOS
/ JDK 21. `git diff --check` passed. [Build
checks](https://github.com/OpenIdentityPlatform/OpenDJ/pull/1282/checks)

### Failover test readiness at `7a79c63667`

The failover fixture waits for the replacement RS ID and for the broker
to clear `connectionError` before asserting that LDAP writes resume. The
exhaustion cases verify LDAP 53 during isolation, then require a
successful modify and delivery after recovery.
[Review](https://github.com/OpenIdentityPlatform/OpenDJ/pull/1282#pullrequestreview-6073370300)
·
[Fix](https://github.com/OpenIdentityPlatform/OpenDJ/commit/7a79c636673846ba26dcb84e6c3f148343d687cc)
· [Updated
test](https://github.com/OpenIdentityPlatform/OpenDJ/blob/7a79c636673846ba26dcb84e6c3f148343d687cc/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationBrokerStopTest.java#L1603)

A local run with a 750 ms delay before clearing isolation reproduced the
premature LDAP 53 response in both exhaustion cases at `bfc52bf3c2`. All
five cases passed on JDK 21 with the test fix, both with the delay and
with the normal broker. The branch is based on `master` at `b24036b260`.
[Build
checks](https://github.com/OpenIdentityPlatform/OpenDJ/pull/1282/checks)

### Failover retry at `bfc52bf3c2`

On `19930c9fe6`, 31 of 32 Build jobs passed. In `rs534 / empty-rs`,
`cv-d3` timed out probing the surviving `cv-r0`, and `cv-d0` timed out
opening its session after a successful probe. The DSs returned 35,384
LDAP 53 responses before reconnecting to `cv-r0`. The load check failed
before LDIF and changelog validation. [Failing
job](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45771247952/job/139782051209)
· [CI
diagnostics](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45771247952/artifacts/15101853312)

- Three socket cases reproduced premature isolation on the previous
broker. With the retry, all five cases passed on JDK 21, including both
timeout paths, ordered delivery of LDAP writes, and LDAP 53 after the
retry expires. All five passed again on the branch rebased onto `master`
at `ede1b306bc`.
[Fix](https://github.com/OpenIdentityPlatform/OpenDJ/commit/bfc52bf3c2557b1f3a57ffa9cd91bf13efb8e5c4)
· [Regression
test](https://github.com/OpenIdentityPlatform/OpenDJ/blob/bfc52bf3c2557b1f3a57ffa9cd91bf13efb8e5c4/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationBrokerStopTest.java#L1538)
- The broader JDK 21 run passed 66 tests across
`ReplicationBrokerStopTest`, `HandshakeAbortRegistrationTest`, and
`ReplayDuringImportTest`. [Build on this
revision](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45804838237)

### Retiring-session initialization guard at `1369b20b51`

The DS checks the session that delivered an `InitializeTargetMsg` before
dispatching it to the import listener. A session that is closing for a
planned switch can continue delivering incremental changes. The broker
discards its initialization headers before dispatch. [Blocking
review](https://github.com/OpenIdentityPlatform/OpenDJ/pull/1282#pullrequestreview-6051721228)
· [Fix
commit](https://github.com/OpenIdentityPlatform/OpenDJ/commit/1369b20b511b96bacd4018bfe1a33119912ec9c1)

- The socket regression failed on the rebased parent because the
retiring session started full initialization. With the guard, the
existing entry remains readable and present in the active LDIF file. The
incremental delete from the retiring RS is replayed and persisted before
the stop reply.
- On JDK 21, **30 Maven integration tests passed**, covering the full
`ReplicationBrokerStopTest` class and both selected
`ReplayDuringImportTest` scenarios. The branch is based on `master` at
`ded55f7c56`. [Build
checks](https://github.com/OpenIdentityPlatform/OpenDJ/pull/1282/checks)
- On the first CI attempt at `4995d9c455`, the Ubuntu / JDK 27 Maven
step passed. The runner received a shutdown signal during the later
replication step. The interrupted matrix row skipped the downstream
Docker checks. [Previous Linux
job](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45494537218/job/138801569004)

### Planned RS switch at `4995d9c455`

The `rs534 / restart-rs` job on #1316 recorded `ERROR 211` when a DS
rebalanced from the surviving RS to the restarted RS. The retiring RS
reported a TCP reset with 99 messages still queued. Indexed searches and
offline checks passed, and both changelogs had zero gaps. [Failing
`restart-rs`
job](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45351125404/job/138543571882)
· [Replication logs and check
results](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45351125404/artifacts/14939560365)

- A socket regression on `d3cc5cc725` showed the DS leaving its old
session before that RS replied. On
[`4995d9c455`](https://github.com/OpenIdentityPlatform/OpenDJ/commit/4995d9c455644a19cd24ea2c344050e22978710c),
the DS replays an update from the old RS and sends its pending local
update once on the replacement. The regression also pauses the old RS
heartbeat during the stop exchange. Separate tests cover an unresponsive
peer and a genuine heartbeat failure.
- The JDK 21 Maven reactor passed **701 selected replication tests**
before the final heartbeat change. After that change, **72 focused
tests** passed across the broker, publisher, teardown and status-monitor
classes. The replication-error filter, restart and kill fixtures, and
summary self-tests passed.
- The local Docker `restart-rs` and `kill-rs` attempts ended at node
readiness before the convergence checks, including a retry with bounded
JVM resources. [Build
checks](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45494537218)

### Earlier merge candidate `d3cc5cc725`

This candidate is based on `master` at `9db63ab6e6`. Its replication
sources, replication tests and scenario scripts match the revision
approved at `af80f3243a`. The seven subsequent commits on RS switching,
failover and initialization were set aside for separate review. The
reviewer approved this candidate after verifying the split. [Candidate
approval](https://github.com/OpenIdentityPlatform/OpenDJ/pull/1282#pullrequestreview-6038726301)
[Candidate
commit](https://github.com/OpenIdentityPlatform/OpenDJ/commit/d3cc5cc7256275f5de5a82df14d56d56a2ad1027)
· [Earlier
approval](https://github.com/OpenIdentityPlatform/OpenDJ/pull/1282#pullrequestreview-6003626545)

- All 32 local checks passed on this SHA, covering 27 replication
scripts, four Docker fixtures and the Unix launcher fixture under
`dash`. The diff against the base passed `git diff --check`.
- All 33 Build jobs passed on the earlier approved revision. CodeQL
passed on this candidate. Its Build checks both `rs534 / kill-rs` and
`rs534 / empty-rs`. [Earlier
Build](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44819053721)
· [Candidate
Build](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45384412227)
· [Candidate
CodeQL](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/45384412161)

<details>
<summary>Validation on earlier revisions</summary>

### Review follow-up at `af80f3243a`

- The JDK 21 Maven reactor passed **185 selected tests**, with zero
failures, errors, or skips. A real DS broker TLS handshake failure
produces `NOTICE341` with the role, replica ID, domain and both TCP
endpoints. The publication regression checks a session refusal and full
restoration of its send-window credit.
- All **31 shell/Python self-tests** passed, including **156
error-filter cases**. The restart fixture rejects a reset from the
current startup and an unreadable log. For a healthy combined node, it
detects both a missing membership wait and a reset assertion that ran
before membership was reported.
- The five-file review diff was preserved when rebasing onto
`fac7c60c5f`. The restart, replication-error and Docker entrypoint
self-tests and Bash syntax checks passed again on the rebased branch.

### Full CI at `ccc0e286d3`

[Build 44691688631, attempt
1](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44691688631/attempts/1)
passed **33 of 33 jobs**, including all nine Maven jobs, both Docker
replication and upgrade jobs, and all 13 convergence scenarios. Both
Docker variants passed the plain restarts, including the separate-role
restart that failed on `cfa0e0c081`.
[CodeQL](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44691688678)
passed all four analyses. The [Trivy
comparison](https://github.com/OpenIdentityPlatform/OpenDJ/runs/136534501507)
was neutral because two scheduled published-image configurations from
`master` were absent on the PR. Both built-image scan and SARIF upload
steps passed.

The four scale rows finished their workloads in 1330–2163 seconds under
the 2700-second ceiling. Both empty-volume rows recorded 50,001 updates
while the server was absent and zero missing changelog changes. The
certificate proof files were empty in both rows. [Separate-role
artifact](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44691688631/artifacts/14655321308),
[combined
artifact](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44691688631/artifacts/14636662788).

### Docker replication follow-up at `ccc0e286d3`

[Build
44620035038](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44620035038)
on `cfa0e0c081` passed all 13 convergence scenarios, including all four
scale rows. The [default Docker
job](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44620035038/job/135989621836)
failed because its restart check matched reset messages from the initial
bootstrap. The [failure
artifact](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44620035038/artifacts/14590617482)
shows that `dj-d0` started exporting while `dj-d1` reported a
disconnected broker, and that `dj-r0` confirmed membership after the
restart without a new reset.

- The new replication regression reproduced an exporter starting while
the importer reported a disconnected broker. It passed after the fix and
verified transferred data and successful completion on both sides. All
43 `ReplicationDomainTest` cases passed on JDK 21 with zero failures or
skips.
- The shell regression accepts an old reset and rejects one in the
current startup. The Docker diagnostics and bootstrap self-tests, Bash
syntax checks, and `git diff --check` passed.
- Locally, the default CI image with the corrected replication class
passed the four-node `#534` startup and plain-restart phases, including
replication in both directions and both membership checks. This run
covered those two phases of the Docker fixture.

### TLS attempt correlation at `cfa0e0c081`

- The error-filter regression accepts paired failures logged in adjacent
seconds and TLS retries without a new outage warning. It rejects
unrelated socket endpoints, ambiguous attempts, and missing or
out-of-window RS recovery. The dedicated caller fixture verifies that an
in-window `NOTICE313` clears `WARN312` and an out-of-window one leaves
the exact warning.
- The JDK 21 Maven reactor passed **30 selected tests**, with zero
failures or skips. The socket regression captures both endpoints for
each of two retries while the caller reports the outage once. All **27
replication shell/Python self-test files** passed on macOS and Linux,
including **156 error-filter cases**. All 13 Docker convergence
scenarios passed in the CI run linked above.

### TLS and retained-volume scale follow-up at `4b2fffa22a`

In [Build
44520106015](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44520106015)
at `a6e8c6495a`, both separate-server scale rows and `combined /
scale-empty` passed. [`combined /
scale-kept`](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44520106015/job/135641927702)
timed out at the first scale-out checkpoint. The retained-volume
bootstrap reassigned `cv-c3` from replica ID `5593` to `10069`. The new
process's trace contained only offline allocations. All 323 comparisons
rejected the reference snapshot for its missing workload position for DS
`10069`. The new-ID write probe now runs before this checkpoint in both
combined scale variants. [Failure
artifact](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44520106015/artifacts/14544294597)

- The certificate fixtures reproduce the two review failures on the
previous code. They cover a same-second `62` followed by a later valid
`62`, recovered `RS312` with a matching acceptor `105`, and a combined
caller with same-second warnings in both roles. Missing recovery, the
wrong source or session, and RS recovery outside the return window
remain errors.
- The lifecycle fixture covers a retained-volume rejoin with a new ID,
aborts the roll when its LDAP probe fails, and checks the probe ordering
before the first pause. The identity fixture validates recording a new
ID and recognizing a previously recorded one.
- All 27 replication shell/Python self-tests passed on macOS and Linux
with GNU awk, including 151 error-filter cases. Shell syntax and `git
diff --check` passed. All 13 Docker convergence scenarios later passed
on this revision, including all four scale rows. [Build
44561609276](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44561609276)

### CI follow-up at `a6e8c6495a`

[Build 44343640204, attempt
3](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44343640204/attempts/3)
on `80fb0f9369` passed 31 of 33 Build jobs, including all Maven jobs and
11 of 13 Docker convergence scenarios. CodeQL passed.

- [`rs534 /
scale-rs-empty`](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44343640204/job/135127285794)
converged in 17 seconds. LDIF, index and changelog checks passed,
including complete coverage of the 50,001-change backlog. The online
error check found `54` on `cv-r0` when its local `cn=admin data` DS
tried to reconnect as the rebuilt RS was added to the peer list. The DS
connected to `cv-r1` one second later.
- [`combined /
scale-kept`](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44343640204/job/135127285839)
completed scale-out around 2632 seconds into the 2700-second load. All
230 clients exited with status `0`. The remaining 68 seconds fell below
the 70-second minimum for launching a post-scale segment, so the job
ended before convergence and offline checks.

- The JDK 21 Maven reactor passed all 85 selected Java tests with zero
failures or skips. The handshake regression reproduces error `54` before
the fix for both a closing session and a handler already marked for
shutdown. It also verifies rejection and error reporting for a live
duplicate.
- All 27 replication shell/Python self-tests passed on macOS and on
Linux with GNU awk. The scale fixture rejects the old serial pause order
and checks that failure releases the surviving writers. Shell syntax and
`git diff --check` passed.

### Review follow-up at `80fb0f9369`

- The two targeted TestNG classes ran on JDK 21 using the reactor
classpath and freshly compiled changed classes. All 55 tests passed with
zero failures or skips. The shutdown regression exercises a fatal
changelog write error for DS and RS sources. The receipt regressions
cover both callback orders, a different generation, an outstanding
earlier write, cache eviction, and overflow. The CLI regression uses a
backend-root domain and a nested domain. The prior code timed out at the
DS shutdown barrier, kept the exact receipt blocked, and left the nested
domain configured.
- All 32 local shell/Python self-test files passed, including 137
replication error filter cases. Scale fixtures require the returned DS's
first write and refresh a reference snapshot missing the new origin. The
join fixtures exercise readiness at selection and under lock, confirm
that only recovery disables schema replication, and reject independent
mutations to the wrapper's exit status and failure marker. Shell syntax,
copyright headers and `git diff --check` passed.

### Scale return-window follow-up at `34439d8870`

- The regression feeds the allowances emitted by `disturb()` to the real
error filter. It failed before the fix and passed for both surviving RSs
afterward. The filter tests still cover missing recovery, a different
peer or domain, and recovery outside the return window.
- All 27 replication self-tests and the launcher self-test passed on
macOS. The error filter passed 137 cases. Shell syntax checks and `git
diff --check` passed. Local verification used log fixtures for this
change. In [Build
44303119965](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44303119965),
both separate-server scale rows and `combined / scale-empty` passed.
[`combined /
scale-kept`](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44303119965/job/134899066020)
reached convergence, then failed the online replication-error check on
`cv-c1`.

### Review follow-up at `6ca519583a`

- The JDK 21 Maven reactor passed **162 selected tests** with zero
failures, errors, or skips. The replacement-session regression failed
before the fix because the old teardown cleared the outstanding forward,
then passed with per-session ownership.
- The two-domain direct-update test recorded both timeout warnings and
completed the forwarding wait in about 2.1 seconds with a shared
2-second budget. The LDAP test used a listener returning an entry
followed by `sizeLimitExceeded` (`4`) and verified output, status and
the next worker request. The shell fixture also compares partial LDIF
byte for byte and verifies that the worker result does not trigger a
fallback.
- All **27 replication self-test files** and the launcher self-test
passed on macOS. The error filter passed **137 cases**, including
cross-domain, wrong-peer and out-of-window recovery checks. The launcher
fixture checks exit `2`, diagnostics with a still-running child, and
that the final startability probe is skipped. `git diff --check` passed.
- The scale certificate checks were exercised with fixtures and archived
logs. See [Build
44259103177](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44259103177)
for CI on that revision.

### Previous validation at `7451e3f79f`

[Build 43994616243, attempt
1](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/43994616243),
on head `7451e3f79f`, passed all 33 jobs. All nine Maven jobs, both
Docker replication/upgrade fixture jobs, and all 13 convergence
scenarios passed. CodeQL also passed on its first attempt. The scale
scenarios completed the workload and online/offline checks within their
configured limits:

| Scenario | Load | Convergence phase |
|---|---:|---:|
| `rs534 / scale-rs-kept` | 1036 s | 108 s |
| `rs534 / scale-rs-empty` | 1114 s | 101 s |
| `combined / scale-kept` | 1304 s | 131 s |
| `combined / scale-empty` | 1944 s | 194 s |

The previously failing `rs534 / empty-rs` scenario also passed. The
Trivy check is neutral: GitHub could not compare alerts for
`trivy-image-alpine` and `trivy-image-latest` because those
configurations from `master` were not found on the PR.

The completed [Build 43914906507, attempt
1](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/43914906507),
at preceding head `1cb60c42f9`, finished with **29 successful jobs and
four failures**. Both complete Docker replication/upgrade fixture jobs
and all nine Maven jobs passed. Head `7451e3f79f` addressed the four
failing rows:

| Scenario | Result at `1cb60c42f9` | Corresponding correction |
|---|---|---|
| `combined / scale-empty` | Passed all checks; workload 1746 s | The
previous 99-record gap and unexpected error `181` did not recur in this
run. |
| `combined / scale-kept` | Workload 2218 s; stable-zero phase completed
in 510 s within the 900-second budget; final data/index/history checks
passed, but one replay error `9` failed the row | Prevent dependency
re-parking after replay ownership transfers. |
| `rs534 / scale-rs-kept` | Workload 2185 s; final data/index/history
checks passed, but a recovered admin-data startup timeout failed the row
| Record exact same-DS/domain recovery after CORE135 and before observed
successful bootstrap. |
| `rs534 / scale-rs-empty` | Aborted during scaling after 715 s of load:
a 50-second add segment averaged about 1.72 operations/s, below the 2/s
floor, with zero LDAP errors while bootstrap commands were still running
| Complete the whole restarted group's bootstrap before resuming
measured load. |
| `rs534 / empty-rs` | A surviving RS handshake timed out during
failover; DS writes were rejected with LDAP result 53 before
reconnection | Release the live RS domain lock before session closure
can block on draining accepted writes. |

Local verification at `7451e3f79f`:

- The combined **12-class Java run passed 242 tests, with zero failures
or skips**, in 136 seconds. It covers pending-change ownership,
dependency ordering, selected replay-unwind paths, historical ordering,
RS/session shutdown, reader/writer disconnects, missed-update recovery,
catch-up and send-window handling. Existing disabled or excluded tests
are not counted as executed; this is a targeted regression suite, not
the full Maven suite.
- Twelve new deterministic ownership cases failed before the fix and
passed afterward, across ADD/MODIFY/DELETE/MODDN. They cover double
handoff, clear plus same-CSN re-delivery and stale foreign-owner scans.
Removing either the identity guard or the owner guard independently
causes four expected failures.
- Two new tests use real sessions and a real broker handshake while
another DS or RS session's close is deliberately held in a socket flush.
Both timed out before the lifecycle split and passed afterward.
Reader-join, replacement-monitor and concurrent full-shutdown
regressions also pass. The drain remains graceful; no new broker retry
suppression or timeout increase was introduced.
- All **27 replication shell/Python self-test files passed on macOS and
Linux**. Bootstrap tests cover every member of the group, active
surviving writers, positive completion, terminal failure, retryable
transport errors, worker failure and deadline exhaustion. Timeout tests
reject mismatched domains/DSs, unknown peers, unrelated restarts,
incomplete bootstrap and out-of-window recovery. Four harness mutations
fail their intended assertions.
- Replaying the saved CI bootstrap log changes the recovered-timeout
result from zero accepted records to exactly one: DS8716, `cn=admin
data`, with the original error text and line retained as evidence. Shell
syntax, copyright checks and `git diff --check` pass.

The exact CI thread interleavings were not captured; the regressions
reproduce concrete ownership and handshake-blocking mechanisms
consistent with the failures. Bootstrap overlap is established by the
saved timing logs; the new scheduling completed all four scale workloads
within 2700 seconds in the CI run above. No heavy local OpenDJ/Docker
load run was repeated on the busy host.

The 2700-second scale workload ceiling, 900/600/300-second convergence
budgets, throughput floors and strict data/index/history/error checks
remain unchanged. Longer bootstrap waits fail within those bounds rather
than bypassing them.

</details>
59 files modified
45 files added
14209 ■■■■■ changed files
.github/scripts/docker-startup-diagnostics.sh 47 ●●●●● diff | view | raw | blame | history
.github/scripts/docker-test-replication.sh 118 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/assert-converged.sh 243 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/changelog-checkpoint.py 108 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/changelog-gaps.py 132 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/collect.sh 140 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/csn-trace.py 107 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/disturb-empty-rs.sh 111 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/disturb-scale.sh 843 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/lib.sh 63 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/load.sh 61 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/monitor.sh 5 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/rolling-load.sh 259 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/run.sh 34 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/scale-coverage.py 76 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/scale-deadline.py 64 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/scale-fence.py 89 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/scale-membership.sh 27 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/scale-monitor.py 294 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-changelog-checkpoint.py 110 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-changelog-gaps.py 148 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-csn-trace-harness.sh 88 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-csn-trace.py 80 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-disturb-empty-rs.sh 155 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-disturb-scale.sh 672 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-join-batch.sh 256 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-join-reset.sh 117 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-join-search.sh 77 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-join-timing.sh 70 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-replication-errors.sh 329 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-rolling-load.sh 386 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-scale-bootstrap.sh 153 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-scale-coverage.py 90 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-scale-deadline.py 51 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-scale-fence.py 71 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-scale-ids.sh 44 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-scale-membership.sh 35 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-scale-monitor.py 230 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-scale-timeout.sh 134 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-scale-topology.sh 57 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-summary.sh 22 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-unindexed-searches.sh 84 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/selftest-wait.sh 90 ●●●●● diff | view | raw | blame | history
.github/scripts/replication/topology-up.sh 27 ●●●●● diff | view | raw | blame | history
.github/scripts/selftest-detached-start.sh 16 ●●●●● diff | view | raw | blame | history
.github/scripts/selftest-docker-diagnostics.sh 64 ●●●●● diff | view | raw | blame | history
.github/scripts/selftest-docker-replication-wait.sh 145 ●●●●● diff | view | raw | blame | history
.github/scripts/selftest-docker-run.sh 75 ●●●●● diff | view | raw | blame | history
.github/scripts/selftest-docker-setup.sh 73 ●●●●● diff | view | raw | blame | history
.github/workflows/build.yml 125 ●●●●● diff | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/BootstrapSearch.java 94 ●●●●● diff | view | raw | blame | history
opendj-ldap-toolkit/src/test/java/com/forgerock/opendj/ldap/tools/BootstrapSearchTestCase.java 180 ●●●●● diff | view | raw | blame | history
opendj-packages/opendj-docker/README.md 18 ●●●●● diff | view | raw | blame | history
opendj-packages/opendj-docker/bootstrap/join-batch.sh 57 ●●●●● diff | view | raw | blame | history
opendj-packages/opendj-docker/bootstrap/join-search.sh 75 ●●●●● diff | view | raw | blame | history
opendj-packages/opendj-docker/bootstrap/join-timing.sh 30 ●●●●● diff | view | raw | blame | history
opendj-packages/opendj-docker/bootstrap/join.sh 206 ●●●●● diff | view | raw | blame | history
opendj-packages/opendj-docker/run.sh 29 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/CsnAllocationTrace.java 186 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java 45 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/PendingChanges.java 125 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/RemotePendingChanges.java 79 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ErrorMsg.java 33 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/InitializeRcvAckMsg.java 38 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/InitializeTargetMsg.java 32 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ProtocolVersion.java 6 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ReplSessionSecurity.java 39 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ReplicationMsg.java 2 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/Session.java 203 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/UpdateMsg.java 24 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/MessageHandler.java 30 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServer.java 30 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServerDomain.java 291 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServerHandler.java 331 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ServerHandler.java 95 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ServerReader.java 4 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ServerWriter.java 22 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/service/DSRSShutdownSync.java 79 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/service/HeartbeatMonitor.java 15 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationBroker.java 574 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java 302 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliMain.java 49 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/messages/org/opends/messages/replication.properties 2 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java 69 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtilsAuditLogTest.java 91 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java 8 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/InitOnLineTest.java 27 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/CsnAllocationTraceTest.java 74 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/DuplicateReplayTest.java 40 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java 95 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/PendingChangesTest.java 4 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/RemotePendingChangesTest.java 244 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplayDuringImportTest.java 195 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationBrokerStopTest.java 842 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/protocol/ProtocolCompatibilityTest.java 42 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/protocol/SessionTest.java 75 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/server/HandshakeAbortRegistrationTest.java 75 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerConnectFailureTest.java 275 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerDomainMonitorTest.java 72 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerShutdownSyncTest.java 1415 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/server/ServerReaderDisconnectTest.java 67 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/service/DSRSShutdownSyncTest.java 98 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/service/ReplicationDomainTest.java 97 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/tools/dsreplication/ReplicationCliMainTest.java 84 ●●●●● diff | view | raw | blame | history