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

Only pg_rewind against master DBs #698

Conversation

lawrencejones
Copy link
Contributor

pg_rewind does not support executing against standby nodes. While stolon
doesn't yet support cascading replication, it will never be correct to
run pg_rewind against any node other than the primary.

By making this change now, we future proof stolon and enable any forks
(such as gocardless/stolon) to configure a cascading replication setup
without issue.

pg_rewind does not support executing against standby nodes. While stolon
doesn't yet support cascading replication, it will never be correct to
run pg_rewind against any node other than the primary.

By making this change now, we future proof stolon and enable any forks
(such as gocardless/stolon) to configure a cascading replication setup
without issue.
@lawrencejones
Copy link
Contributor Author

@sgotti we hit this problem in our fork, where we have a setup that permits cascading replication. In our setup, we have this:

===== Keepers/DB tree =====

stolon_production_0 (master)
└─stolon_production_1 (sync)
  ├─stolon_async_production_0 (async)
  └─stolon_production_2 (async)

Which works great, except when either of stolon_async_production_0 or stolon_production_2 attempt to resync against stolon_production_1, where pg_rewind will fail as it cannot create the necessary temporary tables.

I don't think the addition of this logic is overly burdensome for upstream, prepares us for when we do get round to upstreaming a cascading replication setup (sometime soon I hope!) and prevents anyone from hitting this stumbling block in future.

Depending on your feedback we can either leave this closed until we need it, or get this merged in upstream. We'd appreciate it in upstream as it makes it easier to manage the changes, but I'd understand if you prefer to leave this out for now.

@sgotti
Copy link
Member

sgotti commented Oct 8, 2019

@lawrencejones Thanks! LGTM. Is this ready to be merged?

@lawrencejones
Copy link
Contributor Author

Yup! Let's do it.

@lawrencejones lawrencejones merged commit 6001857 into sorintlab:master Oct 8, 2019
@lawrencejones lawrencejones deleted the lawrence-only-rewind-against-master branch October 8, 2019 16:57
@sgotti sgotti added this to the v0.15.0 milestone Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants