Skip to content

Commit 951f023

Browse files
waleedlatif1claude
andcommitted
fix: address the seventh review round
- "`statement_timeout` is 0, so a long migration is never cut off" was absolute, and `0076_damp_vector.sql` disproves it — it sets 180s locally. It is the session default now, with the override named. - The migration-log command hard-coded the production Compose file, so a source-built or Ollama install would have inspected the wrong stack. - The Compose rollback applied `SIM_VERSION` to every install, but the local and Ollama stacks build from source and ignore it. Those now get the checkout-and-rebuild path. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015BwsJTEQRzWJaY4BRCkPZt
1 parent 1daf58e commit 951f023

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

apps/docs/content/docs/platform/self-hosting/upgrades.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Behavior that is fixed in the migrator and not configurable, but that explains w
103103
| Behavior | Value |
104104
|---|---|
105105
| Advisory-lock acquire deadline | 30 minutes, retried every 5s |
106-
| `lock_timeout` on the migration session | 5 seconds for ordinary DDL — a statement that waits longer fails with SQLSTATE `55P03`. An individual migration can set it to `0` for statements that must not be interrupted, such as `CREATE INDEX CONCURRENTLY`. `statement_timeout` is `0` on the same session, so a long migration is never cut off once it holds its locks |
106+
| `lock_timeout` on the migration session | 5 seconds for ordinary DDL — a statement that waits longer fails with SQLSTATE `55P03`. An individual migration can set it to `0` for statements that must not be interrupted, such as `CREATE INDEX CONCURRENTLY`. `statement_timeout` is `0` on the same session by default, so a long migration is not cut off once it holds its locks — though a migration can narrow it for its own statements, as `0076_damp_vector.sql` does with a 180-second local setting |
107107
| SQL migration retry attempts | 8, with exponential backoff and jitter, and only for a lock timeout (`55P03`). Script (data) migrations run once — a failure there exits immediately |
108108
| Connection attempts at startup | 10, for transient failures — `53300` (`too_many_connections`), `53400`, the `08xxx` connection-exception class, and socket-level errors such as `ECONNREFUSED`, `ECONNRESET`, `ETIMEDOUT`, `EHOSTUNREACH`, and `ENOTFOUND`. A database that is simply down is retried with backoff, not failed immediately |
109109

@@ -179,7 +179,10 @@ kubectl logs -n simstudio deploy/sim-app -c migrations --tail=100
179179

180180
```bash
181181
npx sim-setup update
182-
docker compose -f docker-compose.prod.yml logs migrations
182+
# The file that started your install — docker-compose.local.yml for a
183+
# source-built stack, docker-compose.ollama.yml for the Ollama one.
184+
COMPOSE_FILE=docker-compose.prod.yml
185+
docker compose -f "$COMPOSE_FILE" logs migrations
183186
```
184187

185188
`npx sim-setup update` obtains the new images, then brings the stack up with
@@ -262,12 +265,19 @@ helm rollback sim -n simstudio
262265
```
263266

264267
```bash
265-
# Docker Compose — edit .env so the pin persists, then restart.
268+
# Production Compose — edit .env so the pin persists, then restart.
266269
# Substitute the previous release tag from the releases page.
267270
echo "SIM_VERSION=<previous-release-tag>" >> .env
268271
docker compose -f docker-compose.prod.yml up -d
269272
```
270273

274+
The local and Ollama stacks build the app from source and ignore `SIM_VERSION`, so roll those back by checking out the previous tag and rebuilding with the file — and, for the Ollama stack, the profile — that started the install:
275+
276+
```bash
277+
git checkout <previous-release-tag>
278+
docker compose -f docker-compose.local.yml up -d --build
279+
```
280+
271281
**Rollback after a schema change** requires restoring the database to the pre-upgrade backup, because migrations are forward-only:
272282

273283
1. Scale the app to zero.

0 commit comments

Comments
 (0)