Skip to content

[Feature]: schedule next update timestamp of a Cluster #5272

Open

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?

An upgrade of the operator triggers a rolling update on any Postgres cluster managed by the operator. While this is not a problem in the case of a small number of clusters, it might create problems for larger fleets.

Describe the solution you'd like

While waiting for maintenance windows (#14) we should introduce two new fields to the status:

  • lastUpdateTimestamp: storing the timestamp of the last successful update of the cluster object (if null, no previous update has been done)
  • nextUpdateTimestamp: storing the timestamp of the next scheduled update of the cluster object (if null, no update is scheduled)

The idea is that the first reconciliation loop after nextUpdateTimestamp triggers an update, following the same rules as the supervised/unsupervised method and strategy.

In terms of usability, we should clearly highlight that the next update of the cluster will happen at nextUpdateTimeStamp (if not null). This includes the cnpg status command.

As part of this ticket we should also define a default update window of 10 minutes (we can choose a different value, but make sure it is a global constant for now - we can address customisation in a follow-up ticket which also considers #14). The idea is that, following an operator upgrade process or a change of the image catalog, instead of immediately triggering the update, we randomly throw a value between the current timestamp and the above window, and set the nextUpdateTimestamp.

This should randomly distribute in the space of 10 minutes all the cluster updates.

Describe alternatives you've considered

This path had already been decided a couple of years ago, when we introduced the concept of current/target primary and primary timestamp fields, but the implementation had been postponed.

Additional context

This work is preliminary for maintenance windows in #14

We should also consider another important aspect: interaction of this with any rolling update process. Ideally, all updates should be gated by this feature.

Backport?

No

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
    triage
    on Aug 13, 2024
  2. added this to the 1.25.0 milestone on Aug 13, 2024
  3. self-assigned this
    on Aug 13, 2024
  4. added
    enhancement 🪄
    and removed
    triage
    on Aug 13, 2024
  5. moved this to Todo in Roadmapon Aug 13, 2024
  6. modified the milestones: 1.25.0, 1.26.0 on Aug 27, 2024
  7. 8 remaining items

  8. modified the milestones: 1.28.0, 1.29 on Aug 17, 2025
  9. github-actions commented on Oct 22, 2025

    @github-actions
    Contributor

    This issue is stale because it has been open for 60 days with no activity.

  10. github-actions commented on Nov 5, 2025

    @github-actions
    Contributor

    This issue was closed because it has been inactive for 14 days since being marked as stale.

  11. moved this from Todo to Done in Roadmapon Nov 5, 2025
  12. moved this from Done to Todo in Roadmapon Dec 12, 2025
  13. modified the milestones: 1.29.0, Next on Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement 🪄no-stale

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions