From c4d91fab9e005179803a3ab978e8f2896a5a5b16 Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Wed, 28 Oct 2026 16:25:28 +0000
Subject: [PATCH] [#1208] Restart a directory server during the load of the replication convergence run, in rows of its own (#1233)

---
 .github/scripts/replication/lib.sh |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/.github/scripts/replication/lib.sh b/.github/scripts/replication/lib.sh
index 5cdbd49..9b9c289 100644
--- a/.github/scripts/replication/lib.sh
+++ b/.github/scripts/replication/lib.sh
@@ -18,8 +18,17 @@
 # setting comes from the environment, so that the same run goes in CI and on a laptop.
 
 TOPOLOGY=${TOPOLOGY:-rs534}
-# seconds of load
-DURATION=${DURATION:-120}
+# what disturbs the topology during the load (#1208): none, or the <name> of a disturb-<name>.sh
+# next to this script, which names the DISTURBED server and defines disturb, run during the load,
+# and settle, run after it
+DISTURBANCE=${DISTURBANCE:-none}
+# seconds of load. A disturbed run takes the load of its CI rows: a restarted server served
+# again 131 to 225 s after the restart there, and the load has to go on after that
+if [ "$DISTURBANCE" = none ]; then
+  DURATION=${DURATION:-120}
+else
+  DURATION=${DURATION:-900}
+fi
 # the most modifications, and adds or deletes, per second the load sends to each directory
 # server; a runner that cannot keep up sends fewer, which the summary shows
 LOAD_MOD_RATE=${LOAD_MOD_RATE:-423}
@@ -38,6 +47,10 @@
 QUIESCE_TIMEOUT=${QUIESCE_TIMEOUT:-900}
 # 1: write to one replica only, which the run must report (a self-test of its checks)
 INJECT_DIVERGENCE=${INJECT_DIVERGENCE:-0}
+# seconds into the load at which the disturbance starts
+DISTURB_AT=${DISTURB_AT:-$((DURATION / 3))}
+# seconds a disturbed server is given to serve again, and its join to end after the load
+DISTURB_TIMEOUT=${DISTURB_TIMEOUT:-900}
 # where the summary, the samples, the exports, the differences and a failed run's state go: a
 # directory that is new or empty
 OUT=${OUT:-$PWD/replication-out}
@@ -128,6 +141,15 @@
   [ "$(docker inspect --format='{{.State.Health.Status}}' "$1")" = healthy ]
 }
 
+# The server of the container logged that it started (msgID 135, once its connection handlers
+# listen) after the Unix time <seconds>: it serves. Not the health of the container: its probe,
+# a JVM of its own, does not get through its 30 s on a runner under load - in run 39834888428 a
+# restarted server served 7 minutes before its container was healthy again. No grep -q: it
+# would cut docker logs off, and pipefail would take that for no match
+started_since() { # <container> <seconds>
+  docker logs --since "$2" "$1" 2>&1 | grep 'category=CORE severity=NOTICE msgID=135 ' >/dev/null
+}
+
 # The background join of the image goes on once the container reports itself healthy: it adds
 # replication servers to the replication server lists while its peers register
 # (repair_replication_servers in join.sh). Ended once no bootstrap script runs any more, as

--
Gitblit v1.10.0