From 13d57e063cbd3e884f787744a9eaedbfb98b5a51 Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Fri, 11 Sep 2026 13:19:34 +0000
Subject: [PATCH] [#949] Report a ReplicaOfflineMsg the broker refused as not sent (#976)

---
 opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java
index 879bfb4..e2babe2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java
@@ -3696,15 +3696,25 @@
    * {@link #processUpdate(UpdateMsg)} message.
    *
    * @param msg The UpdateMsg that should be published.
+   * @return {@code true} if the message was written to the session of the
+   *         Replication Service, {@code false} if the broker could not write
+   *         it: it has no usable session, the changes which come before this
+   *         one still have to be republished, or it was stopped in between.
    */
-  public void publish(UpdateMsg msg)
+  public boolean publish(UpdateMsg msg)
   {
-    broker.publish(msg);
+    final boolean published = broker.publish(msg, true);
+    /*
+     * The domain state is updated whether or not the message was written: it says which changes
+     * this replica has done, and it is by finding it ahead of the state its replication server
+     * reports that the next session knows which changes to republish.
+     */
     if (msg.contributesToDomainState())
     {
       state.update(msg.getCSN());
     }
     numSentUpdates.incrementAndGet();
+    return published;
   }
 
   /**

--
Gitblit v1.10.0