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

Valery Kharseko
3 hours ago 3a13fe291b53c7e6c784169ac77d5f3ea26ea577
Recognize recovered startup timeouts on rolling replication servers (#1354)

The `rs534 / scale-rs-kept` job rejected a startup timeout on `cv-r0`
after the replicas had converged. The directory server for `cn=admin
data` timed out at 15:46:32 UTC and reconnected to the local replication
server two seconds later. [Failing CI
job](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/46664379397/job/142757452997#step:6)

During a rolling restart, `scale_roll_pair` collected evidence of
recovery for the two directory nodes only. It now checks the replication
node's own administrative domains when its join completes. The
regression test exercises the full rolling-pair path and verifies that a
recovered admin-domain timeout is accepted while a schema-domain timeout
without a matching reconnect still fails.

## Verification

- The new regression test failed on the base commit and passed with this
change.
- Replaying the archived `cv-r0` error log through the corrected
rolling-pair path recognized the reconnect for the single rejected
timeout at line 206.
- All 27 self-test scripts from the convergence workflow step passed on
Ubuntu 26.04.
2 files modified
25 ■■■■■ changed files
.github/scripts/replication/disturb-scale.sh 5 ●●●●● patch | view | raw | blame | history
.github/scripts/replication/selftest-disturb-scale.sh 20 ●●●●● patch | view | raw | blame | history
.github/scripts/replication/disturb-scale.sh
@@ -498,7 +498,7 @@
# may finish after CORE135; only timeouts before that startup marker are candidates.
# Admin/schema domains have their own DS IDs; another live RS may win the retry.
# Keep the full error as evidence so another record cannot inherit the allowance.
scale_record_reconnected_timeouts() { # <DS> <rolling RS> <direction>
scale_record_reconnected_timeouts() { # <restarted node> <rolling RS> <direction>
  local node=$1 direction=$3 window="$OUT/logs/$1.window-$3-$1"
  local before after mark candidate address addresses= target="$OUT/scale-progress/timeouts-$3-$1.txt"
  [ -f "$window" ] && [ -f "$OUT/logs/$node.mark" ] || return 0
@@ -662,8 +662,7 @@
  # Startup opens LDAP before the background join has finished its administrative
  # JVMs. Keep this group paused until every join succeeds, while the other DSs keep
  # writing. This also completes the group before the next surviving writer rolls.
  scale_wait "the join of $rolling_rs ends" bootstrap_ended "$rolling_rs" || return 1
  for node in "$first" "$second"; do
  for node in "$rolling_rs" "$first" "$second"; do
    scale_wait "the join of $node ends" bootstrap_ended "$node" || return 1
    scale_record_reconnected_timeouts "$node" "$rolling_rs" "$direction" || return 1
  done
.github/scripts/replication/selftest-disturb-scale.sh
@@ -552,6 +552,26 @@
    grep -Fx 'dn: uid=scale-down-r0,ou=People,dc=example,dc=com' "$OUT/probe.ldif" >/dev/null || { echo 'batch lacks the RS write' >&2; exit 1; }
    if (FAIL_PROBE=1; scale_probe_batch d2 up d0 d1 r0); then echo 'failed batch accepted' >&2; exit 1; fi
  fi
  # A dedicated RS also runs a DS for its administrative domains.
  if [ "$topology-$mode" = rs534-kept ]; then (
    . "$HERE/assert-converged.sh"
    OUT="$OUT/rs-startup"; mkdir -p "$OUT/logs"
    for n in $ALL_NODES; do : >"$OUT/$n.log"; done
    errors_lines() { wc -l <"$OUT/$1.log"; }
    since_mark() { cat "$OUT/$1.log"; }
    printf '0\n' >"$OUT/logs/r0.mark"
    local timeout='[t] category=SYNC severity=ERROR msgID=212 msg=Directory server DS(17231) timed out while connecting to replication server r0:8989 for domain "cn=admin data"'
    local unrecovered=${timeout/cn=admin data/cn=schema}
    start_server() {
      [ "$1" = r0 ] || return 0
      printf '%s\n' "$timeout" "$unrecovered" \
        '[t] category=CORE severity=NOTICE msgID=135 msg=The Directory Server has started successfully' \
        '[t] category=SYNC severity=NOTICE msgID=62 msg=Directory server DS(17231) has connected to replication server RS(32517) for domain "cn=admin data" at 172.18.0.18:8989 with generation ID 154864' >>"$OUT/r0.log"
    }
    bootstrap_ended() { return 0; }
    scale_roll_pair d0 d1 "$FULL_PEERS" r0
    [ "$(replication_errors r0)" = "$unrecovered" ] || { echo 'expected only the unrecovered RS startup timeout' >&2; exit 1; }
  ); fi
)
check_checkpoint_budget() ( # <load end> <caught up at> <expected result> <expected time> [route change at]
  local caught_up_at=$2 switch_at=${5:-} result=0