From 661dc06886df4738b9add2206a39d74d7dedf476 Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Thu, 10 Sep 2026 11:57:37 +0000
Subject: [PATCH] [#908] Wait for the changes being applied before a domain going down saves its ServerState (#945)

---
 opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationDomain.java |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 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 03f5309..c9d7781 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
@@ -2736,6 +2736,24 @@
   }
 
   /**
+   * Returns a boolean indicating if a total update <em>into</em> this replica is currently
+   * processed, that is an import which is replacing the data of this domain.
+   * <p>
+   * The other direction, an export which is initializing another replica from this one,
+   * leaves the data of this domain and its ServerState alone: it is reported by
+   * {@link #ieRunning()} just the same, so anything which is guarding against the data
+   * being replaced has to ask this rather than that.
+   *
+   * @return {@code true} when an import is being processed, {@code false} when nothing is
+   *         or when what is being processed is an export
+   */
+  protected boolean importInProgress()
+  {
+    final ImportExportContext ieCtx = importExportContext.get();
+    return ieCtx != null && ieCtx.importInProgress();
+  }
+
+  /**
    * Check the value of the Replication Servers generation ID.
    *
    * @param generationID        The expected value of the generation ID.

--
Gitblit v1.10.0