Thread

Commits

  1. Make PostgreSQL::Test::Cluster compatible with all live branches

  1. Extend compatibility of PostgreSQL::Test::Cluster

    Andrew Dunstan <andrew@dunslane.net> — 2021-12-28T14:30:24Z

    PFA a patch to extend the compatibility of PostgreSQL::Test::Cluster to
    all live branches. It does this by introducing a couple of subclasses
    which override a few things. The required class is automatically
    detected and used, so users don't need to specify a subclass. Although
    this is my work it draws some inspiration from work by Jehan-Guillaume
    de Rorthais. The aim here is to provide minimal disruption to the
    mainline code, and also to have very small override subroutines.
    
    My hope is to take this further, down to 9.2, which we recently decided
    to give limited build support to. However I think the present patch is a
    good stake to put into the ground.
    
    
    cheers
    
    
    andrew
    
    --
    Andrew Dunstan
    EDB: https://www.enterprisedb.com
    
  2. Re: Extend compatibility of PostgreSQL::Test::Cluster

    Andrew Dunstan <andrew@dunslane.net> — 2021-12-28T16:46:53Z

    On 12/28/21 09:30, Andrew Dunstan wrote:
    > PFA a patch to extend the compatibility of PostgreSQL::Test::Cluster to
    > all live branches. It does this by introducing a couple of subclasses
    > which override a few things. The required class is automatically
    > detected and used, so users don't need to specify a subclass. Although
    > this is my work it draws some inspiration from work by Jehan-Guillaume
    > de Rorthais. The aim here is to provide minimal disruption to the
    > mainline code, and also to have very small override subroutines.
    >
    > My hope is to take this further, down to 9.2, which we recently decided
    > to give limited build support to. However I think the present patch is a
    > good stake to put into the ground.
    
    
    
    This version handles older versions for which we have no subclass more
    gracefully.
    
    
    cheers
    
    
    andrew
    
    
    --
    Andrew Dunstan
    EDB: https://www.enterprisedb.com
    
  3. Re: Extend compatibility of PostgreSQL::Test::Cluster

    Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> — 2021-12-31T16:20:03Z

    Andrew Dunstan <andrew@dunslane.net> writes:
    
    > +		my $subclass = __PACKAGE__ . "::V_$maj";
    > +		bless $node, $subclass;
    > +		unless ($node->isa(__PACKAGE__))
    > +		{
    > +			# It's not a subclass, so re-bless back into the main package
    > +			bless($node, __PACKAGE__);
    > +			carp "PostgreSQL::Test::Cluster isn't fully compatible with version $ver";
    > +		}
    
    The ->isa() method works on package names as well as blessed objects, so
    the back-and-forth blessing can be avoided.
    
    	my $subclass = __PACKAGE__ . "::V_$maj";
    	if ($subclass->isa(__PACKAGE__))
    	{
    		bless($node, $subclass);
    	}
    	else
    	{
    		carp "PostgreSQL::Test::Cluster isn't fully compatible with version $ver";
    	}
    
    - ilmari
    
    
    
    
  4. Re: Extend compatibility of PostgreSQL::Test::Cluster

    Andrew Dunstan <andrew@dunslane.net> — 2021-12-31T16:22:49Z

    On 12/31/21 11:20, Dagfinn Ilmari Mannsåker wrote:
    > Andrew Dunstan <andrew@dunslane.net> writes:
    >
    >> +		my $subclass = __PACKAGE__ . "::V_$maj";
    >> +		bless $node, $subclass;
    >> +		unless ($node->isa(__PACKAGE__))
    >> +		{
    >> +			# It's not a subclass, so re-bless back into the main package
    >> +			bless($node, __PACKAGE__);
    >> +			carp "PostgreSQL::Test::Cluster isn't fully compatible with version $ver";
    >> +		}
    > The ->isa() method works on package names as well as blessed objects, so
    > the back-and-forth blessing can be avoided.
    >
    > 	my $subclass = __PACKAGE__ . "::V_$maj";
    > 	if ($subclass->isa(__PACKAGE__))
    > 	{
    > 		bless($node, $subclass);
    > 	}
    > 	else
    > 	{
    > 		carp "PostgreSQL::Test::Cluster isn't fully compatible with version $ver";
    > 	}
    >
    
    OK, thanks, will fix in next version.
    
    
    cheers
    
    
    andrew
    
    --
    Andrew Dunstan
    EDB: https://www.enterprisedb.com
    
    
    
    
    
  5. Re: Extend compatibility of PostgreSQL::Test::Cluster

    Andrew Dunstan <andrew@dunslane.net> — 2022-01-18T23:35:39Z

    On 12/31/21 11:22, Andrew Dunstan wrote:
    > On 12/31/21 11:20, Dagfinn Ilmari Mannsåker wrote:
    >> Andrew Dunstan <andrew@dunslane.net> writes:
    >>
    >>> +		my $subclass = __PACKAGE__ . "::V_$maj";
    >>> +		bless $node, $subclass;
    >>> +		unless ($node->isa(__PACKAGE__))
    >>> +		{
    >>> +			# It's not a subclass, so re-bless back into the main package
    >>> +			bless($node, __PACKAGE__);
    >>> +			carp "PostgreSQL::Test::Cluster isn't fully compatible with version $ver";
    >>> +		}
    >> The ->isa() method works on package names as well as blessed objects, so
    >> the back-and-forth blessing can be avoided.
    >>
    >> 	my $subclass = __PACKAGE__ . "::V_$maj";
    >> 	if ($subclass->isa(__PACKAGE__))
    >> 	{
    >> 		bless($node, $subclass);
    >> 	}
    >> 	else
    >> 	{
    >> 		carp "PostgreSQL::Test::Cluster isn't fully compatible with version $ver";
    >> 	}
    >>
    > OK, thanks, will fix in next version.
    >
    >
    
    Here's a version that does that and removes some recent bitrot.
    
    
    cheers
    
    
    andrew
    
    --
    Andrew Dunstan
    EDB: https://www.enterprisedb.com
    
  6. Re: Extend compatibility of PostgreSQL::Test::Cluster

    Michael Paquier <michael@paquier.xyz> — 2022-01-21T07:47:00Z

    On Tue, Jan 18, 2022 at 06:35:39PM -0500, Andrew Dunstan wrote:
    > Here's a version that does that and removes some recent bitrot.
    
    I have been looking at the full set of features of Cluster.pm and the
    requirements behind v10 as minimal version supported, and nothing
    really stands out.
    
    +   # old versions of walreceiver just set the application name to
    +   # `walreceiver'
    
    Perhaps this should mention to which older versions this sentence
    applies?
    --
    Michael
    
  7. Re: Extend compatibility of PostgreSQL::Test::Cluster

    Andrew Dunstan <andrew@dunslane.net> — 2022-01-21T14:59:04Z

    On 1/21/22 02:47, Michael Paquier wrote:
    > On Tue, Jan 18, 2022 at 06:35:39PM -0500, Andrew Dunstan wrote:
    >> Here's a version that does that and removes some recent bitrot.
    > I have been looking at the full set of features of Cluster.pm and the
    > requirements behind v10 as minimal version supported, and nothing
    > really stands out.
    >
    > +   # old versions of walreceiver just set the application name to
    > +   # `walreceiver'
    >
    > Perhaps this should mention to which older versions this sentence
    > applies?
    
    
    
    Will do in the next version. FTR it's versions older than 12.
    
    
    cheers
    
    
    andrew
    
    --
    Andrew Dunstan
    EDB: https://www.enterprisedb.com
    
    
    
    
    
  8. Re: Extend compatibility of PostgreSQL::Test::Cluster

    Andrew Dunstan <andrew@dunslane.net> — 2022-03-29T21:56:02Z

    On 1/21/22 09:59, Andrew Dunstan wrote:
    > On 1/21/22 02:47, Michael Paquier wrote:
    >> On Tue, Jan 18, 2022 at 06:35:39PM -0500, Andrew Dunstan wrote:
    >>> Here's a version that does that and removes some recent bitrot.
    >> I have been looking at the full set of features of Cluster.pm and the
    >> requirements behind v10 as minimal version supported, and nothing
    >> really stands out.
    >>
    >> +   # old versions of walreceiver just set the application name to
    >> +   # `walreceiver'
    >>
    >> Perhaps this should mention to which older versions this sentence
    >> applies?
    >
    >
    > Will do in the next version. FTR it's versions older than 12.
    >
    >
    
    I'm not sure why this item has been moved to the next CF without any
    discussion I could see on the mailing list. It was always my intention
    to commit it this time, and I propose to do so tomorrow with the comment
    Michael has requested above. The cfbot is still happy with it.
    
    
    cheers
    
    
    andrew
    
    
    --
    Andrew Dunstan
    EDB: https://www.enterprisedb.com
    
    
    
    
    
  9. Re: Extend compatibility of PostgreSQL::Test::Cluster

    Michael Paquier <michael@paquier.xyz> — 2022-03-30T05:55:51Z

    On Tue, Mar 29, 2022 at 05:56:02PM -0400, Andrew Dunstan wrote:
    > I'm not sure why this item has been moved to the next CF without any
    > discussion I could see on the mailing list. It was always my intention
    > to commit it this time, and I propose to do so tomorrow with the comment
    > Michael has requested above. The cfbot is still happy with it.
    
    Thanks for taking care of it!
    --
    Michael
    
  10. Re: Extend compatibility of PostgreSQL::Test::Cluster

    Andrew Dunstan <andrew@dunslane.net> — 2022-03-30T15:27:36Z

    On 3/30/22 01:55, Michael Paquier wrote:
    > On Tue, Mar 29, 2022 at 05:56:02PM -0400, Andrew Dunstan wrote:
    >> I'm not sure why this item has been moved to the next CF without any
    >> discussion I could see on the mailing list. It was always my intention
    >> to commit it this time, and I propose to do so tomorrow with the comment
    >> Michael has requested above. The cfbot is still happy with it.
    > Thanks for taking care of it!
    
    
    
    Committed.
    
    
    cheers
    
    
    andrew
    
    
    --
    Andrew Dunstan
    EDB: https://www.enterprisedb.com