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 1rTlaR-00675X-4I for pgsql-hackers@arkaria.postgresql.org; Sat, 27 Jan 2024 16:31:19 +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 1rTlaN-006o8x-Gr for pgsql-hackers@arkaria.postgresql.org; Sat, 27 Jan 2024 16:31:15 +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 1rTlaN-006o8o-3z for pgsql-hackers@lists.postgresql.org; Sat, 27 Jan 2024 16:31:15 +0000 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rTlaK-003ezi-Dm for pgsql-hackers@lists.postgresql.org; Sat, 27 Jan 2024 16:31:13 +0000 Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-361a38dd171so2537005ab.0 for ; Sat, 27 Jan 2024 08:31:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706373071; x=1706977871; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=WeB1IH4dZcoNMyhZFLOimW5O1d3KdKaf6xpz+gzMBWw=; b=nOOHBZ706TNB3Y6UQMieig9jUNOXx1AMboVC18ZOZO4v0qUziP8QLOfup/7AKrHkzU /qekQtYu0ON+szvJ2K8Cl7VqM4Ln72N8Eoxs43J6Vaafsd/GclpyFSKZTXf32uVAXOEw PoHoTJDXAGrfjT6eCoyQqiavu9OGADhtSzhaGp38QX6JjWEEHwlZuf42fIfxSsF2k5js cDIt0MKQMbcln6sIbucqFGzC5BDgOsvQo9IDlYbLuOMd7PSJG2Ydzgym8D8xieXK+LfQ 1yZclcyBN+pd2PrjNiGKlP5ueumN5AA5DFnXVqlMSpxbCtsgH+5ojKexLrFZPlNUZeGM L4Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706373071; x=1706977871; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=WeB1IH4dZcoNMyhZFLOimW5O1d3KdKaf6xpz+gzMBWw=; b=lBnQs3tVRamTbP+GUgAi0ARDaAOZc16UV8nBcwkt18yTlstTMrdmwNF8nkwreaLbZp Jim9zcwybLlC5gecowBsyXx4RBM0ZfC8b1JzdwFYofbafTjId1t9x7xpV5cKs+gu+l7R Y4utM9rS0BK7Qb5Fb5evuvDiQCDyQbC2EalrqXW+sIoXCLmVdA/wyOw6vH1kqhS1ALGm OYn8NECaqz6pxizEIR1BoAolHOg4+sfCq07Y02ydtyJwoa62rP1okDiRuVHMWmlq0och JXOv16YJSzljMqV7HxLDguLJtkiURoHRG1NcMs32JrC4A0DJwoevYs+unMTtaSyhUx41 4AKg== X-Gm-Message-State: AOJu0Ywciry/UzQjM+w3haceKcvNgiRtjL/NYCE3XCpCOazAgzeZcPg1 hqXgIet8lJTMGqge1mQFywAzhyZgzNh/Ysu3eWYCqkyaCCfnJC1x X-Google-Smtp-Source: AGHT+IFoULDla5eEPckaOuQy5jyxTzQBF/Upyex3szPectXaJmqkgPSfL6NjoaE7uM+riaytvApI1A== X-Received: by 2002:a92:c0c3:0:b0:363:75fc:6c4f with SMTP id t3-20020a92c0c3000000b0036375fc6c4fmr977810ilf.3.1706373071462; Sat, 27 Jan 2024 08:31:11 -0800 (PST) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id e16-20020a92d750000000b00362902d6818sm1000196ilq.62.2024.01.27.08.31.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 08:31:10 -0800 (PST) Date: Sat, 27 Jan 2024 10:31:09 -0600 From: Nathan Bossart To: Alexander Lakhin Cc: Robert Haas , Matthias van de Meent , PostgreSQL Hackers Subject: Re: cleanup patches for incremental backup Message-ID: <20240127163109.GA3047116@nathanxps13> References: <20240124170846.GA2643050@nathanxps13> <8aed364e-f572-4561-b4fc-ff149067b670@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline In-Reply-To: <8aed364e-f572-4561-b4fc-ff149067b670@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jan 27, 2024 at 11:00:01AM +0300, Alexander Lakhin wrote: > 24.01.2024 20:46, Robert Haas wrote: >> This is weird. There's a little more detail in the log file, >> regress_log_002_blocks, e.g. from the first failure you linked: >> >> [11:18:20.683](96.787s) # before insert, summarized TLI 1 through 0/14E09D0 >> [11:18:21.188](0.505s) # after insert, summarized TLI 1 through 0/14E0D08 >> [11:18:21.326](0.138s) # examining summary for TLI 1 from 0/14E0D08 to 0/155BAF0 >> # 1 >> ... >> [11:18:21.349](0.000s) # got: 'pg_walsummary: error: could >> not open file "/home/nm/farm/gcc64/HEAD/pgsql.build/src/bin/pg_walsummary/tmp_check/t_002_blocks_node1_data/pgdata/pg_wal/summaries/0000000100000000014E0D0800000000155BAF0 >> # 1.summary": No such file or directory' >> >> The "examining summary" line is generated based on the output of >> pg_available_wal_summaries(). The way that works is that the server >> calls readdir(), disassembles the filename into a TLI and two LSNs, >> and returns the result. > > I'm discouraged by "\n1" in the file name and in the > "examining summary..." message. > regress_log_002_blocks from the following successful test run on the same > sungazer node contains: > [15:21:58.924](0.106s) # examining summary for TLI 1 from 0/155BAE0 to 0/155E750 > [15:21:58.925](0.001s) ok 1 - WAL summary file exists Ah, I think this query: SELECT tli, start_lsn, end_lsn from pg_available_wal_summaries() WHERE tli = $summarized_tli AND end_lsn > '$summarized_lsn' is returning more than one row in some cases. I attached a quick sketch of an easy way to reproduce the issue as well as one way to fix it. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com --/04w6evG8XlLl3ft Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="repro_and_fix.patch" diff --git a/src/bin/pg_walsummary/t/002_blocks.pl b/src/bin/pg_walsummary/t/002_blocks.pl index 40908da8cb..5609b1bd14 100644 --- a/src/bin/pg_walsummary/t/002_blocks.pl +++ b/src/bin/pg_walsummary/t/002_blocks.pl @@ -64,10 +64,16 @@ SELECT EXISTS ( ) EOM +$node1->safe_psql('postgres', <safe_psql('postgres', 'SELECT pg_sleep(1);'); + # Figure out the exact details for the new summary file. my $details = $node1->safe_psql('postgres', < '$summarized_lsn' + WHERE tli = $summarized_tli AND end_lsn > '$summarized_lsn' ORDER BY end_lsn LIMIT 1 EOM my ($tli, $start_lsn, $end_lsn) = split(/\|/, $details); note("examining summary for TLI $tli from $start_lsn to $end_lsn"); --/04w6evG8XlLl3ft--