[Patch] Improve the test src/test/postmaster/t/003_start_stop.pl - Mailing list pgsql-hackers

From Potapov Alexander
Subject [Patch] Improve the test src/test/postmaster/t/003_start_stop.pl
Date
Msg-id 76e52a54-c23e-6b0b-7b9b-3452a0591e8f@postgrespro.com
Whole thread Raw
Responses Re: [Patch] Improve the test src/test/postmaster/t/003_start_stop.pl
List pgsql-hackers
Hello,

This is about the TAP test src/test/postmaster/t/003_start_stop.pl. The test contains a loop that performs 21
iterationsin order to use all possible connection slots. We could calculate the number of available connections more
accurately.It relates to the size of backend pool that is defined in src/backend/postmaster/pmchild.c: 

    pmchild_pools[B_BACKEND].size = 2 * (MaxConnections + max_wal_senders);

There are two points here: (1) in current implementation the test performs 11 extra iterations instead of 10 that are
reallyneeded. (2) We need to change the hardcoded value every time if the number of max connections or the number of
maxwal senders are changed. If we  use 2 * (MaxConnections + max_wal_senders) the test becomes a bit convinent. 

The patch attached.

Best regards,
Alexander Potapov

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Improve pg_sync_replication_slots() to wait for primary to advance
Next
From: Alexander Pyhalov
Date:
Subject: postgres_fdw prefers fast plans