Skip to content

Reach a tenant's clusters from the control plane - #482

Merged
em3s merged 2 commits into
mainfrom
feat/control-cluster-fanout
Aug 7, 2026
Merged

em3s merged 2 commits into
mainfrom
feat/control-cluster-fanout

Conversation

@em3s

@em3s em3s commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

#480 resolved a tenant's clusters into a Topology and then stopped: baseUrl(tenant, side) and sidesFor(tenant, fanout) were written and tested with nothing calling them. This is the layer that calls them.

ClusterClient reaches the clusters of one tenant and returns one entry per side. A failing side does not fail the call. An operator asking what a tenant holds needs to know which cluster is unwell, and the healthy side's answer is still worth having — so each side comes back with either a body or its reason, in a stable order however slow either was. The cause is surfaced next to the message, because that is where the reason a connection failed actually lives.

The caller's Authorization and Actor-ROLE travel with the request: the cluster should see who is asking, not who is relaying.

Nothing mutates yet. Per the roadmap in #370, destructive execution lands after authorization.

Changes

  • Add ClusterClient and SideResponse under server/control/cluster
  • Add actionbase.control.request-timeout (default 10s) — how long one cluster may take before its side is reported as failed
  • Add GET /control/tenants/{tenant}/datastore/tables?fanout=true, merging each side's table listing

How to Test

./gradlew :server:test --tests "*ClusterClientTest*" --tests "*ControlDatastoreE2ETest*"

There is no stub-server dependency in this repo and this PR does not add one: the unit tests substitute an exchange function for the clusters, so nothing binds a port. Covered there: per-side ordering, fanout on and off, a failing side not hiding a healthy one, a non-2xx side reporting its status, the timeout, and header forwarding.

ControlDatastoreE2ETest points the topology at a closed port, which is the interesting case over http — an unreachable cluster must be reported as that side failing with a 200 overall, not as the request failing.

Notes

A CONTROL instance refuses /graph/v2, /graph/v3 and /queue/v1 on itself, so it cannot be its own data plane. That rules out the tempting shortcut of pointing a test's active-url at its own port.

AI Assistance

  • This PR was written largely with AI assistance.
    • Tool / model: Claude Code (Opus 5)

The topology resolved in #480 had no caller: baseUrl and sidesFor were
written and tested but nothing used them. This is the layer that does.

A side that fails does not fail the call. An operator asking what a
tenant holds needs to know which cluster is unwell, and the healthy
side's answer is still worth having - so each side comes back with either
a body or its reason, in a stable order however slow either was. The
cause is surfaced next to the message, since that is where the reason a
connection failed actually lives.

The caller's Authorization and Actor-ROLE travel with the request: the
cluster should see who is asking, not who is relaying.

GET /control/tenants/{tenant}/datastore/tables proves it end to end.
Nothing mutates yet.

Part of #370

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Aug 6, 2026
The topology examples and test fixtures used kc and talk, which name real products. Nothing depends
on the values, so they become alpha and beta.

Unrelated: the kc.graph.* config prefix stays as it is. That one is load-bearing and renaming it
would break every existing deployment's config.
@em3s

em3s commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Optimistic

@em3s
em3s merged commit f77517d into main Aug 7, 2026
2 checks passed
@em3s
em3s deleted the feat/control-cluster-fanout branch August 7, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant