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

Valery Kharseko
38 mins ago d10be9455ccee71072843da100f9102d410a4406
refs
author Valery Kharseko <vharseko@3a-systems.ru>
Tuesday, December 1, 2026 12:05 +0100
committer GitHub <noreply@github.com>
Tuesday, December 1, 2026 12:05 +0100
commitd10be9455ccee71072843da100f9102d410a4406
tree 639e72d74d2df7ab4c8b4d5d84a4dd8f868ce4c1 tree | zip | gz
parent 48f3197de5cbfe0cc0110d95b8d53e3d2c527fe4 view | diff
Prevent duplicate changelog cursors during replica publication (#1352)

A domain cursor could discover a new replica database in its initial
scan and then receive a second notification when the writer finished
publishing that same database. If the reader had already consumed a
change, it could replay it. If both cursors reached the same change
together, one could remain open at shutdown.

`FileChangelogDB` now uses the same per-domain lock for publishing a
replica and for scanning and registering a new reader. A reader that
starts before publication receives the notification. A reader that
starts afterwards discovers the replica in its initial scan and uses its
requested starting CSN.

The regression test opens a reader during publication and verifies that
it reads the change exactly once. It fails on the parent commit and
passes with this change. A separate local reproduction produced
`msgID=269` with one cursor still open on the parent commit and zero
open cursors with the fix.

The [combined scale-empty run on
#1341](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/46504297800/job/142249558104)
reported the same shutdown error. Its artifact records the log path and
cursor count. The identity of the reader in that run remains unknown.

Maven verification passed with 141 changelog tests across six test
classes. The original Docker convergence scenario is covered by CI.
2 files modified
115 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/FileChangelogDB.java 45 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/server/changelog/file/FileChangelogDBTest.java 70 ●●●●● diff | view | raw | blame | history