Skip to content

Add in-place update for gateway replicas - #4014

Merged
jvstme merged 12 commits into
masterfrom
issue_3959_gateway_scaling
Jul 27, 2026
Merged

Add in-place update for gateway replicas#4014
jvstme merged 12 commits into
masterfrom
issue_3959_gateway_scaling

Conversation

@jvstme

@jvstme jvstme commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Support scaling gateways via in-place update of
the replicas configuration property. For now,
this feature is only intended for internal testing
and is hidden behind the GATEWAY_SCALING flag,
since it has limited applicability at the current
stage — without a state sync mechanism, newly
started gateway replicas are not aware of existing
services.

#3959

Support scaling gateways via in-place update of
the `replicas` configuration property. For now,
this feature is only intended for internal testing
and is hidden behind the `GATEWAY_SCALING` flag,
since it has limited applicability at the current
stage — without a state sync mechanism, newly
started gateway replicas are not aware of existing
services.
@jvstme
jvstme requested a review from r4victor July 8, 2026 22:29
Comment thread src/dstack/_internal/server/background/pipeline_tasks/gateways.py Outdated
Comment thread src/dstack/_internal/server/background/pipeline_tasks/gateways.py
Comment thread src/dstack/_internal/utils/common.py Outdated
jvstme added 2 commits July 17, 2026 09:12
For `running` gateways, do at most 15 scale out
attempts with backoff. Submitting a new in-place
update resets the attempt counter.
@jvstme
jvstme requested a review from r4victor July 20, 2026 23:07
Comment on lines +21 to +28
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("gateway_computes", schema=None) as batch_op:
batch_op.add_column(
sa.Column("scale_in", sa.Boolean(), server_default=sa.false(), nullable=False)
)

with op.batch_alter_table("gateways", schema=None) as batch_op:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Altering multiple tables should be done in separate transactions (migrations). See

### Altering multiple tables

@jvstme
jvstme merged commit b5ff898 into master Jul 27, 2026
24 checks passed
@jvstme
jvstme deleted the issue_3959_gateway_scaling branch July 27, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants