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 1sLv0h-00HI2J-Hp for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jun 2024 01:30:15 +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 1sLv0e-00D8sK-Py for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jun 2024 01:30:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sLv0e-00D8sB-7S for pgsql-hackers@lists.postgresql.org; Tue, 25 Jun 2024 01:30:12 +0000 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sLv0a-003OgJ-Po for pgsql-hackers@postgresql.org; Tue, 25 Jun 2024 01:30:10 +0000 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6f8ef63714cso3022855a34.1 for ; Mon, 24 Jun 2024 18:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1719279006; x=1719883806; darn=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=TTsUGkBCf7zDO6qk8DLje3t5R588JLk9i6G7XdEEDIg=; b=J9zSp+I+/K5tHGzDAzd8TtAUybu8Lx0v4UBa4pIs6gZAznn0bstC7bGv1QqtBu18vl gb3FBtIXcQ3xIf3F89z6eXiLvrIr3NCoFZLuevAy1n/TvJZ69mWS4ENjLqm0nWHfNAss j7nIcRet8gyKTMfePJ9kDIkLUzmGa6TQbO5Ws= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719279006; x=1719883806; 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=TTsUGkBCf7zDO6qk8DLje3t5R588JLk9i6G7XdEEDIg=; b=eny9GUZ9g+MkQCdBu3Fg1XkXDMyrMLqhtS4vhlzteWTVKxxfVhcKNBhycq2rGiYDO6 9BXYPBvNgOuV+0Y8iFGIWyq9WbBmU5hA/4/R7W45xjRtYZX3FKj1QwDmpYDaAf4lNZUW RNeDeapm4fYAO0bnkwH7qhr5OWz7A4h8/bBm1DfQ/3dc6krmjKlGEq7k9qRI13aMEhiJ iAmuFeG5I/NSYet6vIvLnd02bk3YzJnifq+HbXfIw8I71uzNh+Ldkj15sGzZSL0fAywP 3300UTf18r3IusRvOSSMUSQ1MBDj1h90VIx3Ol5Du7aOdSSneIVjcoC94nD0IMGrh7F0 12jA== X-Forwarded-Encrypted: i=1; AJvYcCX+MXiL27o/QRQblosixois2urjHR8sawyTuDvqaAb2R0DAl9KKe4aXnUNSZCnjRMZQDFcUJgIdsui7W2w4li+DZ5P8c+/zFPXPNK+R X-Gm-Message-State: AOJu0YwvND0zapXAqUkVcZlSNxT5t/3R8o+j4tj4vLDZ8rLthMLtrSf/ gqCf+0QbFHUnUmL1ViL+jz2zQ9DbPaMiSTh8tGyzcyIjNC76bJEx79zFtN4jLw== X-Google-Smtp-Source: AGHT+IHZvilBKD9JYbHs8n94KAsxv0gzUGsdXh5WYrxyvavbjdK1OJDBO++fRaG2tHAAdQxN2tfsuw== X-Received: by 2002:a05:6830:1d84:b0:700:5090:7081 with SMTP id 46e09a7af769-700b11880fdmr6742432a34.7.1719279006578; Mon, 24 Jun 2024 18:30:06 -0700 (PDT) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-716b3646913sm5990212a12.15.2024.06.24.18.30.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jun 2024 18:30:06 -0700 (PDT) Date: Mon, 24 Jun 2024 18:30:04 -0700 From: Noah Misch To: Melanie Plageman , Peter Geoghegan Cc: Robert Haas , Pg Hackers , Andres Freund Subject: Re: Vacuum ERRORs out considering freezing dead tuples from before OldestXmin Message-ID: <20240625013004.a8.nmisch@google.com> References: 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 Mon, Jun 24, 2024 at 04:51:24PM -0400, Peter Geoghegan wrote: > On Mon, Jun 24, 2024 at 4:36 PM Robert Haas wrote: > > I'm not sure I understand. The most important thing here is fixing the > > bug. But if we have a choice of how to fix the bug, I'd prefer to do > > it by having the pruning code test one horizon that is always correct, > > rather than (as I think the patch does) having it test against two > > horizons because as a way of covering possible discrepancies between > > those values. > > Your characterizing of OldestXmin + vistest as two horizons seems > pretty arbitrary to me. I know what you mean, of course, but it seems > like a distinction without a difference. "Two horizons" matches how I model it. If the two were _always_ indicating the same notion of visibility, we wouldn't have this thread. On Mon, Jun 24, 2024 at 03:23:39PM -0400, Melanie Plageman wrote: > Right now, in master, we do use a single horizon when determining what > is pruned -- that from GlobalVisState. OldestXmin is only used for > freezing and full page visibility determinations. Using a different > horizon for pruning by vacuum than freezing is what is causing the > error on master. Agreed, and I think using different sources for pruning and freezing is a recipe for future bugs. Fundamentally, both are about answering "is snapshot_considers_xid_in_progress(snapshot, xid) false for every snapshot?" That's not to say this thread shall unify the two, but I suspect that's the right long-term direction.