fix(replicas): never REFRESH with copy_data=true after a data copy

A second logical copy unique-conflicts on existing PKs and leaves
tablesync workers stuck, so live UPDATEs never apply on slaves.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-18 15:45:25 +03:30
co-authored by Cursor
parent d055c50b94
commit 810d1672a5
3 changed files with 8 additions and 6 deletions
+3 -2
View File
@@ -159,8 +159,9 @@ repair script re-applies grants. `REPLICA_DSNS` must connect as a role that can
`deploy/replicas.env` exists on that host.
Keep migrations schema-only. After each migrate, subscribers get
`ALTER SUBSCRIPTION … REFRESH PUBLICATION WITH (copy_data = true)` so **new
tables** join replication (Postgres does not add them by itself).
`ALTER SUBSCRIPTION … REFRESH PUBLICATION WITH (copy_data = false)` so **new
tables** join the subscription without a second full copy (repair already
copied rows; a second copy unique-conflicts and stalls live UPDATEs).
## 9) Data changes **without** deploy (import settings, edit tenant, …)