Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tMa8X-0057xc-7w for pgsql-hackers@arkaria.postgresql.org; Sat, 14 Dec 2024 21:57:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tMa8U-007J7q-3y for pgsql-hackers@arkaria.postgresql.org; Sat, 14 Dec 2024 21:57:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tMa8T-007J7i-2f for pgsql-hackers@lists.postgresql.org; Sat, 14 Dec 2024 21:57:18 +0000 Received: from fhigh-b4-smtp.messagingengine.com ([202.12.124.155]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tMa8R-002rFX-55 for pgsql-hackers@lists.postgresql.org; Sat, 14 Dec 2024 21:57:17 +0000 Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.stl.internal (Postfix) with ESMTP id B516F2540133 for ; Sat, 14 Dec 2024 16:57:13 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Sat, 14 Dec 2024 16:57:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilmari.org; h=cc :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm3; t=1734213433; x=1734299833; bh=OFAmJeYP25nvdAvD+yXt4DPslXkJZAKj 0xLpxT+GsoE=; b=PgHy26nrZk7j0vMJGw9U3XnHOLn4C8mdt7ECWiD8Cmb1dIfH 3+zmp1nLnnFXMbU9fNpKL6KmA3B24wOndwv6BgFjg8QjRqsLCmSimUIVCo3JCili 5OhUkxuKaOPTdONfHF0GsDr56xVtb845rphqzYi2O3rl5B5//KOjwYLWhqqYpvF0 RUvRYFBozwTcpEIm6Wq0hOOISKHgj8FdEProiRHSnIWqQGZ3IFG5a/ivqZWFgkuy nc9Jd+TUTHGzP+BeyuMrl2dHri9dSLuiBXiMQEe9tbRLGJMG2Mc5x+EDazl5KLNF GruU/84VKGAwMs/jXFMCiMtwxOA9wO2lGXCS6w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1734213433; x= 1734299833; bh=OFAmJeYP25nvdAvD+yXt4DPslXkJZAKj0xLpxT+GsoE=; b=J cV7+ymSU4jU++VmXQZYQVu89Qu41FjdRnI/WVU8L6odvlWnkuWXrMXtDEWTZuS7q NiAxp5kzXFvYwzHvrHlvwbOFGENgB4rOYwUJdE3fFDs5eHjTCqrjlQQA+0BUGr0b mEu/TrgEo5t/cKDUwACs3W3G0NCew2X24gZAsjnyZ3S17lm4uBUmTpBxuE3m1GrQ C6n6GIl6V7iKO3OWQVNkfIFgIUiQoZPTSMye8M4uwMSIhBWSsumUek6J7Pf1Pj66 Z1zQFI90lMYRA0N7XGINv4P9x7LzEHmLm8ed/MKBb2YGEXisadaDMFf3Jo9dx8Vu wGFfgX6jhFZsIyCphkz2A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkeelgdduheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuff fkfgggtgesmhdtreertderjeenucfhrhhomhepffgrghhfihhnnhcukfhlmhgrrhhiucfo rghnnhhsnohkvghruceoihhlmhgrrhhisehilhhmrghrihdrohhrgheqnecuggftrfgrth htvghrnhepieeiveetvdeuveevkeefueejieekgfdvtdetffekgeejtedvjeetheehueel iedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepih hlmhgrrhhisehilhhmrghrihdrohhrghdpnhgspghrtghpthhtohepuddpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrph hoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i1ff147bf:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 14 Dec 2024 16:57:12 -0500 (EST) From: =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= To: pgsql-hackers@lists.postgresql.org Subject: pg_combinebackup PITR comparison test fix Date: Sat, 14 Dec 2024 21:57:11 +0000 Message-ID: <87h67653ns.fsf@wibble.ilmari.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=-=-= Content-Type: text/plain Hi hackers, While I was going through the TAP tests to fix the formatting of command argument lists to be less confusing, I noticed that pg_combinebackup's 002_compare_backups.pl test accidentally ran pg_dumpall twice against the same database, thus rendering the tests useless. Fixing that revealed that there is a difference in the dumps: the tablespaces have different paths. pg_dumpall doesn't have an option to map tablespace paths, so instead I used File::Compare::compare_text() with a custom comparison function to erase the difference. - ilmari --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-pg_combinebackup-PITR-comparison-test.patch From d8f186e79fceb881a225c7b612e074d8956da1ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= Date: Sat, 14 Dec 2024 21:08:16 +0000 Subject: [PATCH] Fix pg_combinebackup PITR comparison test The test was creating both the dumps to compare from the same DB, so would never detect any mismatches. Fixing that revealed that there is a difference in the dumps: the tablespaces have different paths. pg_dumpall doesn't have an option to map tablespace paths, so use compare_text() with a custom comparison function to erase the difference. --- .../pg_combinebackup/t/002_compare_backups.pl | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_combinebackup/t/002_compare_backups.pl b/src/bin/pg_combinebackup/t/002_compare_backups.pl index 63a0255de15..6bf48971734 100644 --- a/src/bin/pg_combinebackup/t/002_compare_backups.pl +++ b/src/bin/pg_combinebackup/t/002_compare_backups.pl @@ -2,7 +2,7 @@ use strict; use warnings FATAL => 'all'; -use File::Compare; +use File::Compare qw(compare_text); use PostgreSQL::Test::Cluster; use PostgreSQL::Test::Utils; use Test::More; @@ -175,17 +175,23 @@ $pitr1->connstr('postgres'), ], 'dump from PITR 1'); -$pitr1->command_ok( +$pitr2->command_ok( [ 'pg_dumpall', '-f', $dump2, '--no-sync', '--no-unlogged-table-data', '-d', - $pitr1->connstr('postgres'), + $pitr2->connstr('postgres'), ], 'dump from PITR 2'); -# Compare the two dumps, there should be no differences. -my $compare_res = compare($dump1, $dump2); +# Compare the two dumps, there should be no differences other than +# the tablespace paths. +my $compare_res = compare_text( + $dump1, $dump2, + sub { + s{create tablespace .* location '.*/tspitr\K[12]}{N}i for @_; + return $_[0] ne $_[1]; + }); note($dump1); note($dump2); is($compare_res, 0, "dumps are identical"); -- 2.39.5 --=-=-=--