Repository navigation
feat: introduce controlled switchover of a replica cluster - #4411
Conversation
|
❗ By default, the pull request is configured to backport to all release branches.
|
|
/test limit=local |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/8907157613 |
|
/test limit=local |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/8970292966 |
|
/test limit=local |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/8981364872 |
|
/test limit=local |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/8981390629 |
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Co-authored-by: Gabriele Bartolini <[email protected]> Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
|
/ok-to-merge |
Introduce support for the controlled demotion of a primary cluster and the subsequent promotion of a replica cluster (typically in another region) without the need to re-clone the former primary.
This operation will necessarily result in a downtime, which is typically scheduled and expected.
Demotion of a primary cluster is currently triggered by changing
replica.enabledfromfalsetotrueand includes:.partialfile in the WAL archive.demotionTokenin theClusterstatus, containing information in base64-encoded JSON format retrieved frompg_controldata(this includes the database system identifier, latest checkpoint'sTimeLineID, latest checkpoint's REDO location, latest checkpoint's REDO WAL file, and the time of the latest checkpoint).Currently, promoting a replica cluster to a primary cluster is triggered by simultaneously:
replica.promotionTokenand setting its value to thedemotionTokenreturned by the former primary cluster.replica.enabledfromtruetofalse.The patch includes validating the submitted token (it is the user's responsibility to set the correct value to ensure self-healing).
After waiting for the designated primary to replicate all the WAL information until the desired LSN (contained in the token) is reached, the promotion process is started.
Closes #3790
Closes #3944
Closes #4586