| From: | Alexander Korotkov <aekorotkov(at)gmail(dot)com> |
|---|---|
| To: | Xuneng Zhou <xunengzhou(at)gmail(dot)com> |
| Cc: | Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Jobin Augustine <jobin(dot)augustine(at)percona(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz> |
| Subject: | Re: test: avoid redundant standby catchup in 049_wait_for_lsn |
| Date: | 2026-12-05 16:33:17 |
| Message-ID: | CAPpHfdtzUd1t+Quo0tkev=iSjcMdQfBGtz_EvyttSNCzJfqvHA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi Xuneng,
On Fri, Dec 4, 2026 at 2:56 AM Xuneng Zhou <xunengzhou(at)gmail(dot)com> wrote:
> > I've checked the path. The documentation changes look good to me.
> > The calculations using page header sizes in tap tests look a bit
> > awkward to me, especially given those sizes aren't directly available.
> > I propose the following changes in v2.
> >
> > * In sections 1, 3 and 7b-7d, the standby mode checks take the target
> > from pg_current_wal_flush_lsn() instead of
> > pg_current_wal_insert_lsn(). The commit is flushed by then, and the
> > flush LSN never points into a page header, so WAIT doesn't remap the
> > target and the checks stay exact.
> > * For primary_flush (sections 3 and 7e), the flush LSN would already
> > be reached, so the target is the return value of
> > pg_logical_emit_message(false, ..., false). That is the end of a
> > record that isn't flushed yet, so WAIT really has to wait, and a
> > record end never points into a page header.
> > * In section 11, if a frozen replay or flush position lands on a page
> > start, the test writes more WAL and freezes again. This replaces the
> > "+41" step, so current + 1 is always a real fencepost.
> > * Section 11d takes the target from pg_current_wal_flush_lsn(), as in
> > v1, with the comment moved next to that query.
> > * The wait_target_lsn() helper is removed, so the test doesn't need to
> > know page header sizes. Section 11e remains the only test of targets
> > past a page header.
>
> The patch seems good to me and the patched 049 passes well. Just a
> small comment: can we merge the two safe_psql calls in the Section 11
> retry loop into one to save round-trip?
Pushed including this proposal.
------
Regards,
Alexander Korotkov
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Kacper Kuras | 2026-12-05 16:47:43 | Re: Proposal: SELECT * EXCLUDE (...) command |
| Previous Message | shihao zhong | 2026-12-05 16:31:57 | Re: FULL JOIN planning failure with virtual generated columns |