Class ClusterFanIn
verify/retrieve.
MockServer's event log is per-node: the shared StateBackend replicates
expectations, scenario state, CRUD entities, and blobs across the fleet, but NOT
request/response log entries. Behind a load balancer that means a verify()
or retrieve(REQUESTS/REQUEST_RESPONSES) on one node sees only the traffic
that reached THAT node — a silent correctness trap for the HA feature.
When enabled (clusterVerifyFanIn=true plus a non-empty
clusterVerifyFanInPeers list), this coordinator queries each configured
peer's LOCAL log via a ClusterFanIn.PeerAccessor and concatenates the results, so the
caller can merge them with the local log and evaluate against the fleet-wide total.
Non-recursion: the ClusterFanIn.PeerAccessor issues each peer request with a
"local-only" marker so the peer serves from its own log without fanning out again.
Unreachable peers (fail-closed): this coordinator does NOT drop unreachable
peers silently. It reports which peers failed via ClusterFanIn.FanInResult.unreachablePeers();
callers treat any unreachable peer as a failure rather than returning a partial (and
therefore potentially wrong) verify/retrieve result. This is the safer default: for an
atMost/exactly verification, silently missing a peer's traffic could turn
a real violation into a false pass.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe merged remote results plus the list of peers that could not be reached.static interfaceQueries a single peer's LOCAL log. -
Constructor Summary
ConstructorsConstructorDescriptionClusterFanIn(Configuration configuration, MockServerLogger mockServerLogger, ClusterFanIn.PeerAccessor peerAccessor) -
Method Summary
Modifier and TypeMethodDescriptionbooleanenabled()Fan-in is active only when explicitly enabled AND at least one peer is configured.Query every peer's LOCAL matching request-response pairs and concatenate them.fanInRequests(RequestDefinition filter) Query every peer's LOCAL matching requests and concatenate them.peers()The configured peer control-plane base URLs (this node excluded), parsed from the comma-separatedclusterVerifyFanInPeersproperty.
-
Constructor Details
-
ClusterFanIn
public ClusterFanIn(Configuration configuration, MockServerLogger mockServerLogger, ClusterFanIn.PeerAccessor peerAccessor)
-
-
Method Details
-
enabled
public boolean enabled()Fan-in is active only when explicitly enabled AND at least one peer is configured. When enabled with no peers it is a safe no-op (single-node behaviour preserved). -
peers
The configured peer control-plane base URLs (this node excluded), parsed from the comma-separatedclusterVerifyFanInPeersproperty. Blank entries are dropped. -
fanInRequests
Query every peer's LOCAL matching requests and concatenate them. The returned list is remote-only (the caller merges with its local log). Unreachable peers are reported (never silently dropped). -
fanInRequestResponses
public ClusterFanIn.FanInResult<List<LogEventRequestAndResponse>> fanInRequestResponses(RequestDefinition filter) Query every peer's LOCAL matching request-response pairs and concatenate them.
-