fix(task): preserve task-owned worktrees across session deletion (#2456)
This commit is contained in:
@@ -228,6 +228,14 @@ pg_dump --host "$PGHOST" --port "${PGPORT:-5432}" \
|
||||
"${PGDATABASE:-kandev}"
|
||||
```
|
||||
|
||||
Some releases perform a one-time schema cutover that rewrites ownership tables and drops legacy schema (for example the task-worktree ownership normalization). Before such an upgrade:
|
||||
|
||||
1. Take and **verify** a backup. For PostgreSQL use the pattern above. For SQLite, create a manual snapshot from **Settings > System > Backups** (or `sqlite3` `VACUUM INTO`) and verify it: the automatic pre-migration snapshot is taken during startup of the new binary, so it cannot be verified before the upgrade starts.
|
||||
2. Stop all backend writers during the cutover. Do not run a mixed-version fleet across the upgrade; the migration takes a database advisory lock and aborts on lock timeout without changing the schema or data.
|
||||
3. Let exactly one schema initializer run and reach a healthy state before starting additional instances.
|
||||
|
||||
The normalized schema is intentionally incompatible with older binaries. To downgrade, stop all instances and restore the pre-upgrade backup — never start an older binary against a post-cutover database. SQLite restores from its automatic pre-migration snapshot; PostgreSQL restores your verified `pg_dump` backup.
|
||||
|
||||
Switching `database.driver` does not migrate data. PostgreSQL and shared NATS remove two single-process data constraints, but they do not make Kandev horizontally scalable: WebSocket subscriptions, execution lifecycle/control state, and task workspaces remain process- or filesystem-local. The current product and supplied deployment validate one backend replica only; do not add replicas based on the database and event bus alone.
|
||||
|
||||
</details>
|
||||
|
||||
Reference in New Issue
Block a user