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 1sLvdA-00HLGV-Pn for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jun 2024 02:10:00 +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 1sLvd9-00DJ0y-3d for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jun 2024 02:09:59 +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 1sLvd8-00DJ0D-QV for pgsql-hackers@lists.postgresql.org; Tue, 25 Jun 2024 02:09:59 +0000 Received: from mail-yw1-x112e.google.com ([2607:f8b0:4864:20::112e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sLvd5-002yrF-Sg for pgsql-hackers@postgresql.org; Tue, 25 Jun 2024 02:09:57 +0000 Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-63bb0ff142cso48623817b3.3 for ; Mon, 24 Jun 2024 19:09:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1719281395; x=1719886195; 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=06u+N0nj7jlFrLdGJutCp5WjhjeFJIqvxLjx9BvOrfc=; b=dG+K2H4Q9apva5ryKjKT+uwFe9w1ugyxzoTrmXiWd1LSrAmvuww5LRSsG9Y/QRBPcW 2S9q7JEAMbV37CYdxxPv3u9Yy001B1zwh3uNa1vVFxxHOp3k/D24BAfL//9+gd3AraB7 QtRtcAbCSJfmWi4ep/RqXj0C8wyuGM+eFaTRg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719281395; x=1719886195; 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=06u+N0nj7jlFrLdGJutCp5WjhjeFJIqvxLjx9BvOrfc=; b=MXu/0/2PfhMVZvUxyw2+YNAwPHn3N6d1DM4/5hlN12IRRvZsMlkJmPxM1Yyk0hSAD8 HBiwClRAtBhbI4Z0ZYlrRBuuL5xYcZ+SryIi3GbBBV/EjsM8+7JeseBiricaQ7l5JxIe VEfU1Gis3b6yn5gjmqa4NF1EXZcqCKdtsBIHegfTvcVyATnuluEMzLvN269ZY+FFjyYt mtzCPoNZ4uKsKsk8/cqkKIjlRAKwojLQX5fduGwGpZgGQvylDqG5VfAkBfPnly/Hbzba Dy/5FuTmKsbxsTcmPitRwfhw3IB27uYz91gbqWfLJmB8Kj7LQpU7SDHa5oCAO7qo3dzt OSPA== X-Forwarded-Encrypted: i=1; AJvYcCVrVLgkNUPj+PD3qE9mmNmJDv852cD0TRR3uexvZrKRBR5BGNhXSkqWVadCXT0tIQGnF0isnUXc65XASjRishxTMF5f7tPOdB3e6/Px X-Gm-Message-State: AOJu0YxkqAIT0+6mK8rxPSRG/giw5fyR24JR9Uv+GW9WHevKUoCDpEsw qwTFsE/oKRR04z+BUdLcJgAI9+giqza/ELCVlg2hV5Nf1/qQoqxNFdeCpNW0Pw== X-Google-Smtp-Source: AGHT+IEiBS6S0TJnLKlu/tHN8soN9beK4irr8rSPyi5difDphamrtf7DkF4/7F+nkQ4lBVgzoEhWhw== X-Received: by 2002:a81:9e0b:0:b0:631:3cfc:8537 with SMTP id 00721157ae682-642992fd7e5mr66982427b3.17.1719281395018; Mon, 24 Jun 2024 19:09:55 -0700 (PDT) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id 00721157ae682-63f14a3caa9sm33060867b3.86.2024.06.24.19.09.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jun 2024 19:09:54 -0700 (PDT) Date: Mon, 24 Jun 2024 19:09:52 -0700 From: Noah Misch To: Peter Geoghegan Cc: Melanie Plageman , Robert Haas , Pg Hackers , Andres Freund Subject: Re: Vacuum ERRORs out considering freezing dead tuples from before OldestXmin Message-ID: <20240625020952.9f.nmisch@google.com> References: <20240625013004.a8.nmisch@google.com> 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 09:49:53PM -0400, Peter Geoghegan wrote: > On Mon, Jun 24, 2024 at 9:30 PM Noah Misch wrote: > > 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. > > What does it really mean to unify the two, though? > > If the OldestXmin field was located in struct GlobalVisState (next to > definitely_needed and maybe_needed), but everything worked in > essentially the same way as it will with Melanie's patch in place, > would that count as unifying the two? Why or why not? To me, no, unification would mean removing the data redundancy. Relocating the redundant field and/or code that updates the redundant field certainly could reduce the risk of bugs, so I'm not opposing everything short of removing the data redundancy. I'm just agreeing with the "prefer" from https://postgr.es/m/CA+TgmoYzS_bkt_MrNxr5QrXDKfedmh4tStn8UBTTBXqv=3JTew@mail.gmail.com