public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tatsuo Ishii <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: Primary node detection race at clean startup
Date: Tue, 19 May 2026 21:55:52 +0900 (JST)
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CAGXsc+ZmBoLs3Mz=G-Bdm4JJG+fH1NpHfR3qVJVwW4eBKWwStQ@mail.gmail.com>
	<[email protected]>

Hi Emond,

>> Hi,
>> 
>> In our tests, we've found an issue that can cause all Pgpool nodes to
>> report an incorrect 'Role: standby':
>> Role                   : standby    ← stale, never updated on this node
>> Backend Role           : primary    ← actual SR-check result
>> 
>> This can happen if all nodes in a watchdog cluster start with a clean
>> state at the same time. If the first node is still trying to determine
>> the primary database, it's primary_node_id is -2. This value is then
>> synced to other nodes in the cluster, causing all nodes to report the
>> stale state indefinitely. Attached is a patch against 4.7 that should
>> fix this.
>> 
>> Note that this analysis was done by Claude Code and it also created
>> the patch. The failure on our CI was real though and I think the
>> explanation makes sense.
> 
> I have looked into the patch. Although I failed to reproduce the
> issue, I agree with you: the explanation makes sense. Also I have run
> the regression test and all test passed. I am going to push the patch
> to all supported branches.

Done.

Note that the credits section in the commit message is as follows:

Reported-by: Emond Papegaaij <[email protected]>
Reported-by: Claude Code
Author: Tatsuo Ishii <[email protected]>
Discussion: https://www.postgresql.org/message-id/CAGXsc%2BZmBoLs3Mz%3DG-Bdm4JJG%2BfH1NpHfR3qVJVwW4eBKWwStQ%40ma...
Backpatch-through: v4.3

You are credited as a reporter, and Claude Code is also a reporter to
indicate that the report was created by AI. I credited myself as the
author. This is by following reasons:

1) AI cannot be the author.
2) The committer (me) is responsible for the commit.

Regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp





reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Primary node detection race at clean startup
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox