You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1706883
Browse filesBrowse the repository at this point in the historyBrowse files
Allow remote-config to be generated from a standby
`kubectl dba remote-config` creates the replication user on the source
before rendering the AppBinding and secrets, and that step needs a
writable primary: CREATE ROLE / ALTER ROLE / GRANT are catalog writes a
hot standby rejects.
There are sources with no primary to exec into. A remote replica acting
as the source of a chained replica is the clearest case: every member is
a standby, and the replication role is already there anyway, carried
over by physical WAL replication. Creating it is impossible and also
unnecessary.
Nothing in the generated config is primary-specific - the host comes
from -d, the port from --port, the secret is synthesised and the client
certificate's CN is the username - so only the side effect is coupled to
the primary, not the artifact.
Add --skip-user-creation, which leaves the source catalog alone and
takes the given password at face value. It also drops the
`status.phase == Ready` gate, since rendering manifests only reads the
CR and a degraded source is exactly when a DR config is wanted.
The role is still verified where possible: reading pg_roles (mysql.user
for MySQL) works on a standby, so a missing role or one lacking the
REPLICATION attribute fails with the SQL to run by hand, while an
unreachable database only warns.
Also fixes pod lookup, which returned nil - reported as success - when
no pod matched, so the command wrote an auth secret for a user it never
created and exited 0. It now fails with an actionable message, and skips
pods that do not run the database container, such as the Postgres
arbiter.
Signed-off-by: souravbiswassanto <saurov@appscode.com>
0 commit comments