Re: Change log level for notifying hot standby is waiting non-overflowed snapshot

From: torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Change log level for notifying hot standby is waiting non-overflowed snapshot
Date: 2025-03-31 13:44:59
Message-ID: 2ccae97d0e70e547bd42ea3e0c3497ed@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-03-31 12:51, Fujii Masao wrote:
> I had the same thought during our off-list discussion. However,
> after reviewing the recovery code - such as recoveryStopsBefore(),
> which checks whether a consistent state is reached - I now believe
> the manual’s definition of a consistent state may be incorrect.
> A consistent state should be defined as the point where recovery
> has reached minRecoveryPoint.

I now agree with you.

> If we were to change the definition to match the manual,
> we would also need to update various recovery checks,
> which wouldn't be a trivial task.
>
> Given that, I now think it's better to revive your v1 patch,
> which introduces a new postmaster signal and improves the error message
> when connections are not accepted during hot standby. I've attached
> a revised version of the patch based on your v1. Thought?

Thank you for writing the patch!

Here are some comments on the documentation.

The following description in high-availability.sgml also seems to misuse
the word 'consistent':

When the <xref linkend="guc-hot-standby"/> parameter is set to true on
a
standby server, it will begin accepting connections once the recovery
has
brought the system to a consistent state.

Since this is part of the "User's Overview" section, it may not be
appropriate to include too much detail.
How about rewording it to avoid using 'consistent', for example:

When the <xref linkend="guc-hot-standby"/> parameter is set to true on
a
standby server, it will begin accepting connections once it is ready.

+ delaying accepting read-only connections. To enable hot standby,
+ a long-lived write transaction with more than 64 subtransactions
+ needs to be closed on the primary.

Is it better to use 'transactions' in the plural form rather than as a
nominal?

- There may be more than one such transaction.
- The <itemizedlist> below also uses the plural form.
- The newly added message also uses the plural form:
+ errhint("To enable hot standby, close write transactions with more
than %d subtransactions on the primary server."

What do you think?

--
Regards,

--
Atsushi Torikoshi
Seconded from NTT DATA GROUP CORPORATION to SRA OSS K.K.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo Nagata 2025-03-31 13:45:02 Re: Change log level for notifying hot standby is waiting non-overflowed snapshot
Previous Message Aidar Imamov 2025-03-31 13:37:44 Re: Add pg_buffercache_evict_all() and pg_buffercache_mark_dirty[_all]() functions