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 1s8SSa-00CnZT-OJ for pgsql-bugs@arkaria.postgresql.org; Sat, 18 May 2024 22:23:26 +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 1s8SSZ-00AYLU-QT for pgsql-bugs@arkaria.postgresql.org; Sat, 18 May 2024 22:23: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 1s8SSZ-00AYJB-0b for pgsql-bugs@lists.postgresql.org; Sat, 18 May 2024 22:23:23 +0000 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s8SSS-000sg8-0T for pgsql-bugs@lists.postgresql.org; Sat, 18 May 2024 22:23:21 +0000 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6f0f0494459so751220a34.0 for ; Sat, 18 May 2024 15:23:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1716070995; x=1716675795; darn=lists.postgresql.org; h=user-agent: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=ZP4iMRCeUPXGLZjTac6wtnnXaiBDPkgTvTIJq2T52f8=; b=KTLaWLeC68Pk3Wt9j0Ho6wUO73tDjUJb6vQo+gdFWdSPzHQdeTL9ZT2FQeP2MdzK62 I432BcHcs+Iog5jooOWWRENgivkHkVr/2E6qoiAoQjskgeJvZuKxJSR7uzY1mV0HHQoI RFxGNZk21aH0ptC0NQFHOORZhg3pmYjG5NF64= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716070995; x=1716675795; h=user-agent: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=ZP4iMRCeUPXGLZjTac6wtnnXaiBDPkgTvTIJq2T52f8=; b=be7FQts8ZyzyoJoO4EWF6ld27ppqjl8Ok9lhDP+zahAwW7amYKYUqBPhhqKmWKpZGD CbRKlpFAn3l50u2qKu9AF/127sFDlwoqe87bWlQS64bIdCAXCwiK5Hixkdo1vcusYDk2 M+pYpdcxqnptp4Lp2TMORXSyvnrMekxQrbUkDWtRRACcP90xEKrjRbgG0ClbB7C6XtW/ ZzCbPbeyTZh3AjFxV1G0SlBiJMyvoOrckxXIOXT3ac2OfcLzj/mVV9MGYzbsYDmBsaSP Dssf4U60TuF9aawGW21P8ky2bv7zzXve4ZAV/nTQ1qrN3qxwYEMiimpHp6ELCek+yj3N dExQ== X-Forwarded-Encrypted: i=1; AJvYcCWekiA17RFYqN1F0GfgP3wcTjGPZQ7Ii0VPdGj5b2AXeKdlW3N+6/adL/sH2whejHWlduBXVD2Z7lAYhzPRv1LxGsLbj9j50MNEbX0Yn2po X-Gm-Message-State: AOJu0Yz2WadAqvhjRJ0mPt9If8vJOXPjQ6GKLQzNMm3ug6YQ5PEyOr1h SrONaicV1720bJeCt9fkk/gEgpLz2akxvda68xpeJOumQz7lXjDOtNmRPbrKnQ== X-Google-Smtp-Source: AGHT+IEGdBnMu6ybY7ZjaEJt1zDb8+fAi1/OLxvb/FYCsHbEJsSgdOnRAmln2BrGOKtJAiZQZ82Ocg== X-Received: by 2002:a9d:7d17:0:b0:6ed:e4fc:b78e with SMTP id 46e09a7af769-6f0e9292552mr28873747a34.26.1716070994948; Sat, 18 May 2024 15:23:14 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-6f0e7471924sm3365532a34.17.2024.05.18.15.23.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 May 2024 15:23:14 -0700 (PDT) Date: Sat, 18 May 2024 15:23:11 -0700 From: Noah Misch To: Melanie Plageman Cc: Andres Freund , Robert Haas , Matthias van de Meent , Peter Geoghegan , Alexander Lakhin , PostgreSQL mailing lists Subject: Re: relfrozenxid may disagree with row XIDs after 1ccc1e05ae Message-ID: <20240518222311.6b@rfd.leadboat.com> References: <20240415185233.65x57tbdybj4kqbg@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 Thu, May 16, 2024 at 07:57:27PM -0400, Melanie Plageman wrote: > On Thu, May 9, 2024 at 5:56 PM Melanie Plageman wrote: > > I can repro the hang on 14 and 15 with the following: > I'll probably add more robust comments to the test next week in > preparation for writing a detailed commit message for the fix > explaining the scenario. Are there obstacles to fixing the hang by back-patching 1ccc1e05ae instead of this? We'll need to get confident about 1ccc1e05ae before v17, and that sounds potentially easier than getting confident about both 1ccc1e05ae and this other approach. Regarding getting confident about 1ccc1e05ae, I think I follow the upthread arguments that it does operate correctly. As a cross check, I looked at each mention of oldestxmin in vacuumlazy.c and vacuum.c. Does the following heap_vacuum_rel() comment need an update? /* * Get cutoffs that determine which deleted tuples are considered DEAD, * not just RECENTLY_DEAD, and which XIDs/MXIDs to freeze. Then determine * the extent of the blocks that we'll scan in lazy_scan_heap. It has to * happen in this order to ensure that the OldestXmin cutoff field works * as an upper bound on the XIDs stored in the pages we'll actually scan * (NewRelfrozenXid tracking must never be allowed to miss unfrozen XIDs). * * Next acquire vistest, a related cutoff that's used in pruning. We * expect vistest will always make heap_page_prune_and_freeze() remove any * deleted tuple whose xmax is < OldestXmin.