Commit 2b12e65
authored
Gateway state sync mechanism (#4135)
Introduce a way to reconcile gateway replica state
based on the current list of services. This allows
newly started or newly recovered gateway replicas
to learn about existing services. It also improves
fault tolerance, since an unavailable gateway
replica no longer blocks the service lifecycle -
services and service replicas can still be
registered on the remaining healthy gateway
replicas.
Behavioral details:
- Run submission no longer waits for service
registration before the run starts provisioning.
This has both advantages (provisioning and
service registration can happen in parallel) and
disadvantages (compute may be provisioned for a
service that will be terminated a moment later
due to a registration error). This behavior may
be revised in the future.
- A service or a service replica is terminated
with the `gateway_error` termination reason if
it failed to be registered on all gateway
replicas.
- If registration succeeded at least on one
gateway replica, registration on the remaining
gateway replicas will be retried indefinitely.
- Rolling deployments only proceed with
terminating a service replica once the
replacement replica is successfully registered
on all gateway replicas.
- Registration and unregistration tracking,
including per-gateway-replica registration error
messages, is available in events.1 parent 68dc344 commit 2b12e65
22 files changed
Lines changed: 3838 additions & 672 deletions
File tree
- mkdocs/docs/concepts
- src
- dstack/_internal
- core/models
- server
- background/pipeline_tasks
- runs
- migrations/versions/2026
- services
- gateways
- runs
- services
- tests/_internal/server
- background/pipeline_tasks
- test_runs
- routers
- services/services
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
178 | 177 | | |
179 | 178 | | |
180 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| 111 | + | |
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
| |||
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| 123 | + | |
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| |||
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
| 132 | + | |
| 133 | + | |
129 | 134 | | |
130 | 135 | | |
131 | 136 | | |
| |||
0 commit comments