-
- Downloads
Fixes for the case of re-creating the cluster after deletion.
- make sure that the secrets for the system users (superuser, replication) are not deleted when the main cluster is. Therefore, we can re-create the cluster, potentially forcing Patroni to restore it from the backup and enable Patroni to connect, since it will use the old password, not the newly generated random one. - when syncing users, always check whether they are already in the DB. Previously, we did this only for the sync cluster case, but the new cluster could be actually the one restored from the backup by Patroni, having all or some of the users already in place. - delete endponts last. Patroni uses the $clustername endpoint in order to store the leader related metadata. If we remove it before removing all pods, one of those pods running Patroni will re-create it and the next attempt to create the cluster with the same name will stuble on the existing endpoint. - Use db.Exec instead of db.Query for queries that expect no result. This also fixes the issue with the DB creation, since we didn't release an empty Row object it was not possible to create more than one database for a cluster.
Showing
- pkg/cluster/cluster.go 30 additions, 17 deletionspkg/cluster/cluster.go
- pkg/cluster/cluster_test.go 40 additions, 4 deletionspkg/cluster/cluster_test.go
- pkg/cluster/pg.go 2 additions, 2 deletionspkg/cluster/pg.go
- pkg/cluster/resources.go 1 addition, 1 deletionpkg/cluster/resources.go
- pkg/cluster/sync.go 8 additions, 10 deletionspkg/cluster/sync.go
- pkg/util/users/users.go 3 additions, 11 deletionspkg/util/users/users.go
Loading
Please sign in to comment