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 1rwZxq-002jYE-RC for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Apr 2024 03:58:34 +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 1rwZxp-000dSL-D8 for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Apr 2024 03:58:33 +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 1rwZxo-000dS7-UI for pgsql-bugs@lists.postgresql.org; Tue, 16 Apr 2024 03:58:33 +0000 Received: from mail-yb1-xb36.google.com ([2607:f8b0:4864:20::b36]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rwZxl-0034bF-DJ for pgsql-bugs@lists.postgresql.org; Tue, 16 Apr 2024 03:58:31 +0000 Received: by mail-yb1-xb36.google.com with SMTP id 3f1490d57ef6-dc6d8bd612dso3928767276.1 for ; Mon, 15 Apr 2024 20:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1713239908; x=1713844708; 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=7X2KWWGPGoRGiWYxsXWj15dbzeH5sqj/QtqCoNKfF+k=; b=PXbRKRflTNOsty5GApKB7n1KNmY8XpZd4DyMsHAu+goChVRUITJ5zBqydpKoeBJckQ xXKKxa1hwlIq9Skv8j18CrbjgxkT18zqkP2HPa3p0OqKx33SkKFvWPJYgyUX7d4e1JCY r3KB4+l2CB0kRE8Zgyd3ZWQz+Ch14xN1Fpv3o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713239908; x=1713844708; 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=7X2KWWGPGoRGiWYxsXWj15dbzeH5sqj/QtqCoNKfF+k=; b=IURYFyDUBqLmqbwVvwhpfgTatfKjHfme5io6qojurTEEgfQWFtfUSglYQ0eOkT6F/k Vt7VJ/0T6FlCUQLU8YG+44EnWpdOu2gq9dKAlmJMtfBJXK9DuLuyPpy2UHbspT30oE3I h7d29uk4mPDAUKWI6hi+WspGnmEdTqOB86TvwNRvnm4RbCITOYtSHL/nHCZvPJ98bnAC k2M90u6+EgiO/TPmCtOViCfcH6OOyCP4E65J6ncQdoP2tX/Ar7UFp7ZBFBYihxEyZHby Ja+GD9BGgoNRACVEWQNtzni86FZ1VENNkrwaOBf5SCiYTYWaZ62fqwnjpGjgnFCHTCZi sYaQ== X-Forwarded-Encrypted: i=1; AJvYcCXheM+aTQsFDmROPqUsPHg2SLYp7nnEHR2XYwa6asjPYAHcAqCzZV/09GVU3dMQorbWCQPwLGPQGtYFfBSOSZtglZFcZ+7g30WsD29x9b4h X-Gm-Message-State: AOJu0YxQBNRjUH+E0rwVON+GZvctJmymMFMHgdjdXEZ0lXg4NrZ46Yr8 EtrpjzctpCxEWw7/jOlmT97aPgHjHaIT9Ri/YNKlzd6DVWUzR0kmmM6ayYdB6Q== X-Google-Smtp-Source: AGHT+IFOg0646FV1YXDbVnxUvMPYyVMZ5gI3j517+X4Pe5BqRa8KDViWuWu8nayaV0lmyW5m/PC4Ww== X-Received: by 2002:a25:84c5:0:b0:de0:f754:f2d with SMTP id x5-20020a2584c5000000b00de0f7540f2dmr13159196ybm.44.1713239908374; Mon, 15 Apr 2024 20:58:28 -0700 (PDT) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id e15-20020a25890f000000b00dc6e1cc7f9bsm2245421ybl.53.2024.04.15.20.58.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Apr 2024 20:58:27 -0700 (PDT) Date: Mon, 15 Apr 2024 20:58:25 -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: <20240416035825.8e.nmisch@google.com> References: <20240415205204.57.nmisch@google.com> <20240415211020.vyv4oit6bpzldb6y@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240415211020.vyv4oit6bpzldb6y@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 Mon, Apr 15, 2024 at 02:10:20PM -0700, Andres Freund wrote: > On 2024-04-15 13:52:04 -0700, Noah Misch wrote: > > On Mon, Apr 15, 2024 at 12:35:59PM -0400, Robert Haas wrote: > > > I propose to remove this open item from > > > https://wiki.postgresql.org/wiki/PostgreSQL_17_Open_Items > > > > > > On the original thread (BUG #17257), Alexander Lakhin says that he > > > can't reproduce this after dad1539ae/18b87b201. Based on my analysis > > > > 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. 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? > > > of the code, I suspect that there is a residual bug, or at least that > > > there was one prior to 6f47f6883151366c031cd6fd4011e66d2c702a90. > > > > Can you say more about how 6f47f6883151366c031cd6fd4011e66d2c702a90 mitigated > > the regression that 1ccc1e05ae introduced? Thanks for discovering that. > > Which regression has 1ccc1e05ae actually introduced? As I pointed out > upthread, the proposed path to corruption doesn't seem to actually lead to > corruption, "just" an error? Which actually seems considerably better than an > endless retry loop that cannot be cancelled. A transient, spurious error is far better than an uninterruptible infinite loop with a buffer content lock held. If a transient error is the consistent outcome, I would agree 1ccc1e05ae improved the situation and didn't regress it. That would close the open item. 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())? Thanks, nm