Skip to content

Commit 0af14d4

Browse files
committed
feat(server): count supervisor session redirects and off-ring admissions
Consistent-hash placement only logged its redirects, so operators had no way to see how often replicas redirect supervisors or whether supervisors end up where the ring places them. The gateway now counts each SessionRedirect it sends, labeled by the step that sent it: connect when it answers a connecting supervisor, or shutdown once a stopping replica has queued a handoff on an open session. It also counts redirected supervisors it admits although its own ring names another owner, once the session's acceptance is durable, so a cancelled connect cannot lose the count. Under supervisor_topology: gateway the shared supervisor's host moves pool sessions itself, so a redirected hello there is the designed state, not ring disagreement. Those gateways export no off-ring series at all and never read the ring on the connect path. Both counters start at zero and carry no sandbox or replica IDs. The gateway metrics page, the HA guide, and the debug skill document what the counters cannot see under the shared topology. Signed-off-by: Emilien Macchi <emacchi@redhat.com>
1 parent dbc0517 commit 0af14d4

7 files changed

Lines changed: 830 additions & 142 deletions

File tree

‎crates/openshell-server/src/compute/mod.rs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,14 @@ impl ComputeRuntime {
10771077
self.supervisor_host.as_ref()
10781078
}
10791079

1080+
/// Whether this gateway places supervisor sessions by the placement ring. A gateway
1081+
/// coordinating a shared supervisor does not: the host moves those sessions, so a
1082+
/// redirected hello is not an off-ring admission there and the counter is not exported.
1083+
#[must_use]
1084+
pub fn places_supervisor_sessions_by_ring(&self) -> bool {
1085+
self.supervisor_host().is_none()
1086+
}
1087+
10801088
pub(crate) fn configure_ssh_identities(
10811089
&self,
10821090
credentials: crate::credentials::CredentialRuntime,

0 commit comments

Comments
 (0)