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 1vVwF7-009uN5-35 for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Dec 2025 18:27:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vVwF6-00FecB-2p for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Dec 2025 18:27:21 +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.96) (envelope-from ) id 1vVwF6-00Fec2-1s for pgsql-hackers@lists.postgresql.org; Wed, 17 Dec 2025 18:27:21 +0000 Received: from mail-qv1-xf33.google.com ([2607:f8b0:4864:20::f33]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vVwF4-001HAe-2f for pgsql-hackers@lists.postgresql.org; Wed, 17 Dec 2025 18:27:21 +0000 Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-88a35a00502so38841456d6.0 for ; Wed, 17 Dec 2025 10:27:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765996037; x=1766600837; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=D3w8jHXtnSmXcNnbPlee2vlZ6qOg/VXoLdbhbMBNsXs=; b=Z+Ao1Csw+lfeZFr8I/7k7j9t58B6wmcP8/W68IjUYiXIiX6jh9G65l+/Gj7j7BYqLT 4XM4MP3CMD0lHTasvdPdKhq36vAR1yU1a5iLASFQMEPrIlTB7Fs24rnGmXleHag8BzW+ K6efwBEWBAegPHi8rYI4UDK9VBBW4z3QMz7hkcLV7bNxoIRkdN06eFmTbIc2s8FYWX8X hkrMHdyyigKXJ0soYDWuNHZsbRGP4AIK6SJPLEFDsc2B5RuFwJX5Se6ldAFAeA6hsQaY NZdfTPqfax2kvptGPwfR3z73fEPxe5/ErKV4rjA6VsqEIEFKSlHpE2IFfV98wEuMF1nM Grzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765996037; x=1766600837; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=D3w8jHXtnSmXcNnbPlee2vlZ6qOg/VXoLdbhbMBNsXs=; b=hLkG7oe2i6lVso6EpWGdgiqa8+yLV2OS1nmTYf0UoIvSZb3Tvm0jMM1e5hNDhi5IjF hX5dC6JgKmiiKn0O5JkTdhPToefQEMnduFFHnmp8Wg7N/4G2Wuyuwm2NnNP3pf8hqRd0 nKiTinO+nufxYqW4hwKhtgORDK89Pfmtbfn//e5RzAPwyl5FZAu7+7jkmf6Y6qKk8AKn Sjhs9UoTJemFXjoBCab4VZb/XyZTuN8nBHESK4jQJQvrf5h6yT/u+YcIKdg4C8XawzCt lSCy6h/xWDyVjDxCd7I82386AA2OnFyH9nVeYHV9Yyl0IPqB9x9ajbNkLZka+tcotMlV 3qxA== X-Forwarded-Encrypted: i=1; AJvYcCX4WMWaXzGIwSifBrn1FrXFsxnz0PehVQKEg6RLWk6WpukcrIKS7/RSQHizc09m8qUI3TjsolQ76f8geL9/@lists.postgresql.org X-Gm-Message-State: AOJu0YwRblvP6phgRT5ehG3xsbRS+HvUL8J7Ga2y+xg90haNqe1EV1Zw DkcEYxJZwuzw/UlhQWGbqFYe522WvKPPK5Drfbh6RWZtNgxTKkJxAhEw3SujoyuFyXXRhCBtc63 ztVtXgcLenOLPZRUW/TYeVec8b1ui28E= X-Gm-Gg: AY/fxX5WlfNjnpKmkIWfNxi17mP4IKwRjRGo85v86oxIcnhw0aImTXV9jNlP4V5b5oU SyJA487z64SghaowEr16ww9MRwvid4kEqv0aqIcq55mCn/5uBrz4oZyvqJRSgSsrWIja/bmrSQb hdCjQfHB3EfhvNyhBdUM5ElHsV93G+AMArv81VP7vmKUXtMDdPOcIv5fRvkZs0a9pdqDgTX1bsj NriILdoZtn0CQq9TTMP/t9LCL0Vbdmz9vP/CHTXfBU/jmyY3b4bJyUMQSXrenljthrndZjKmWTL +Po/aPRN X-Google-Smtp-Source: AGHT+IFGEu7Flh8vsyTM4rKn/1eniM0d+VN6M01hBUM4sOcCVEtxw3V96gYhbXa2c1xePWf5RCpv52M0zqbsNjNfFwo= X-Received: by 2002:a05:622a:54b:b0:4f1:8412:46df with SMTP id d75a77b69052e-4f1d049ff81mr232316841cf.13.1765996036806; Wed, 17 Dec 2025 10:27:16 -0800 (PST) MIME-Version: 1.0 References: <2wk7jo4m4qwh5sn33pfgerdjfujebbccsmmlownybddbh6nawl@mdyyqpqzxjek> In-Reply-To: From: Kirill Reshke Date: Wed, 17 Dec 2025 23:27:05 +0500 X-Gm-Features: AQt7F2o2gwcmjD2uxundoMqRnWDXjWWFke1oiIeVNzVtVTIWTTUvxQeGL4sC5cY Message-ID: Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) To: Melanie Plageman Cc: Andres Freund , Robert Haas , Andrey Borodin , PostgreSQL Hackers , Heikki Linnakangas , Chao Li Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi! in v27-0001: > Melanie Plageman wrote: > > The last vacuum is expected to set vm bits, but the test doesn=E2=80=99= t verify that. Should we verify that like: > > ``` > > evantest=3D# SELECT blkno, all_visible, all_frozen FROM pg_visibility_m= ap('test_vac_unmodified_heap'); > > blkno | all_visible | all_frozen > > -------+-------------+------------ > > 0 | t | t > > (1 row) > I've done this. I've actually added three such verifications -- one > after each step where the VM is expected to change. It shouldn't be > very expensive, so I think it is okay. The way the test would fail if > the buffer wasn't correctly dirtied is that it would assert out -- so > the visibility map test wouldn't even have a chance to fail. But, I > think it is also okay to confirm that the expected things are > happening with the VM -- it just gives us extra coverage. +1 on extra coverage. Should we also do sql-level check that the VM indeed does not need to set PD_ALL_VISIBLE (check header bytes using pageinspect?). v27-0003 & v27-0004: I did not get the exact reason we introduced `identify_and_fix_vm_corruption` in 0003 and moved code in 0004 to another place. I can see we have this starting v25 of patch set. Well, maybe this is not an issue at all... in v27-0005. This patch changes code which is not exercised in tests[0]. I spent some time understanding the conditions when we entered this. There is a comment about non-finished relation extension, but I got no success trying to reproduce this. I ended up modifying code to lose PageSetAllVisible in proper places and running vacuum. Looks like everything works as expected. I will spend some more time on this, maybe I will be successful in writing an injection-point-based TAP test which hits this... [0] https://coverage.postgresql.org/src/backend/access/heap/vacuumlazy.c.gc= ov.html#1902 --=20 Best regards, Kirill Reshke