test: avoid redundant standby catchup in 049_wait_for_lsn
Xuneng Zhou <xunengzhou@gmail.com>
From: Xuneng Zhou <xunengzhou@gmail.com>
To: pgsql-hackers <pgsql-hackers@lists.postgresql.org>, Alexander Korotkov <aekorotkov@gmail.com>
Date: 2026-04-17T12:25:35Z
Lists: pgsql-hackers
Attachments
- v1-0001-test-merge-wrapper-DDL-and-catchup-in-wait_for_ls.patch (application/x-patch) patch v1-0001
Hi Alexander, Hackers, While working on adding more edge-case tests and fixing the timeline handling for WAIT FOR LSN, I noticed that the overall runtime of the test had increased by about 7 seconds since a8b61c23c5ff. I looked into the slowdown and found a potential source. Currently, the test creates the function, waits for the standby to catch up, tests it, then creates the procedure and waits for the standby to catch up again. Since both objects are only used by the same block of top-level statement checks, we can create them together in a single primary-side transaction and perform just one wait_for_catchup() before running both standby-side calls. This small TAP cleanup merges the creation of the PL/pgSQL wrapper function and procedure used for the top-level WAIT FOR checks in 049_wait_for_lsn.pl. The change preserves the same coverage while removing one redundant replay catch-up on the delayed standby. It appears to reduce the test runtime by about 7 seconds, though I have looked into why much of the improvement comes from this change alone. Patch attached. Thanks. -- Best, Xuneng
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
049_wait_for_lsn.pl: create function and procedure at once
- 23cbadeeb473 19 (unreleased) landed