Skip to content

[Feature]: Add shutdownCheckpointToken in the status after fencing/hibernating #3790

Closed

Description

@gbartolini

Is there an existing issue already for this feature request/idea?

  • I have searched for an existing issue, and could not find anything. I believe this is a new feature request to be evaluated.

What problem is this feature going to solve? Why should it be added?

When fencing or hibernating a Postgres cluster, it would be handy to add in the status a token containing information about write-ahead logging and checkpoint processing.

Describe the solution you'd like

We should add a new field in the status called shutdownCheckpointToken that is normally empty.

Following a fencing operation (and consequently hibernation too), shutdownCheckpointToken is an encoded string containing the following information from pg_controldata:

  • Database system identifier
  • Latest checkpoint's TimeLineID
  • Latest checkpoint's REDO location
  • Latest checkpoint's REDO WAL file
  • Time of latest checkpoint

The above values must be taken when the Database cluster state is shut down.

Describe alternatives you've considered

N/A

Additional context

N/A

Backport?

Yes

Are you willing to actively contribute to this feature?

Yes

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    enhancement 🪄
    triage
    on Feb 5, 2024
  2. self-assigned this
    on Feb 5, 2024
  3. removed
    triage
    on Feb 5, 2024
  4. mnencia commented on Feb 7, 2024

    @mnencia
    Member

    Given that the content of the token is only taken when the state is shut down, we could name it shutdownToken.

  5. gbartolini commented on Feb 7, 2024

    @gbartolini
    ContributorAuthor

    Ok with shutdownToken or shutdownCheckpointToken.

  6. mnencia commented on Feb 7, 2024

    @mnencia
    Member

    I like the latter. 👍 for shutdownCheckpointToken

  7. changed the title [-][Feature]: Add `checkpointToken` in the status after fencing/hibernating[/-] [+][Feature]: Add `shutdownCheckpointToken` in the status after fencing/hibernating[/+] on Feb 26, 2024
  8. gbartolini commented on Feb 26, 2024

    @gbartolini
    ContributorAuthor

    We should also make sure that this is set as part of #3796

  9. added this to the 1.23.0 milestone on Apr 5, 2024
  10. modified the milestones: 1.23.0, 1.24.0 on Apr 15, 2024
  11. self-assigned this
    on Apr 29, 2024
  12. 12 remaining items

  13. added a commit that references this issue on May 17, 2024
    992b48e
  14. added 2 commits that reference this issue on May 30, 2024
    c2a2d71
  15. gbartolini commented on Jun 5, 2024

    @gbartolini
    ContributorAuthor

    Given that all the features related to switchover to a replica cluster are landing at the same time on version 1.24.0, it is IMHO unnecessary to introduce a gradual introduction of the feature that involves both fencing and hibernation. We should just update the status when demotion is requested. Thoughts @leonardoce @armru @fcanovai @mnencia?

  16. leonardoce commented on Jun 5, 2024

    @leonardoce
    Contributor

    Yes, I agree. This would lead to a more maintainable implementation.

    It will be less confusing to use: there would be just one way to do a DC switchover. And one E2E scenario will be enough to exercise the workflow.

  17. fcanovai commented on Jun 6, 2024

    @fcanovai
    Contributor

    +1. If we have a single, fast and easy procedure to demote a cluster and promote the replica one it will be easier from everyone. And less intermediate steps could make for a faster switchover.

  18. added a commit that references this issue on Jun 6, 2024
    630763f
  19. added a commit that references this issue on Jun 18, 2024
    152f3d9
  20. gbartolini commented on Jun 19, 2024

    @gbartolini
    ContributorAuthor

    This ticket has been converted to managing the demotionToken and to be triggered only when a primary cluster becomes a replica one.

  21. added a commit that references this issue on Jun 19, 2024
    569ca46
  22. added a commit that references this issue on Jun 19, 2024
    f2b876e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement 🪄

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions