Switchover mechanism, for use when primary itself is doing switchover - #83
Switchover mechanism, for use when primary itself is doing switchover#83serprex wants to merge 6 commits into
Conversation
|
depends on ClickHouse/wal-rus/pull/24 |
| configured `[source] slot` name, when slot mode is on. Physical slots | ||
| are never synchronized to a standby at any PostgreSQL version; PG 17 | ||
| slot sync covers logical slots created with `failover = true` | ||
| (`src/backend/replication/logical/slotsync.c`) |
There was a problem hiding this comment.
Can we create the slot on the standby target before hand? We could make the slot on the standby all the time. We can keep the wal available on primary and standby in sync. This could help avoid wal hole problem.
There was a problem hiding this comment.
yes but then you need to report slot progress to both primary & standbys
There was a problem hiding this comment.
yes, would that be a big issue?
Implements support for changing source/destination config without restart Some issues being avoided: - boundary aligned fork needs zero crc - pre-commit restart skipping ancestor crossing, ie 1. manifest still says timeline 1, crossing commit has not happened 2. floor is start of segment containing fork, common when `C` and `F` share a segment 3. target is promoted to timeline 2 4. daemon dies after promotion while paused or waiting inside barrier 5. boot reads live history, `tli_of_segment(floor)` returns timeline 2 because descendant owns fork segment filename 6. condition accepts timeline 2 despite manifest still naming timeline 1 7. pump starts directly on timeline 2, so it never performs timeline 1 to 2
| ) | ||
| .await?; | ||
| } | ||
| if ancestor_ended { |
There was a problem hiding this comment.
nit: could be over engineering, but there's a lot of a of these state parameters, can we do something about it? like some state machine?
There was a problem hiding this comment.
added CrossingState to try clean it up a bit, but finite state machines might be a direction to explore further to get logic out of the muck. would like some more reliable barrier/invalidation management somehow
9c6311e to
f970caf
Compare
* slot in SouceConn * move code to timeline.rs/transition.rs * monitor source_system_id * add switchover info in grafana
Includes support for changing source/destination config without restart