Add two missing tests in 035_standby_logical_decoding.pl
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
From: "Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-04-12T16:15:10Z
Lists: pgsql-hackers
Attachments
- v1-0001-add-missing-tests.patch (text/plain) patch v1-0001
hi hackers, In the logical decoding on standby thread [1], Andres proposed 2 new tests (that I did not find the time to complete before the finish line): - Test that we can subscribe to the standby (with the publication created on the primary) - Verify that invalidated logical slots do not lead to retaining WAL Please find those 2 missing tests in the patch proposal attached. A few words about them: 1) Regarding the subscription test: It modifies wait_for_catchup() to take into account the case where the requesting node is in recovery mode. Indeed, without that change, wait_for_subscription_sync() was failing with: " error running SQL: 'psql:<stdin>:1: ERROR: recovery is in progress HINT: WAL control functions cannot be executed during recovery.' while running 'psql -XAtq -d port=61441 host=/tmp/45dt3wqs2p dbname='postgres' -f - -v ON_ERROR_STOP=1' with sql 'SELECT pg_current_wal_lsn()' " 2) Regarding the WAL file not retained test: As it's not possible to execute pg_switch_wal() and friends on a standby, this is done on the primary. Also checking that the WAL file (linked to a restart_lsn of an invalidate slot) has been removed is done directly at the os/directory level. The attached patch also removes: " -log_min_messages = 'debug2' -log_error_verbosity = verbose " as also discussed in [1]. I'm not sure if adding those 2 tests should be considered as an open item. I can add this open item if we think that makes sense. I'd be happy to do so but it looks like I don't have the privileges to edit https://wiki.postgresql.org/wiki/PostgreSQL_16_Open_Items Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com [1]: https://www.postgresql.org/message-id/6d801661-e21b-7326-be1b-f90d904da66a%40gmail.com
Commits
-
Fix the race condition in the test case added by commit a6e04b1d20.
- c5b7f67fcc8c 16.0 landed
-
Test that invalidated logical slots doesn't retain WAL.
- a6e04b1d20c2 16.0 landed
-
Add a test to verify that subscription to the standby works.
- 376dc820531b 16.0 landed
-
Reduce the log level in 035_standby_logical_decoding.pl.
- 3034dc56ef4b 16.0 landed