pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Pavel Borisov <pashkin.elfe@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: pgsql: Implement pg_wal_replay_wait() stored procedure
Date: Mon, 4 Nov 2024 15:04:09 +0900
Message-ID: <Zyhj2anOPRKtb0xW@paquier.xyz> (raw)
In-Reply-To: <CAPpHfdvzjEWA4a7eBhwjKJadZM4sTg0nfOfrbF8PDDK_TEqxoA@mail.gmail.com>
References: <CAPpHfdu7eAN6_Xfs+xSnRhu1zoN6WiOvj58i6qv27FgYcd8DSg@mail.gmail.com>
	<CALT9ZEERNvqJ1iDk==G_B-ZZXUBZROaEptR-zUC4mHC+iUmHUQ@mail.gmail.com>
	<CAPpHfdtc5AG0bRDaDPX+3UfwnONauGs6=vXzSKSnNs_rY8dfqg@mail.gmail.com>
	<ab0eddce-06d4-4db2-87ce-46fa2427806c@iki.fi>
	<CAPpHfdu+9NnT8Mx8gpYVXy7-BHANDVdrD6qRwt=-1=m1_pWMxw@mail.gmail.com>
	<14de8671-e328-4c3e-b136-664f6f13a39f@iki.fi>
	<CAPpHfduOkVL-GOC6V8w8gPv10f5mZ+nbwbuVn5xsLBS60jXA6A@mail.gmail.com>
	<CAPpHfdvRmTzGJw5rQdSMkTxUPZkjwtbQ=LJE2u9Jqh9gFXHpmg@mail.gmail.com>
	<CAPpHfdsywQyOcnFONiQocFu2c_bqotbU=7pG4g8RE8j3nqhhNg@mail.gmail.com>
	<CAPpHfdvzjEWA4a7eBhwjKJadZM4sTg0nfOfrbF8PDDK_TEqxoA@mail.gmail.com>

On Mon, Nov 04, 2024 at 06:29:42AM +0200, Alexander Korotkov wrote:
> The attached patchset contains patch 0001, which improves handling of
> not in recovery state by usage of PromoteIsTriggered().  When
> (PromoteIsTriggered() == false), last replay LSN is not accepted and
> not reported in errdetail().
> 
> 0002 contains patch finishing implicit transaction in default
> isolation level REPEATABLE READ or higher with revised commit message.

I was just catching up with this thread, and I'm still confused about
the state of things.  There are two things that are out of order for
me, at least, after skimming through the code on HEAD (I suspect there
is more):
- WaitForLSNReplay() uses an initial set of checks that are duplicated
in the main loop.  This is still overcomplicated, no?  Wouldn't it be
simpler to eliminate the first of checks or just have a goto block
with addLSNWaiter() called after the first round of checks?
- pg_wal_replay_wait_status() returns a status based on a static
variable that can only be accessed with the same backend as the one
that has called the wait function.  That's.. Err.. Unfriendly.  Why
being sticky with one backend for the job?

Using output parameters in a procedure is something I did not recall.
Based on your point about not using a function due your argument based
on the snapshots, let's just use that and forget about the status
function entirely (please?).

Based on the latest set of issues reported, it does not feel like this
is really baked and ready for prime day, either.  Perhaps it would be
less confusing to just revert the whole and repost a more complete and
structured implementation with an extra round of reviews?  There's
still time in this release cycle.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (50+ messages)  latest in thread

Message-ID: <Zyhj2anOPRKtb0xW@paquier.xyz>
Permalink:  ../Zyhj2anOPRKtb0xW@paquier.xyz/
Also on:    postgresql.org/message-id/Zyhj2anOPRKtb0xW@paquier.xyz

 · 

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: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, aekorotkov@gmail.com, hlinnaka@iki.fi, pashkin.elfe@gmail.com, peter@eisentraut.org, pgsql-hackers@postgresql.org
  Subject: Re: pgsql: Implement pg_wal_replay_wait() stored procedure
  In-Reply-To: <Zyhj2anOPRKtb0xW@paquier.xyz>

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

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