Re: Inheriting PostgresNode object

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Victor Wagner <vitus(at)wagner(dot)pp(dot)ru>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Inheriting PostgresNode object
Date: 2016-09-13 20:49:09
Message-ID: 28632.1473799749@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> Yeah, as I recall the only thing the get_new_node thingy does is assign
> a nonconflicting port number to each instance, and make sure the
> instances are all teared down at END. I don't remember now why didn't
> we just do the port check in the constructor, but we messed with that
> code a lot after the commit. Maybe there's no good reason and we should
> change that, for convenience of inheritance. As for the teardown, I
> remember trying to do that using DESTROY instead of an END block, but
> there was some problem I couldn't figure out (I think there was some
> ugly warning message because the data dir for the node was removed
> before the DESTROY for the object had the chance to run)... maybe you
> can figure that one out.

We changed that in 08af92190 --- changing it back would require
finding a different solution to the order-of-shutdown problem.

> Overall I think it'd be an improvement to use a regular constructor
> instead of the current arrangement.

Constructor si, destructor no.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2016-09-13 20:52:14 Re: [BUGS] BUG #14244: wrong suffix for pg_size_pretty()
Previous Message Alvaro Herrera 2016-09-13 20:39:18 Re: Inheriting PostgresNode object