Re: Postgres perl module namespace

Mark Dilger <mark.dilger@enterprisedb.com>

From: Mark Dilger <mark.dilger@enterprisedb.com>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Noah Misch <noah@leadboat.com>, Andres Freund <andres@anarazel.de>, Michael Paquier <michael@paquier.xyz>, Erik Rijkers <er@xs4all.nl>, Robert Haas <robertmhaas@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-04-18T19:46:09Z
Lists: pgsql-hackers

> On Apr 18, 2022, at 10:59 AM, Andrew Dunstan <andrew@dunslane.net> wrote:
> 
> No, I think we could probably just port the whole of src/test/PostreSQL
> back if required, and have it live alongside the old modules. Each TAP
> test is a separate miracle - see comments elsewhere about port
> assignment in parallel TAP tests.

I think $last_port_assigned would need to be shared between the two modules.  This global safeguard is already a bit buggy, but not sharing it between modules would be far worse.  Currently, if a node which has a port assigned is stopped, and a parallel test creates a new node, this global variable prevents the new node from getting the port already assigned to the old stopped node, except when port assignment wraps around. Without sharing the global, wrap-around need not happen for port collisions.

Or am I reading the code wrong?

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company






Commits

  1. Fix PostgreSQL::Test aliasing for Perl v5.10.1.

  2. For PostgreSQL::Test compatibility, alias entire package symbol tables.

  3. Make PostgresNode easily subclassable