Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To create a stolonctl demote sub-command #882

Open
viggy28 opened this issue Jul 29, 2022 · 0 comments
Open

To create a stolonctl demote sub-command #882

viggy28 opened this issue Jul 29, 2022 · 0 comments

Comments

@viggy28
Copy link

viggy28 commented Jul 29, 2022

What would you like to be added:

stolon can promote a standby cluster to a primary cluster. However, it can't demote a primary cluster to become a standby cluster.

Why is this needed:

Currently, only way is to rebuild the cluster (correct me if I am wrong). It's not efficient. Imagine rebuilding a cluster of 10TB size. It can take multiple hours.

Rough idea on how to implement:

On the failed cluster,

  1. stop the keepers, sentinels, proxies
  2. update cluster.Spec.Role to standby and primary db's db.Spec.Role to standby
  3. create a recovery.conf file only on the primary. Not sure whether we need to populate the content in it. If needed we can do that using standbyConfig.standbySettings.primaryConninfo
  4. remove postgresql.auto.conf file on the primary
  5. run pg_rewind on the all Postgres severs (primary and replica too - in case they are ahead)

Let me know your thoughts @sgotti

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant