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 1rwoZH-004LqS-01 for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Apr 2024 19:34:11 +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 1rwoZF-005sF6-IF for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Apr 2024 19:34:09 +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 1rwoZF-005sCE-00 for pgsql-bugs@lists.postgresql.org; Tue, 16 Apr 2024 19:34:09 +0000 Received: from mail-yb1-xb30.google.com ([2607:f8b0:4864:20::b30]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rwoZC-003BEd-Dx for pgsql-bugs@lists.postgresql.org; Tue, 16 Apr 2024 19:34:07 +0000 Received: by mail-yb1-xb30.google.com with SMTP id 3f1490d57ef6-dc74e33fe1bso4317270276.0 for ; Tue, 16 Apr 2024 12:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1713296045; x=1713900845; darn=lists.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=UOOhtf6p+kjCM0/Kuv3s5CpSWj0pG0O+5OOFXYTMBMk=; b=CyRZD4hzfnS4ScOAx0hZ4RXYxP4Gn2Qay03WUxOcFCDPZMtJ3CcOB19pNuJ/tDRjia 3EulXEPWumVHQeaT3cE+CfuRYEs6B/rh9kppfNS2tDt12F3Y4onDdEYxQtJE9A3fhi5O bGSoMpOoO38VmdflMCQtsl7QVcEhYN/U8HXzM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713296045; x=1713900845; 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=UOOhtf6p+kjCM0/Kuv3s5CpSWj0pG0O+5OOFXYTMBMk=; b=r/jbGt4OXUD4Oz843W7XnlaaKrC1rjLBsa+lekjuTOA/l5Gbzx4KRttMsnZ3SIGxGd lNZxAzS+fJtp6OWs/z6gRUvmsvrZu7hGHbLE0DDVmY944bQ3M7j5qrCgxAY2h0fFTFP5 AyeHVnzv+bC9u9/Dp4yh37MNJwiGVBBG8Gklr3CdipKQoz8koq3Cy4IJIh4Us+JtsWkX djXVCzlbIKzhnoj5asdgfzWxGKqcWrWnAJILH/AAeWsOmaYGGFSPBR8vamz7jldTdk7N QL5ghJkdWfaSnEPVl6DV2DXi4KL54D2FNHAyCwGkQr9cZOnWbCdcChOMW3be3KF6jEPu wFUw== X-Forwarded-Encrypted: i=1; AJvYcCUq52emL0iu0FZW+Uun22r1obfk5vBP2FbIYc2cVyTC6caye2ENwR4QL3++6OM+y4pE6ez6A8j1VEdhGWnDcQYn8XMy5If/L7dD1gbX19JS X-Gm-Message-State: AOJu0Yy2LhhQ9tiwHGm38sSW8PpeJK99zzKp/kEyInDa2MvSSIJK19EW yVncBTuYW6c+/61D3XDeu9b1cUCsTeg3nTB6EF76YbamZR8uLTpbRIb+C8wIug== X-Google-Smtp-Source: AGHT+IEA0VqUPJYhFL7JEuUPcaDGQlDwuXof/yBrgsSbGZlYeGHXRl3c6e00n1g7M3uzq9Fk2qJ6Xg== X-Received: by 2002:a5b:405:0:b0:dcd:905:3d17 with SMTP id m5-20020a5b0405000000b00dcd09053d17mr13444965ybp.32.1713296045539; Tue, 16 Apr 2024 12:34:05 -0700 (PDT) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id u125-20020a256083000000b00dcdb7d232f9sm2629781ybb.4.2024.04.16.12.34.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2024 12:34:05 -0700 (PDT) Date: Tue, 16 Apr 2024 12:34:02 -0700 From: Noah Misch To: Andres Freund Cc: Robert Haas , Melanie Plageman , Matthias van de Meent , Peter Geoghegan , Alexander Lakhin , PostgreSQL mailing lists Subject: Re: relfrozenxid may disagree with row XIDs after 1ccc1e05ae Message-ID: <20240416193402.9a.nmisch@google.com> References: <20240415205204.57.nmisch@google.com> <20240415211020.vyv4oit6bpzldb6y@awork3.anarazel.de> <20240416035825.8e.nmisch@google.com> <20240416180108.febbcxlz2qrqspyd@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240416180108.febbcxlz2qrqspyd@awork3.anarazel.de> 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 16, 2024 at 11:01:08AM -0700, Andres Freund wrote: > On 2024-04-15 20:58:25 -0700, Noah Misch wrote: > > On Mon, Apr 15, 2024 at 02:10:20PM -0700, Andres Freund wrote: > > > On 2024-04-15 13:52:04 -0700, Noah Misch wrote: > > > > I have observed the infinite loop in production with v15.5, so that > > > > non-reproduce outcome is a limitation in the test procedure. (v14.2 added > > > > those two commits.) > > > > > > How closely have you analyzed those production occurences? It's not too hard > > > to imagine some form of corruption that leads to such a loop, but which isn't > > > related to the horizon going backwards? E.g. a corrupted HOT chain can lead > > > to heap_page_prune() not acting on a DEAD tuple, but lazy_scan_prune() would > > > then encounter a DEAD tuple. I've not seen this recur for any one table, so I think we can rule out corruption modes that would reach the loop every time. (If a hypothesized loop explanation calls for both corruption and horizon movement, that could still apply.) > > One occurrence had these facts: > > > > HeapTupleHeaderGetXmin = 95271613 > > HeapTupleHeaderGetUpdateXid = 95280147 > > vacrel->OldestXmin = 95317451 > > vacrel->vistest->definitely_needed = 95318928 > > vacrel->vistest->maybe_needed = 93624425 > > > > How compatible are those with the corruption vectors you have in view? > > Do you have more information about the page this was on? E.g. pageinspect > output? Or at least the infomasks of that tuple? No, unfortunately. > I assume this was a normal > data table (i.e. not a [shared|user] catalog table or temp table)? Normal data table > Do you know what ComputeXidHorizonsResultLastXmin, RecentXmin were set to? No. > > I tried briefly to understand > > https://postgr.es/m/flat/20240415173913.4zyyrwaftujxthf2@awork3.anarazel.de > > but I felt verifying its argument was going to be a big job for me. Would > > those errors happen transiently, like the infinite loop, or would they > > persist until something resets the tuple fields (e.g. ATRewriteTables())? > > I think they'd be transient, because the visibility information during the > next vacuum would presumably not be "skewed" anymore? That is good. > Of course it's possible > you'd re-encounter the problem, if you constantly have horizons going back and > forth. But I'd still classify that as transient. Certainly.