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.96) (envelope-from ) id 1vpPez-007mZP-1v for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Feb 2026 11:42:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vpPex-00AKNn-16 for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Feb 2026 11:42:31 +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.96) (envelope-from ) id 1vpPex-00AKNf-01 for pgsql-hackers@lists.postgresql.org; Mon, 09 Feb 2026 11:42:30 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vpPeu-00000001Gc7-1Sa0 for pgsql-hackers@postgresql.org; Mon, 09 Feb 2026 11:42:29 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-4362c635319so2387435f8f.2 for ; Mon, 09 Feb 2026 03:42:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1770637347; x=1771242147; darn=postgresql.org; h=message-id:date:mime-version:comments:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=5kd/vx827k//6Ol1aVm/VP5SFrDPT9NJcOayCK9B7X8=; b=bO++714UZbVMu1DuEcfKkowZyS+t2N9rDIHkPN5qBCqTLPV5OK7AZnOq2jNLvxbRYk nbmx+1LN2FBXDIUjhFKL5bYM2ALSTCYtaWxtDq7bmCJAcS/d/tFm0vwVxZevC7/KDZWr iZpqg02okA9UFNA3iAt5bNTeHEnnrdVyrjJc2Eem1CswcIeYzCg9wODI24wQxsK3fmpx de+XnxU4EHiA3BZEmWAvTFEXcT8v1t2j+2579dCQQ6hsfZoH99oGr0fkh9OORlWoZEI4 E/VQHGss0gbaUgdVwcKp+uQLCuHNU2Ib1annZu3BQH3nrCBmrqa31fpz9T8W8aeDt/ci Qcfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770637347; x=1771242147; h=message-id:date:mime-version:comments:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=5kd/vx827k//6Ol1aVm/VP5SFrDPT9NJcOayCK9B7X8=; b=l3DoMo5S3lbaFYEgoQO9K8C8h0EXzzXh9gS3ZHJgdV0RIDWP1s918wfbFZCGCl9r4q gJnGovd9i9VmdJqe2lvqtW25GUMFficoo+t0yzGL1cEEaSpzQVCdYttdhAH5I5D45nNe IkO19i/ulXWsiZM4gVqpk/H7BZo5b5AlrS+62a8/fjNqHftIFYviQaozmuzffifFr8Pl 74Pip8JaevYn+1NZe5gGmCKTX21Q7RmD+KXTPMg2HJG/v1bT98bI5/w9KL+zLMLNT1Wu ui08uuzRspSjdymKNVi1iFnAt+KbUAJzPTjWIOGGvCqiVqyBXeA1u8fLkIxSRBeTgtNW Obzw== X-Forwarded-Encrypted: i=1; AJvYcCWI6KrtpMDAKrN3QGy1PGyL/NRnXhG+wf+2rUDpmGTrZWkdL94cKpor9eEfPKZ/IQNlftkTKVhMB+NBGAw1@postgresql.org X-Gm-Message-State: AOJu0Yy3HKh+N+VJhdgbJ/O9ADcmp23TSMPXOBd7sxl3cRXhK48kV5IZ GGSAkF+DgrAoNveKLOuSOBXW2KWKPYXuuGc5x8aMfDo4Sz7TkbH2H2MFIiz4s+cJ+eI= X-Gm-Gg: AZuq6aJ0o6jkLB+/6LG6cYqKPM6WgNM079NGaXPKq3msr9f3TE1vPfBITZR/z2x8pO4 1IlY1DI2mu0FZsbk0CzY9aOnEW+xcX6Y/xYIiYs4tfAVHYzdAtjfFllJ1BruXx1+Dyo+/LROWKV GpSkphn9rWR+LwABoS3UrIKmRWIGvXALgHcQxgHVMivZU87MGFpHwfmVmtHd8e5B8coAClhDFb1 LkmMMDnXwhaL5MGvUruPdnzBGiU+ci/OmIu7D3wBnTnQaBAwqEPFtJsBLOzfD6VAvktOYX+xKbH LO/rQA1vReY9AynWrN7NgtSyD5RWhTNF/epWSxighEj9qw6/AYFxCnW732+jARrgc6uqbAthL92 3C5zMX/PYPa1bZrDkAaVoLg3qVKso14AwbvUn2wcLVrf7lDJ6E1ZPV9OMdZTGjNph2gXpFr4CS6 2II/ckuNf0E8GzsUtGHwk7+JuJ X-Received: by 2002:a05:6000:26c9:b0:436:1a23:3949 with SMTP id ffacd0b85a97d-4362904660amr15480470f8f.10.1770637346552; Mon, 09 Feb 2026 03:42:26 -0800 (PST) Received: from localhost (109-81-168-246.rct.o2.cz. [109.81.168.246]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-436296bcdfcsm27380863f8f.10.2026.02.09.03.42.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Feb 2026 03:42:26 -0800 (PST) From: Antonin Houska To: Andres Freund cc: Kirill Reshke , Heikki Linnakangas , Melanie Plageman , Matthias van de Meent , pgsql-hackers@postgresql.org, Thomas Munro , Noah Misch , Robert Haas , Michael Paquier Subject: Re: Buffer locking is special (hints, checksums, AIO writes) In-reply-to: References: <1108f18d-cf7c-4f17-b29c-a119fe42f7e5@iki.fi> <5dwlfu2jyzkyf3nrlzxxblxctb6xio5es73ptgsahjnmfu5miu@772rc764hfhi> <4csodkvvfbfloxxjlkgsnl2lgfv2mtzdl7phqzd4jxjadxm4o5@usw7feyb5bzf> Comments: In-reply-to Andres Freund message dated "Mon, 12 Jan 2026 19:33:56 -0500." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Mon, 09 Feb 2026 12:42:25 +0100 Message-ID: <61812.1770637345@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=-=-= Content-Type: text/plain Andres Freund wrote: > On 2026-01-12 12:45:03 -0500, Andres Freund wrote: > > I'm doing another pass through 0003 and will push that if I don't find > > anything significant. > > Done, after adjust two comments in minor ways. I suppose this is commit 0b96e734c590. While troubleshooting REPACK issue [1], I realized that HeapTupleSatisfiesMVCCBatch() can also be called during logical decoding - in that case we need to use a historic MVCC snapshot. My proposal to fix the problem is attached. [1] https://www.postgresql.org/message-id/CADzfLwWNv5QDn6qmxCRV-p_ijSTGwNcEZFCOXt09+RmpSG2=+w@mail.gmail.com -- Antonin Houska Web: https://www.cybertec-postgresql.com --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=fix_batch_visibility_checks.diff diff --git a/src/backend/access/heap/heapam_visibility.c b/src/backend/access/heap/heapam_visibility.c index 75ae268d753..685a938bd68 100644 --- a/src/backend/access/heap/heapam_visibility.c +++ b/src/backend/access/heap/heapam_visibility.c @@ -1628,7 +1649,7 @@ HeapTupleSatisfiesMVCCBatch(Snapshot snapshot, Buffer buffer, bool valid; HeapTuple tup = &batchmvcc->tuples[i]; - valid = HeapTupleSatisfiesMVCC(tup, snapshot, buffer); + valid = HeapTupleSatisfiesVisibility(tup, snapshot, buffer); batchmvcc->visible[i] = valid; if (likely(valid)) --=-=-=--