| From: | Xuneng Zhou <xunengzhou(at)gmail(dot)com> |
|---|---|
| To: | Alexander Korotkov <aekorotkov(at)gmail(dot)com> |
| Cc: | Jobin Augustine <jobin(dot)augustine(at)percona(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: test: avoid redundant standby catchup in 049_wait_for_lsn |
| Date: | 2026-11-19 06:26:29 |
| Message-ID: | CABPTF7VVNS3_rm+n7GP-SrMXMLQcCHSBHdTV2dA=9JrrtmNb7A@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, Nov 18, 2026 at 10:27 PM Alexander Korotkov
<aekorotkov(at)gmail(dot)com> wrote:
>
> On Sun, Nov 15, 2026 at 5:03 PM Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
> >
> > On Sun, Nov 15, 2026 at 8:09 AM Xuneng Zhou <xunengzhou(at)gmail(dot)com> wrote:
> > >
> > > On Sat, Nov 14, 2026 at 7:00 PM Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
> > > >
> > > > On Sat, Nov 14, 2026 at 7:53 AM Xuneng Zhou <xunengzhou(at)gmail(dot)com> wrote:
> > > > > Thanks for looking into this!
> > > > >
> > > > > > Thanks to Xuneng for investigation, and thanks to Jobin for the
> > > > > > additional report.
> > > > > >
> > > > > > I actually don't like idea of new pg_current_wal_insert_end_lsn()
> > > > > > function for the following reasons:
> > > > > > 1) We should fix this for PG 19. But it's RC already, we should avoid
> > > > > > catversion bump if possible.
> > > > > > 2) There is probability that users would still use
> > > > > > pg_current_wal_insert_lsn() and hit to this problem.
> > > > > > 3) Additional compexity.
> > > > >
> > > > > Makes sense to me. I did not consider the potential issue of early-adapters..
> > > > >
> > > > > > I suggest that WAIT FOR LSN can normalize the LSN to be waited on its
> > > > > > side. There is no point one should wait for the LSN inside the page
> > > > > > header. The attached patch implements that. Optinions?
> > > > >
> > > > > Normalizing the LSN in ExecWaitStmt() before invoking WaitForLSN()
> > > > > seems good to me. It adds bits of extra cost which seems small and the
> > > > > WAIT does not sit in a hot path.
> > > > >
> > > > > The new test looks like it will fail on 32-bit systems, since it
> > > > > assumes 64-bit record and page header sizes. I'm wondering if we could
> > > > > use pg_switch_wal() instead? After a WAL switch, the insert LSN is
> > > > > just past the first segment page header, so size arithmetic is not
> > > > > needed. This only covers the long-header case, not ordinary pages, but
> > > > > that seems fine, since the mapping logic stays the same.
> > > >
> > > > Good point, thank you!
> > > > Please, check v2 where pg_switch_wal() is used.
> > > >
> > >
> > > Thanks for updating the patch. In my testing, it exercised the bug
> > > well. I made a minor adjustment to the patch to stop the standby at
> > > the boundary before checking, so an unrelated background WAL would not
> > > succeed the test accidently. If this seems unnecessary, please feel
> > > free to ignore it. Otherwise, v2 looks good to me.
> >
> > I'm good with your update, thank you. I'm going to push this once
> > release freeze is lifted.
>
> Pushed and marked Open Item as resolved.
>
Thanks!
--
Regards,
Xuneng Zhou
HighGo Software Co., Ltd.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Chao Li | 2026-11-19 06:32:29 | Avoid rescanning prefixes in appendStringLiteralDQ() |
| Previous Message | Peter Smith | 2026-11-19 06:10:44 | Re: [PATCH] Report changes discarded for relations not in the subscription |