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

feat: enhance shutdown process for demotion of the cluster #4411

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

armru
Copy link
Member

@armru armru commented Apr 30, 2024

This patch enhances the shutdown process for demoting a primary cluster in CloudNativePG by:

  • Introducing the shutdownCheckpointToken in the Cluster status, containing information in JSON format retrieved from pg_controldata. This includes the database system identifier, latest checkpoint's TimeLineID, latest checkpoint's REDO location, latest checkpoint's REDO WAL file, and the time of the latest checkpoint.
  • Archiving the checkpoint REDO WAL file (which contains the shutdown checkpoint) as a .partial file. This facilitates the controlled promotion of a replica cluster by relying solely on the WAL archive.

Note that this implementation does not cover the hibernation case, which will be addressed in a separate patch.

Closes #3790
Closes #4586

@github-actions github-actions bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.21 release-1.22 release-1.23 labels Apr 30, 2024
Copy link
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@armru
Copy link
Member Author

armru commented May 1, 2024

/test limit=local

Copy link
Contributor

github-actions bot commented May 1, 2024

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/8907157613

@armru
Copy link
Member Author

armru commented May 6, 2024

/test limit=local

Copy link
Contributor

github-actions bot commented May 6, 2024

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/8970292966

@armru
Copy link
Member Author

armru commented May 7, 2024

/test limit=local

Copy link
Contributor

github-actions bot commented May 7, 2024

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/8981364872

@armru
Copy link
Member Author

armru commented May 7, 2024

/test limit=local

Copy link
Contributor

github-actions bot commented May 7, 2024

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/8981390629

@armru armru removed backport-requested ◀️ This pull request should be backported to all supported releases release-1.21 release-1.22 release-1.23 labels May 7, 2024
@leonardoce leonardoce requested a review from jsilvela as a code owner May 17, 2024 09:45
api/v1/cluster_types.go Outdated Show resolved Hide resolved
@gbartolini gbartolini changed the title feat: add ShutdownCheckpointToken feat: enhance Cluster shutdown process for demotion May 30, 2024
@gbartolini gbartolini changed the title feat: enhance Cluster shutdown process for demotion feat: enhance shutdown process for demotion of the cluster May 30, 2024
armru and others added 10 commits June 3, 2024 12:02
Closes #3790

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Co-authored-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants