Re: Isn't wait_for_catchup slightly broken?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Subject: Re: Isn't wait_for_catchup slightly broken?
Date: 2022-01-15 22:58:02
Message-ID: 3612314.1642287482@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> Another thing that is bothering me a bit is that a number of the
> callers use $node->lsn('insert') as the target. This also seems
> rather dubious, because that could be ahead of what's been written
> out. These callers are just taking it on faith that something will
> eventually cause that extra WAL to get written out (and become
> available to the standby). Again, that seems to make the test
> slower than it need be, with a worst-case scenario being that it
> eventually times out. Admittedly this is unlikely to be a big
> problem unless some background op issues an abortive transaction
> at just the wrong time. Nonetheless, I wonder if we shouldn't
> standardize on "thou shalt use the write position", because I
> don't think the other alternatives have anything to recommend them.

Here's a version that makes sure that callers specify a write position not
an insert position. I also simplified the callers wherever it turned
out that they could just use the default parameters.

regards, tom lane

Attachment Content-Type Size
clean-up-wait_for_catchup-usage.patch text/x-diff 17.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2022-01-16 04:07:38 Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit
Previous Message Tomas Vondra 2022-01-15 22:57:20 Re: sequences vs. synchronous replication