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 1tzljY-006POX-Cm for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Apr 2025 00:13:32 +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 1tzljX-008FgM-4S for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Apr 2025 00:13:31 +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 1tzljW-008Ffg-Jj for pgsql-hackers@lists.postgresql.org; Wed, 02 Apr 2025 00:13:30 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tzljU-002S7O-1N for pgsql-hackers@postgresql.org; Wed, 02 Apr 2025 00:13:29 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-224191d92e4so116399765ad.3 for ; Tue, 01 Apr 2025 17:13:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1743552807; x=1744157607; darn=postgresql.org; h=user-agent: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=DmbCnxc6sDLvPOkzLShIg+Cf47BOxvL5XDINQUVMe28=; b=B1FCROnxKwU9danF4Rt7x3RDtbpmrZGCJdnmFYGuE7oCkXo5kzipaAYKIk71/dGHcD jW2NkpXuiC726xweLfp5ouBtxGM1ZtcNXqYuxiQKrM8YQ2klzHXeGnB0dNS6At5taMAi okogr7ZwMAmovkytIYFIrNoYv3mDh/SfAP494= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743552807; x=1744157607; h=user-agent: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=DmbCnxc6sDLvPOkzLShIg+Cf47BOxvL5XDINQUVMe28=; b=wKWQjGk4DaWJ6DsAg6GmbSVD910I9lt02v2uHBBFoUcXjbeoAvx1HRhCO3y1x9M8wK 7BmJ7odsBFbkCUA2cfW6+tdCQzD47BzKFL5+G9jaxEfVOYgAIptmEa64QoFmhdp5ruz9 1YpH6TLJG7brChTm08FV19spRGeoLf8cUcnicQ99+8SXL2sSMpfwmEyeR2O7uwtWu23c RQw3ZlrHZqqh0vbbAfn7Mky3Aiqpx42pYI2CJVtHwYGCyxDbR39I6c3h9h4cRXRovZd7 sQpJoTN+XEoh7Ml5CEbMIy6KY2QN7O5MmMW7DS+kaaw2bw9ozrjqzan7bkG3e9XymG50 cP1g== X-Gm-Message-State: AOJu0Yy9ak7F5EGo2mRwMh5FuLQ4teveqBGuVxBqogr0IYh4bOerZJDd zOBCULUzPCYH/WI8zzBWkzmngePLvsPcrKXp1aNm5jOgW5JFzUfdAM1ENRFoDl5dXM4bpzp2BLW OlA== X-Gm-Gg: ASbGnctqWMfoEagmUe6MvOhED5Inik0/NUVDQMTUyyLcrmREz2t3eaZmlR6u3XQEPN9 zeJImVQ4GvS6mlog1yAQD40w7H8kAa0dnKJP3lQcsBLDWcMdxYu4Z8MK7BX5jQETCW5X5Z191/l 05xS82S2NTVlmAsmmEo6uDpzYqT0NwJaJenxuyv91fqMc7wNo8PhSWA+xOM029EzdXqeNBSy7Rw 5Bjps1HCza9kvRGNxnP/Dc1v+/FjPxMzmq2xlYb915r2nkFPJAUCcV99aiIw8RCgVty09u/2VVZ BootGG6tpI94Lc0b0wEWSpLg08O7+pOYn+omxLBnyA== X-Google-Smtp-Source: AGHT+IE60vQpuS8dZYJvXRY5hEz1ix/BQjK9Bec0lwKKSnqOHOfwhyk23IUAPAI3ky2AjH0gy8Q5HQ== X-Received: by 2002:a05:6a00:228d:b0:736:3c2f:acdd with SMTP id d2e1a72fcca58-739803aa301mr22096912b3a.14.1743552807277; Tue, 01 Apr 2025 17:13:27 -0700 (PDT) Received: from google.com ([2601:647:5600:80d0::31cd]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7397106b02bsm9896397b3a.103.2025.04.01.17.13.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Apr 2025 17:13:26 -0700 (PDT) Date: Tue, 1 Apr 2025 17:13:24 -0700 From: Noah Misch To: Andres Freund Cc: pgsql-hackers@postgresql.org, Thomas Munro , Heikki Linnakangas , Robert Haas , Jakub Wartak , Jelte Fennema-Nio , Antonin Houska Subject: Re: AIO v2.5 Message-ID: <20250402001324.e4.nmisch@google.com> References: <20250329134143.ca.nmisch@google.com> <20250329212929.a6.nmisch@google.com> <7s6fclfekpcxoaaorwrq67v4vmgixf2dcjcgznuj7vxs3ie3wq@okqbi5vabqbx> <20250401151159.51.nmisch@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Apr 01, 2025 at 06:25:28PM -0400, Andres Freund wrote: > On 2025-04-01 17:47:51 -0400, Andres Freund wrote: > > 3) Some subtests fail if RELCACHE_FORCE_RELEASE and CATCACHE_FORCE_RELEASE are defined: > > > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prion&dt=2025-04-01%2019%3A23%3A07 > > > > # +++ tap check in src/test/modules/test_aio +++ > > > > # Failed test 'worker: batch_start() leak & cleanup in implicit xact: expected stderr' > > # at t/001_aio.pl line 318. > > # 'psql::4: ERROR: starting batch while batch already in progress' > > # doesn't match '(?^:open AIO batch at end)' > > > > > > The problem is basically that the test intentionally forgets to exit batchmode > > - normally that would trigger an error at the end of the transaction, which > > the test verifies. However, with RELCACHE_FORCE_RELEASE and > > CATCACHE_FORCE_RELEASE defined, we get other code entering batchmode and > > erroring out because batchmode isn't allowed to be entered recursively. > > I don't really have a good idea how to deal with that yet. > > Hm. Making the query something like > > SELECT * FROM (VALUES (NULL), (batch_start())); > > avoids the wrong output, because the type lookup happens for the first row > already. But that's pretty magical and probably fragile. Hmm. Some options: a. VALUES() trick above. For test code, it's hard to argue with something that seems to solve it in practice. b. Encapsulate the test in a PROCEDURE, so perhaps less happens between the batch_start() and the procedure-managed COMMIT. Maybe less fragile than (a), maybe more fragile. c. Move RELCACHE_FORCE_RELEASE and CATCACHE_FORCE_RELEASE to be GUC-controlled, like how CLOBBER_CACHE_ALWAYS changed into the debug_discard_caches GUC. Then disable them for relevant parts of test_aio. This feels best long-term, but it's bigger. I also wanted this in syscache-update-pruned.spec[1]. d. Have test_aio deduce whether these are set, probably by observing memory contexts or DEBUG messages. Maybe have every postmaster startup print a DEBUG message about these settings being enabled. Skip relevant parts of test_aio. This sounds messy. Each of those feels defensible to me. I'd probably do (a) or (b) to start. [1] For that spec, an alternative expected output sufficed. Incidentally, I'll soon fix that spec flaking on valgrind/skink.