Repository navigation
Conversation
…lica A shared supervisor pool sandbox's session now goes to the gateway replica serving its owning member's stream, instead of the replica the ring picks by sandbox ID. Each pool reconciliation pass publishes the sandbox-to-replica map; sessions fall back to the ring when the parent is unknown, not a live peer, or this replica is shutting down. Signed-off-by: divesh <dgude@nvidia.com>
A pool sandbox session served by a replica other than the one serving its owning member is redirected there on its next heartbeat, reusing the shutdown handoff so the sandbox stays Ready. This re-homes sessions left on the wrong replica by a rolling restart. Signed-off-by: divesh <dgude@nvidia.com>
Removes the per-sandbox parent map and the heartbeat relocation; pool sessions will dial their supervisor's gateway directly instead. Signed-off-by: divesh <dgude@nvidia.com>
…plica HostAccepted now carries the accepting replica's peer endpoint. A shared host's sandbox sessions dial it directly, so each session runs on the replica serving its supervisor. A stopping replica sheds its host streams, and redirected sessions follow the host to its next replica. Closes #5051. Signed-off-by: divesh <dgude@nvidia.com>
…ailover Add the shared-supervisor-tree lane: two gateway replicas on PostgreSQL with a two-member supervisor pool. After start, a gateway crash, a gateway rolling restart, and a supervisor crash, every pool sandbox's session runs on the replica serving its supervisor and exec reaches every sandbox. Signed-off-by: divesh <dgude@nvidia.com>
68a5a70 to
efda3de
Compare
|
🌿 Preview your docs: https://nvidia-preview-pr-5052.docs.buildwithfern.com/openshell |
|
Established sandbox sessions do not follow a host that reconnects elsewhere. Before this PR, session placement followed the hash ring independently of the host. This PR colocates sessions initially, but reads This can happen during normal supervisor-token expiry: the gateway closes the host's assignment stream, and the host reconnects through the Service, potentially landing on another replica. Existing sandbox sessions remain on the previous gateway indefinitely, breaking the promised tree topology. Please watch for home changes while a session is active and reconnect when a different nonempty endpoint arrives. Add coverage that moves only the host stream while keeping sandbox sessions healthy; the new gateway crash/restart tests close both and miss this case. Validation: reviewed the full diff and surrounding lifecycle code; did not run tests locally. |
|
Can we fold this coverage into |
…es gateway A host whose stream ends, for example when its supervisor token expires, can reattach to another replica. Its sandbox sessions now watch for that and reconnect to the host's new replica instead of staying on the old one. Signed-off-by: divesh <dgude@nvidia.com>
…-ha lane Run the shared-supervisor-ha lane with two gateway replicas on PostgreSQL and move the gateway crash, rolling restart, and supervisor crash colocation test into it, replacing the separate shared-supervisor-tree lane. Signed-off-by: divesh <dgude@nvidia.com>
…ream ends A host's stream ends routinely, for example when its supervisor token expires. Redialing the replica that accepted it, before falling back to the Service, keeps the host and its sandbox sessions on that replica instead of moving them all on every reconnect. Signed-off-by: divesh <dgude@nvidia.com>
Good find, this is actually much bigger than I thought. I didn't know the host stream gets closed on every token expiry, so hosts were hopping gateways and leaving their sessions behind. Fixed it two ways: the host now redials the same gateway first, so nothing moves in the normal case, and sessions follow the host if it does end up somewhere else. Tested on k3d with short tokens, hosts stayed put across expiries. |
@drew done. |
Summary
Each pool sandbox session dials the gateway replica that serves its supervisor, so a sandbox and its parent supervisor always share a gateway.
Closes #5051
Changes
HostAcceptedcarries the accepting replica's peer endpoint.redirected=true, so the replica serves them locally). They wait up to 5 s for it after a host reconnect.e2e:kubernetes:shared-supervisor-hanow runs two gateway replicas on PostgreSQL and checks colocation through gateway and supervisor failures.Testing
openshell-supervisor-control,openshell-supervisor-process,openshell-supervisor,openshell-server