Skip to content

fix(replica_clusters): report the system ID while PostgreSQL is down - #11645

Merged
mnencia merged 4 commits into
mainfrom
dev/11602
Oct 14, 2026
Merged

mnencia merged 4 commits into
mainfrom
dev/11602

Conversation

@armru

@armru armru commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

The status probe read the system ID with SQL. A fenced or restarting instance can't run SQL, so it reported none. After a demotion all instances are in that state, so the operator set ConsistentSystemID to False (NotFound) and did not update it until another event touched the Cluster.

Read the ID from pg_control instead, which doesn't need a running PostgreSQL. A cluster fenced on purpose now reports ConsistentSystemID as True.

Closes #11602


Alternative to #11603, which requeues the reconciliation.

@armru
armru requested a review from a team as a code owner October 12, 2026 13:05
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.28 release-1.30 labels Oct 12, 2026
@github-actions

Copy link
Copy Markdown
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

armru commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

/test

@github-actions

Copy link
Copy Markdown
Contributor

@armru armru changed the title fix(replica clusters): report the system ID while PostgreSQL is down fix(replica_clusters): report the system ID while PostgreSQL is down Oct 12, 2026
@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Oct 12, 2026
@leonardoce

Copy link
Copy Markdown
Contributor

/test

@github-actions

Copy link
Copy Markdown
Contributor

armru and others added 3 commits October 14, 2026 11:10
While an instance is fenced or restarting, its status probe masks the
connection error and only reads the role from the data directory, so it
reports no system ID. After a demotion every instance is in that state at
once, the operator sets ConsistentSystemID to False (NotFound), and the
passes that follow find nothing new to write, so the condition stays stale
until an unrelated event touches the Cluster.

Read the system identifier from pg_control in that case, which does not
need a running PostgreSQL. The instances keep reporting it through fencing
and restarts. A cluster fenced on purpose now reports ConsistentSystemID
as True instead of False, since its system ID is known and consistent.

Closes #11602

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
@mnencia
mnencia merged commit 9db8760 into main Oct 14, 2026
@mnencia
mnencia deleted the dev/11602 branch October 14, 2026 09:32
cnpg-bot pushed a commit that referenced this pull request Oct 14, 2026
…11645)

The status probe read the system ID with SQL. A fenced or restarting
instance can't run SQL, so it reported none. After a demotion all
instances are in that state, so the operator set ConsistentSystemID to
False (NotFound) and did not update it until another event touched the
Cluster.

Read the ID from pg_control instead, which doesn't need a running
PostgreSQL. A cluster fenced on purpose now reports ConsistentSystemID
as True.

Closes #11602

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Leonardo Cecchi <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 9db8760)
mnencia added a commit that referenced this pull request Oct 15, 2026
…11645)

The status probe read the system ID with SQL. A fenced or restarting
instance can't run SQL, so it reported none. After a demotion all
instances are in that state, so the operator set ConsistentSystemID to
False (NotFound) and did not update it until another event touched the
Cluster.

Read the ID from pg_control instead, which doesn't need a running
PostgreSQL. A cluster fenced on purpose now reports ConsistentSystemID
as True.

Closes #11602

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Leonardo Cecchi <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 9db8760)
Signed-off-by: Marco Nenciarini <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases ok to merge 👌 This PR can be merged release-1.28 release-1.30

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ConsistentSystemID stays False (NotFound) for a long time after a replica cluster demotion

5 participants