Skip to content

Stop renewing the primary lease when a replica stops being the target primary #11736

Description

@gbartolini

A replica named target primary acquires the primary lease and keeps renewing it, even if the operator moves the target to another replica before it promotes. The new target sees a record that keeps changing, so its observation window never completes and the cluster has no primary until the first replica restarts.

The instance reconciler should make the lease runnable yield when this pod is not the target primary, PostgreSQL is in recovery and no promotion was requested in this process. Yielding stops renewal and writes nothing. The record goes stale and the new target takes it over after the normal observation window.

This issue is being created after the PR (#11677), exceptionally, to group all the lease-related changes under the #11721 epic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛

    Type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions