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

Valery Kharseko
yesterday 52694d4c03f9b09b2e52f389701255f3c78dfd9b
refs
author Valery Kharseko <vharseko@3a-systems.ru>
Monday, November 30, 2026 09:18 +0100
committer GitHub <noreply@github.com>
Monday, November 30, 2026 09:18 +0100
commit52694d4c03f9b09b2e52f389701255f3c78dfd9b
tree 09dce2d2bb869a9547cda92f9538f404333af48a tree | zip | gz
parent 3be885b70108e0efd3cd8508c1a0b6169a8003cd view | diff
Bound replication server discovery during failover (#1346)

## Summary

- Stagger up to four replication server discovery probes under a shared
deadline. Ordinary discovery waits up to one more second after a
compatible server in the preferred group replies. Planned switches can
use the full discovery window while the domain is running.
- If failover cannot establish the elected connection and needs another
candidate, continue outstanding discovery within the original deadline.
Preserve the elected server's single retry after a start-reply timeout.
- Rotate candidates into the next round if they were untried or only had
the tail of the discovery budget. Close outstanding probe sockets and
preserve the configured timeout for the selected session. With
`connection-timeout` set to zero, discovery still has a five-second
deadline.
- Cover planned switches to slower responders, failover while another
probe is pending, continued LDAP writes after the elected server refuses
a new connection, and discovery with five candidates under finite and
disabled session timeouts.
- Log EOF and TCP reset at `DEBUG` after TLS if the replication server
has received zero frame bytes. A truncated header or payload still
reports `ERROR 86`.

## Validation

- macOS with JDK 21 passed 84 targeted tests, including four new
loopback TLS cases for EOF, TCP reset, a truncated header, and a missing
payload. Each case checks that the listener accepts the next client.
[Regression
test](https://github.com/OpenIdentityPlatform/OpenDJ/blob/3c4933060f8c96793d273b0160ea06c0a6fa55cf/opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerConnectFailureTest.java#L110-L153)
- In a separate test with two real replication servers, cancelling a
discovery probe after TLS reproduced `ERROR 86` before the fix. After
the fix, five cancellations produced zero `ERROR 86` records and the
affected server accepted another session each time.
- The [previous combined scale-kept
run](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/46277242690/job/141424923753)
converged in 337 seconds. The final LDIFs matched and the changelogs
showed no gaps. The log check failed on `ERROR 86` with `no more data`.

### Earlier runs

- On macOS with JDK 21, the two regressions from review both failed on
the previous PR head. The updated branch passed all 49 tests across
`ReplicationBrokerStopTest`, `ReplicationBrokerConnectFailureTest`, and
`GroupIdHandshakeTest`.
- The slow-probe regression reproduced blocked failover on `master` and
passed with this change.
- Ubuntu / Zulu JDK 27 passed all 44 `ReplicationBrokerStopTest` cases
and three runs of `GroupIdHandshakeTest`.
- Linux / JDK 11 passed the three new regression cases.
- The broader Maven run passed 145 of 146 selected server tests. The
remaining shutdown fixture needed more time to reach the topology
exchange under load. After the fixture adjustment, all five cases of
that test passed in a targeted Maven `verify` run.
6 files modified
1181 ■■■■■ changed files
opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/ReplicationSynchronizationProviderConfiguration.xml 13 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/Session.java 60 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServer.java 18 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationBroker.java 548 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationBrokerStopTest.java 462 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerConnectFailureTest.java 80 ●●●●● diff | view | raw | blame | history