Skip to content

Follow-ups from #6221: a self-poisoning membership test, an unmeasured timeout, an invisible address ambiguity, and two cleanups #6267

Closed

Description

@lvca

Five findings from #6221 / PR #6226, filed together because they are all small and share an origin. Split any of them out if you would rather track them separately - only item 1 is a defect, the rest are a measurement to collect, an observability gap, a cleanup, and a docs update.

1. DynamicMembershipTest poisons the cluster it shares, so a different method fails on every run

DynamicMembershipTest (ha-raft/src/test/java/com/arcadedb/server/ha/raft/DynamicMembershipTest.java) runs its methods against one 3-node cluster and removes peers from it without putting them back:

  • removePeerDecreasesClusterSize (:50) removes a non-leader and asserts 2 live peers.
  • removePeerRefusedWhenItWouldBreakQuorum (:66) opens with assertThat(raftServer.getLivePeers()).hasSize(3) (:71), then removes one, then force-removes another, leaving 1.
  • getLivePeersReturnsAllConfiguredPeers (:40) asserts 3, and registerPeerDisplayNameUpdatesExistingPeer (:114) reads the peer set as well.

So every method here both depends on the peer set and mutates it, and JUnit's method order decides which one loses. Three runs on my machine produced three different failures, one of them on pristine main at d75174c92 with no local changes, which is what rules out the PR that found it:

DynamicMembershipTest.removePeerRefusedWhenItWouldBreakQuorum:68  (expected 3 live peers)
DynamicMembershipTest.registerPeerDisplayNameUpdatesExistingPeer:116
DynamicMembershipTest > endTest > checkDatabasesAreIdentical: DatabaseAreNotIdentical Types: DB1 5 <> DB2 15

The third is the interesting one: a class that ends with a 1-peer cluster fails the base class's endTest consistency check, which is a failure attributed to whatever ran last rather than to the test that removed the peers.

Suggested fix: give the membership tests a per-method cluster (or re-add the removed peers in an @AfterEach), and @Order them only if the shared-cluster shape has to stay. This is very likely contributing to the chronic ha-integration-tests redness of #5668 / #5702 - it is a deterministic failure whose visibility depends on ordering, not a timing flake, so it will keep costing that lane signal until the shared state is fixed.

2. Collect the RESYNC_RETRY_TIMEOUT_MS measurement, then lower it

BaseRaftHATest.RESYNC_RETRY_TIMEOUT_MS (:66) is still 120 s. #6221 asked whether it could come down now that notifyInstallSnapshotFromLeader has its own executor, and #6226 deliberately did not lower it: a green run of a chronically red lane proves nothing, and a budget nothing exhausts leaves no trace of how much of it was needed.

The instrument is in place now - reportSlowWait (:473) logs what a wait actually cost whenever it exceeds SLOW_WAIT_REPORT_MS (:68, 10 s), for both withResyncRetry and awaitValue. This item is the other half: read a handful of ha-integration-tests runs, find the worst real wait, and set the budget from it. If no run ever reports a line, the 120 s has never been needed and can drop to something that fails fast.

3. Nothing tells an operator that their peer addresses identify nobody

getUnambiguousPeerHttpAddress / getUnambiguousPeerHttpsAddress withhold silently (RaftHAServer:1927): they return null and every caller decides for itself whether to say anything. The refusal is therefore visible only where a caller happens to log it - the snapshot paths log a WARNING per attempt, the verify endpoint reports it per peer - and invisible everywhere else.

The one warning that does exist does not cover this. deriveHttpAddressWithWarning / deriveHttpsAddressWithWarning (RaftHAServer:2050, :2082) fire once per JVM whenever an address is derived at all, which is also what a perfectly healthy homogeneous Kubernetes StatefulSet does, so it cannot distinguish "deriving, and fine" from "deriving, and two peers just collapsed onto one address". warnAmbiguousRouting (:1931) does exactly the right thing - once per protocol, naming the config field to write - but only for the client routing tables of #6183, not for the peer-to-peer endpoints.

Two suggestions, in order of value:

  • a one-time WARNING when a peer-to-peer address is withheld, modelled on warnAmbiguousRouting: which peers could not be told apart, and the host:{raft:..,http:..} syntax that fixes it;
  • surface it in cluster status. GetClusterHandler:253/:258 and RaftClusterStatusExporter:85 report the raw best-effort addresses, so on a misconfigured cluster the status endpoint and the Studio HA panel display an address for every peer with nothing to say that it identifies none of them. A flag per peer (or simply reporting the unambiguous address, with null where there is none) would make the misconfiguration visible before anyone runs a verify.

4. Seven now-redundant awaits around findLeaderIndex()

findLeaderIndex() (BaseRaftHATest:323) waits up to LEADER_ELECTION_TIMEOUT_MS (:74) for an election since #6226; it used to sample once and answer -1 the instant it was called during a leaderless window. Seven call sites had worked around that by hand and can now drop the wrapper:

RaftTimeSeriesReplication3NodesIT:74, :113, :180, :234
SuperNodeAppendHAConsistencyIT:65
RaftTimeSeriesOversizedSealedIT:69
SuperNodeConcurrentAppendHABenchmark:106

Pure cleanup - they are correct as they stand, just saying twice what the helper now says once.

5. Docs: two API-visible changes from #6226

Both are already in docs/release-26.9.1.md and in the OpenAPI spec, but the arcadedb-docs HTTP API reference has not caught up:

  • retries in the POST /api/v1/command (and every auto-committing endpoint's) payload now defaults to arcadedb.txRetries (3) instead of a hard-coded 1. Worth documenting alongside the caveat: only NeedRetryException/DuplicatedKeyException are retried, always after a rollback, but a SQL/JS function with a side effect outside the database can now run more than once per request.
  • POST /api/v1/cluster/verify/{database} has a third overallStatus value, VERIFICATION_INCOMPLETE, for "no divergence observed, but at least one peer could not be verified". Alerting that keys on != ALL_CONSISTENT is unaffected; alerting that keys on INCONSISTENCY_DETECTED specifically needs to add it to keep catching an unreachable node.

Activity

  1. self-assigned this
    on Aug 16, 2026
  2. added this to the 26.9.1 milestone on Aug 16, 2026
  3. added 4 commits that reference this issue on Aug 17, 2026
  4. added a commit that references this issue on Aug 17, 2026
  5. added theissue type on Aug 17, 2026
  6. added 3 commits that reference this issue on Aug 17, 2026
  7. added a commit that references this issue on Aug 27, 2026
  8. added
    ha
    on Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugha

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions