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 1vVFlA-00HD6j-2R for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Dec 2025 21:05:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vVFl9-002Vh5-2I for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Dec 2025 21:05:36 +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 1vVFl9-002Vgx-1O for pgsql-hackers@lists.postgresql.org; Mon, 15 Dec 2025 21:05:36 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vVFl8-000vde-06 for pgsql-hackers@lists.postgresql.org; Mon, 15 Dec 2025 21:05:35 +0000 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-6418738efa0so7867485a12.1 for ; Mon, 15 Dec 2025 13:05:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765832731; x=1766437531; 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=cpiK2o456/0EQJTArFbcf9G2Mt3rPnqBu3fvnWpQf30=; b=QDR1okZHls0cJ6bOKaP7GqS2eJaX0zIAgGIzikIk1dyls35ZWisK2NhNHLgQ0GYyyB RWves0qSdfovPxd2fvoZXzbOrUEmrih8WHqeHJak2CEdHZKqf4G2cc1ekqmFfxC9uZph UkcGCa1cdTXybLewBDLatNenUhrwR5syhvvWx9P6eIhtuaXC1uwl7/1b+ipm6PJmERlL Sm5Kw39OSSRjVpcwVqJ7sJKskXkVTn1nVzsCvFVbhqcism2eNaGP/hHu1aVe/ThcuigH vd8c4pxHOeYm5b71nYcSsDnTyfrcIEkBsWjYZ0G+cGi0ceHETzeVY5CsfYyObu0F7Sci BAlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765832731; x=1766437531; 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=cpiK2o456/0EQJTArFbcf9G2Mt3rPnqBu3fvnWpQf30=; b=JRyPgZ23Z0pQ71liNF7Ye2V5IA/4yB0ZKOZgtm7kRbEW/Qrlq84vC4zjnmlOhf+E+1 2MuPf5ROhhYvcx2C6wdE+6eKdxlVLEzkUYtBhn7LqUI55UDyDwPusS6ikoOl9lfnvjIO Y+AHDWnr/iJXsJpejsinG0awUwrvtsBzosSRFCu7NQJ+bmTc3beBaKgGjZnOEYCaWALz AZXTouN6g46PwngRZGXKmwmCBhDZ/nVPYwJJYr8ADHUZAXQkkLH/zoxalK/+LOnWmNxS CPktFbh/wvPDTRuH4cmpseRGDWu4zWOb5ppgxkFdAJqMZWjnKXVJime93hOu41EkwQml jmkg== X-Forwarded-Encrypted: i=1; AJvYcCUSQCdVg2zBRW1t+dDzfmdd3u42cn4+fV+gncm0XO9EDCfnkWjXSbrbjhYRG4bFlw4uzWziwG1BG3owhtMm@lists.postgresql.org X-Gm-Message-State: AOJu0Yz8cpmMb1s3dP5SQ8Sqi6YaK2Fi1xWn7xPBie7UFNkE20oek1YU FQLvOnEv+AOeQx652byjSiK/iB6L9cXSgVOxHxxiJH5oRHp2ZC5vBBfEqVaI+mCzLay/RbUBDX+ haHWNo2xjD6KhiUGRfW9MWnARazJc4Vc= X-Gm-Gg: AY/fxX7n8Fjkzg7lFBLEzgA6oPTdLHpESJuFjyNDRoa/jnj/EKJrADNTccVviGK1RKK HhVW4H86/x4YBFnbpoL8hndT0VwoawOPrxTTDfmrcVGdhtmQcQRlM6FfvaUSEj4qZ3Y+sxyrZZw wAOzJ0MOQoOQqtoVxPWoiryKast7XPYMayKpKpTSVYDMQBInJ1lWaC9P5N48/OuaYFDD+hyrsuJ 5l2VbFAQB0UBvUDWTNoRL8VMdmQkcTpFmkzOPIMTweJ4v6Nv7esedySn1WIR5LvX8o/zQELlppF qnh+p8M= X-Google-Smtp-Source: AGHT+IFKb+4cwmHB/hJQQXyigK+mApqEAJrChkv/F/NsxzLsx2NkEKDEAqigCYU8zggWMUlBWd5BHC0vCNIMGd7gkXE= X-Received: by 2002:a05:6402:2685:b0:640:9db5:ba2f with SMTP id 4fb4d7f45d1cf-6499b1f8e75mr11665386a12.30.1765832730973; Mon, 15 Dec 2025 13:05:30 -0800 (PST) MIME-Version: 1.0 References: <2wk7jo4m4qwh5sn33pfgerdjfujebbccsmmlownybddbh6nawl@mdyyqpqzxjek> In-Reply-To: From: Melanie Plageman Date: Mon, 15 Dec 2025 16:05:19 -0500 X-Gm-Features: AQt7F2qZvcOC3YwcrCCimpfHyz8l9sBiBPJxoE4_BOl5ROVW_MQq2kitH8PGTFs Message-ID: Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) To: Peter Eisentraut Cc: Andres Freund , Robert Haas , Andrey Borodin , PostgreSQL Hackers , Heikki Linnakangas , Kirill Reshke 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 On Sat, Dec 13, 2025 at 8:59=E2=80=AFAM Peter Eisentraut wrote: > > On 20.11.25 18:19, Melanie Plageman wrote: > > + prstate->deadoffsets =3D (OffsetNumber *) presult->deadoffsets; > > In your patch > v22-0001-Split-heap_page_prune_and_freeze-into-helpers.patch, the > assignment above casts away the const qualification of the function > argument presult: Yea, this code (prune_freeze_setup() with a const-qualified PruneFreezeResult parameter) is actually already in master -- not just in this patchset. > +static void > +prune_freeze_setup(PruneFreezeParams *params, > + TransactionId new_relfrozen_xid, > + MultiXactId new_relmin_mxid, > + const PruneFreezeResult *presult, > + PruneState *prstate) > > (The cast is otherwise unnecessary, since the underlying type is the > same on both sides.) > > Since prstate->deadoffsets is in fact later modified, this makes the > original const qualification invalid. I didn't realize I was misusing const here. What I meant to indicate by defining the prune_freeze_setup() parameter, as const, is that the PruneFreezeResult wouldn't be modified by prune_freeze_setup(). I did not mean to indicate that no members of PruneFreezeResult would ever be modified. deadoffsets is not modified in prune_freeze_setup(). So, are you saying that I can't define a parameter as const if even the caller modifies it? I'm fine with committing a change, I just want to understand. - Melanie