Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyRwp-0002H9-Fk for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Jun 2021 04:35:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lyRwo-0003qx-C6 for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Jun 2021 04:35:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyRwo-0003oh-19 for pgsql-hackers@lists.postgresql.org; Wed, 30 Jun 2021 04:35:38 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyRwi-00075Q-Lv for pgsql-hackers@postgresql.org; Wed, 30 Jun 2021 04:35:36 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 84D705C01AE; Wed, 30 Jun 2021 00:35:30 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 30 Jun 2021 00:35:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=rfYto4u+YyohEZkKt9+1RJ4vcbA Pxd0UCiR7kRmZi94=; b=tkBQayl7CFqt83bhdRaTgIkk2mxBMLxJuxP9xSW1nPA opt5MUhYeXQGGO9HNsaeBE6BX7G1bMvI/ZU39cqaN6z5GbLKp2cA031E38sPKzo7 RuFvyqbwBCRs0UK/cH+/43iZIO1HCHIiEaa7gd3MmKqF52OXPjckSdk/z4uZB1og 420ZmAZZqP1/Ew+cKPfxs4KY3zc/tnTsl0n+98tip++VnpTm3pnUXSGjaT/1oPOh RqJoTnnPltO67QW66xTgvEP7S/raKXM5hKWrbouFUACGWw7wkbYfAN74AUPO72tz CBFrSTJkI7rB3Mpnk1T48AVFMT5WXxjpeSU9FH5L9QA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=rfYto4 u+YyohEZkKt9+1RJ4vcbAPxd0UCiR7kRmZi94=; b=wX52rZC9HalmiG7uxdqOD5 27ExczdSr8MYgblrz9gzV4xER0/s8rYfKUm7KkWIVPLbWe+fcdUxFPr3XAUuY5zi XVlZXdAUCPv65hFDFrZj4hKG15YD4slIu5JGrc3iE9bq1q/1FVsG5TbtyRTCpjuz MwLneSPqZzYi1unGjLcDnJymIZQb9eZ4zHCILP7QXAQpDOE6aJFW9iOtTZhuAlmK UMULER5NVDoEsuT0ohFtdtuqTyT2eEhKLHzaJZoAsXeZBrlfUVU7ml6LfFkottMF JP9ZQXc7of9SXO+PuCMl4R0uljDpBnYIWeO3ingPR6EU/HtslwGzRHEdjF3v9QNw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeeiuddgjeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpedvgeduuefhtdeuleettdevjeeh heeiveeuieegleetgeeljeelieeuieehgeevhfenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 30 Jun 2021 00:35:28 -0400 (EDT) Date: Wed, 30 Jun 2021 13:35:24 +0900 From: Michael Paquier To: Andrew Dunstan Cc: Alvaro Herrera , PostgreSQL-development Subject: Re: cleaning up PostgresNode.pm Message-ID: References: <20210424191444.GA25008@alvherre.pgsql> <021d7feb-f91c-ab2e-5b80-ccdd37e78a18@dunslane.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2OXbw9+z5vRm9yFR" Content-Disposition: inline In-Reply-To: <021d7feb-f91c-ab2e-5b80-ccdd37e78a18@dunslane.net> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --2OXbw9+z5vRm9yFR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jun 28, 2021 at 01:02:37PM -0400, Andrew Dunstan wrote: > Patch 1 adds back the '-w' flag to pg_ctl in the start() method. It's > redundant on modern versions of Postgres but it's harmless, and helps > with subclassing for older versions where it wasn't the default. 05cd12e applied to all the actions, so wouldn't it be more consistent to do the same for stop(), restart() and promote()? > Patch 2 adds a method for altering config files as opposed to just > appending to them. Again, this helps a lot in subclassing for older > versions, which can call the parent's init() and then adjust whatever > doesn't work. +unless skip_equals is true, in which case it will write Nit: two spaces here. +Modify the named config file setting with the value. If the value is undefined, +instead delete the setting. If the setting is not present no action is taken. This should mention that parameters commented out are ignored? skip_equals is not used. The only caller of adjust_conf is PostgresNode itself. > Patch 3 unifies the constructor methods and stops exporting a > constructor. There is one constructor: PostgresNode::new() Nice^2. I agree that this is an improvement. > Patch 4 removes what's left of Exporter in PostgresNode, so it becomes a > pure OO style module. I have mixed feelings on this one, in a range of -0.1~0.1+, but please don't consider that as a strong objection either. > Patch 5 adds a method for getting the major version string from a > PostgresVersion object, again useful in subclassing. WFM. > Patch 6 adds a method for getting the install_path of a PostgresNode > object. While not strictly necessary it's consistent with other fields > that have getter methods. Clients should not pry into the internals of > objects. Experience has shown this method to be useful. I have done that as well when looking at the test business with pg_upgrade. > Patches 7 8 and 9 contain additions to Patch 3 for things that I > overlooked or that were not present when I originally prepared the > patches. They would be applied alongside Patch 3, not separately. That happens. > These patches are easily broken by e.g. the addition of a new TAP test > or the modification of an existing test. So I'm hoping to get these > added soon. I will add this email to the CF. I doubt that anybody would complain about any of the changes you are doing here. It would be better to get that merged early in the development cycle on the contrary. -- Michael --2OXbw9+z5vRm9yFR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmDb9IwACgkQnvQgOdby QH0QYQ/8DWm0oTeJxDtEGKGenYnFQAGwKRWvsx6G/QjtWIPzzegw2al7UQxNG1JH PSrRWQgavAq87i9pBXOF9K9/23F+pLnXz8ZaY28Czzf3HVV7hCa3GIcc9b8nkyP1 p9sqPsvXun114RKCwTcmsHrhPQgRq+c6iyKdBkyh+zGj8IoxvtyNBXN4dcmYOEvA Dmm3ISjXTfG98UO1cqwwVPAuAl7L/NTFsea/tLUQkNn90SGWFTJNNnNSz6xfk1wF yuko/YJ3pHSnQdV6Baltpeks0JcrI/AsgCThpdcttNbj6J2tMXZwrOuJqSNX0B7Q yP2CygKmoIo4onqe0CUaT3m03OHqZxvrRPjMQ2OYQ8hyGOP62gzpfi0H5BihxWvq fRqG9L78S58B7JPmbvtJ9SwPMPD2PLA74I4cXJTixb94HVMJzznqFNIJe9ivTukx RBISSo7jxW6cwJAY9mJ9ojG6iFSkM7tloW+2kIY/rOFb59hwoCUc5+Muw6yYzeMb XtZGa/fctsus8HdMMsD0rAitTkosBP0zbvyKYlDLBFPQWAy6GZXb6uDvHzzzgZ4n LGTiiCTVMCB8RMAY0nXbDx2VHqvd0EKfu6I3jbzifw49FNqbz/dHOfBdIqWgIH4s bk89w48ryUuwfRGijKmBxrF2QQFTHKOrbPLgwJOsqxC1RLH/8v0= =B2pe -----END PGP SIGNATURE----- --2OXbw9+z5vRm9yFR--