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 1tqV9s-005tOd-Fd for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Mar 2025 10:42:24 +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 1tqV9r-00G9Tf-7x for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Mar 2025 10:42:23 +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 1tqV9q-00G9Rk-Pz for pgsql-hackers@lists.postgresql.org; Fri, 07 Mar 2025 10:42:22 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tqV9o-001TjA-2B for pgsql-hackers@lists.postgresql.org; Fri, 07 Mar 2025 10:42:21 +0000 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-391342fc0b5so690482f8f.3 for ; Fri, 07 Mar 2025 02:42:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741344139; x=1741948939; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=CdnD4TVUkgEJ+4E4X5PeRYWLbpSC+QTRDAmJhYv0JAE=; b=OkP6u2bT6Or932iwN51fToX8IiAoyOmU9gvOPvrDR9ZbEb/TD4yyOkCHtH1OjL7ouU 7YDHzUKrywZXB0XgUPX8jIUaKGsPfQa6tZ7Tyygcfd8UD7FJhVYMXSqbChws4MHww5KL 8dsC5S/HW/RTqdgW8UVL3kDus7f45RWp0DN5BCMsxL2ZQjdcWPmOcqYU2yn5GDEUFovG P8U2kx4htz+UYiFbjlRZ0FEPjRxDr17vqlkdr2sUCkvRJbqBOz3rZOpBBiU0JBhBdal7 CUe2E9Z+UUkFt+vH5FPMqX1yTIojMrCnn1NqMHLRVBkc2h79mOsFt+x19lpLZxlAQLHY OP/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741344139; x=1741948939; h=in-reply-to:content-transfer-encoding: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=CdnD4TVUkgEJ+4E4X5PeRYWLbpSC+QTRDAmJhYv0JAE=; b=T07laEcnlE+5ln43DFd/cjfmGH/e9h/6ND3RBT7ob8pteGx0UfJHMWD5MIJ7Yi9y0N Yzw2YbRyU+alvExCaNarvEK31/ptl6rkRYv4ZKmxC4N5AfjzjHDiw99JMP2QX6xt0Wrx 2XunFKz5f9PGb6c9IEMrfZhUxL1ALbB1BoTmaF42o9PPwdqXiGeHohMvQM38EwsBE9d5 LZhhsmXOiC5qSYS9M5n+GwSH5whk2U64FSzFlQkahGKwPS/o85R9nUWZIZBhcwNwrKk+ l9mytJ3NkykVT41cZAZL3vMufTUv0UomxzBueGeV3fB3pCC4CBpuMJvDWST1wXpTeE/S R4YA== X-Forwarded-Encrypted: i=1; AJvYcCXjeneH7xBiC3DeTWUyXaamV9yxvnBB2TzPzbHXdcDq17IUP2Rvfl9lW+p1NnGhigZ1mrarid8H/xrQ8Ppk@lists.postgresql.org X-Gm-Message-State: AOJu0YwQ+ZjMzszrps0rBAEeoaLIBwPsLgxQqnVeWoGiX5b1FZd/gsWF lGNNVlL9B/+vJ9LQSqA4450O2RVL6u41dWWgla2iEmJA+2zkZvup X-Gm-Gg: ASbGnct1+vebfwL3i7y6g8wwHa7ND5otyBdaBQkdixx7LZq0OeetwB0A5Vt0G6YGTkk XXAEDmC+O/ZKk7Thga68Qj4wr+D2Deh2ZQpyoZ/n9Zrbddo3OhGMV0Sy1G3qLwgyR5SZNp2b+VV GOiV9aEskDr9QVmHB7/Aeb7xi5wiwtEN/oa++OPiYAkonwM/9BFkT3Cnh1UCSB+D4CvBXwpMEX5 QMkeQINXYfwq4bvGEgAsiEb0pgwfyy91I990cSjLTNlBI2Rmy6sk9vMDLRjvFhYRQUnfyQm8WeL VGU2dQJju+IDofI9mAEuMbeifXGdRy/LAUxERJT6iZ8SYM1L/ix8u85ZRd9mWMssMKtlx910mfy zPyoHR9aMfui880k3iiu9YRx3BEQjlNp36S4TitF+I7EYV3CPR9GjQKNmX8wE3jCj39L0GmZysa Du X-Google-Smtp-Source: AGHT+IEyIeZkYE7riedomfZVFVXb1hhsDYKhAvdOnYzzck3+DazCD8dchoQT3GIVV5l/BFv2CUOinA== X-Received: by 2002:a05:6000:1564:b0:38d:d666:5457 with SMTP id ffacd0b85a97d-39132da24cfmr2046009f8f.42.1741344139101; Fri, 07 Mar 2025 02:42:19 -0800 (PST) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-181-182.eu-west-3.compute.amazonaws.com. [15.237.181.182]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3912bfdfbb4sm5050828f8f.30.2025.03.07.02.42.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Mar 2025 02:42:18 -0800 (PST) Date: Fri, 7 Mar 2025 10:42:17 +0000 From: Bertrand Drouvot To: Amit Kapila Cc: Masahiko Sawada , Andres Freund , Peter Smith , Peter Eisentraut , shveta malik , Bharath Rupireddy , pgsql-hackers@lists.postgresql.org Subject: Re: Add contrib/pg_logicalsnapinspect Message-ID: References: <5qbxud4pvnvmtuoi7weiizm5hmumxaeohx4vztfhrwlfhyz6rj@buh4435mllwo> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="dbJN0IdEymweUBIK" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --dbJN0IdEymweUBIK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi, On Fri, Mar 07, 2025 at 10:26:23AM +0530, Amit Kapila wrote: > On Fri, Mar 7, 2025 at 3:19 AM Masahiko Sawada wrote: > > > > On Wed, Mar 5, 2025 at 4:05 AM Bertrand Drouvot > > wrote: > > > > > > Hi, > > > > > > On Wed, Mar 05, 2025 at 02:42:15PM +0530, Amit Kapila wrote: > > > > On Wed, Mar 5, 2025 at 12:47 PM Bertrand Drouvot > > > > wrote: > > > > > > > > > > Agree, PFA a patch doing so. > > > > > > > > > > > > > It would be better if you could add a few comments atop the > > > > permutation line to explain the working of the test. > > > > > > yeah makes sense. Done in the attached, and bonus point I realized that the > > > test could be simplified (so, removing useless steps in passing). > > > > > > > Thank you for the patch. > > > > The new simplified test case can be pretty-formatted as: > > > > init > > begin > > savepoint > > truncate > > checkpoint-1 > > get_changes-1 > > commit > > checkpoint-2 > > get_changes-2 > > info_catchange check > > info_committed check > > meta check Yes. > > IIUC if another checkpoint happens between get_change-2 and the > > subsequent checks, the first snapshot would be removed during the > > checkpoint, resulting in a test failure. Good catch! Yeah you're right, thanks! > I think we could check the > > snapshot files while one transaction keeps open. The more simplified > > test case would be: > > > > init > > begin > > savepoint > > insert(cat-change) > > begin > > insert(cat-change) > > commit > > checkpoint > > get_changes > > info_catchange check > > info_committed check > > meta check > > commit > > > > In this test case, we would have at least one serialized snapshot that > > has both cat-changes and committed txns. What do you think? Indeed, I think that would prevent snapshots to be removed. The attached ends up doing: init begin savepoint truncate table1 create table table2 checkpoint get_changes info check meta check commit As the 2 ongoing catalog changes and the committed catalog change are part of the same snapshot, then I grouped the catchanges and committed changes checks in the same "info check". > Your proposed change in the test sounds better than what we have now > but I think we should also avoid autovacuum to perform analyze as that > may add additional counts. For test_decoding, we keep > autovacuum_naptime = 1d in logical.conf file, we can either use the > same here or simply keep autovacuum off. When writing the attached, I initially added extra paranoia in the tests by using ">=", does that also address your autovacuum concern? Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com --dbJN0IdEymweUBIK Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v3-0001-Modify-pg_logicalinspect-isolation-test.patch"