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 1vVXaH-004sDl-0a for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Dec 2025 16:07: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 1vVXaG-007YzN-0T for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Dec 2025 16:07:32 +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 1vVXaF-007YzC-2g for pgsql-hackers@lists.postgresql.org; Tue, 16 Dec 2025 16:07:32 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vVXaF-000zUn-1J for pgsql-hackers@lists.postgresql.org; Tue, 16 Dec 2025 16:07:31 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-63c489f1e6cso4019167a12.1 for ; Tue, 16 Dec 2025 08:07:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765901250; x=1766506050; 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=d/x5oXlJd2XOPb1BdSRHcGQ60fIM5GeF8n0KBHLBb7Q=; b=Yaqel1qhb4xGh0eTbAkoG/QwxhHy0FM7rRmpZ1ejIHGNvSGAkFKdrM7z3ffH27SFlN di7aqEtNfw2fcypPepcJcdbYcrJbD7EXPpOvQmqStcus5o9Ccw9rLK58Te1Mg/5ppom9 1vZGdIT7sJwmmZpZWFyAHZTjVDbsuWDVqImJo3yfX8YN6DCPji7LMZ1KkCG6MxBde9Bn vn4osJ9XWRoMKu7IKI+7SkMOUqhS42ARAXdEO2jXZ6df12xFOfJnPgElO79Hb1hrIpEH EpYrZBK6uVFnv/rGbZCNxPNkvLAVc8Jm70IUyQw7kaGbJ2bX02wKbAhZ9PwYj3XqwRaj /r/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765901250; x=1766506050; 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=d/x5oXlJd2XOPb1BdSRHcGQ60fIM5GeF8n0KBHLBb7Q=; b=Z17MY11mzisLnmPWYWOOiRDW7mIcUCpDTzAheMLuXhhNGu8ss6WLr8RkjTyD/ARBSz ZJm9EBqNkMHi5AjkNOGrbp3L0G2qfAqmMUyl5O7hQb5HRyQ4PEZ1yg7aPU1IVEDW3SBO fMZ9Ew2u67UE8KImwfA37UcCWmM96Ig+/8WBAZdmDqkHEYZgx0YYf6RUd8plH6+4P50P CjRxCdLXn9/RdN2mQEqipIXoPJiP/pNF+N39gm7Vpf/dx3opUyPqLODnI+MTPXxs5VVS 0w011hGwO/iWUDBasBwu1tCfdKnlsP7LC1FVRPmd6miHCWMddwqZJt2/R1bdgp6bEIpr JcUg== X-Forwarded-Encrypted: i=1; AJvYcCUTJkTlP2UhVxa9WLaBIJerlSiJkYsXEmvk1ymWDDoUC0HlCvKo25S+rUlne4t+A8wJNba+qF51SCZkbFQ6@lists.postgresql.org X-Gm-Message-State: AOJu0YxpPaiTUAHCKvdog38HIQE1uespP+BhHSbU6s/SgpW12CsdmXpo 776qt13sozLB8oIZEWbLrP40snQiGLGuuO9hl7HosM5YfFlj/Caw4Ad4UXNzLxG09ho2jSqC054 t8MYm124cUNP++T4bwJ6CPo2+IzTtOu4= X-Gm-Gg: AY/fxX7dhyws061CxBI3JSrud+nJ7bsZUJdBvkyONSX1IJ7ijmZc9p/7otHjFGdcyBU DsSb6QhR9bXOHZwhUtJRInKa9oj0vRFWWtec0AOIxPgibj6WlcgyHNUz5wXAs4InYEysds0Ctmw 3xLpIFbBM4NXGmFEO3mgIbSxHtymnEO4fJOB281nLRQ2ltSAmSHgFdr0IuwWCSMrS/QP1OV5SeO htiJfe8W9wnGAEGuTwm72c/PbozjM01eJ3zMTfIatUYGdc4Is8zB4t5cmP65MIByFUTbXkp X-Google-Smtp-Source: AGHT+IH3OyDkc4qhS5bglpeghFNYu0KpCHwU/WZpPinQcehiEh3uXi0SC7PFjDf1b1wKMATvlRcVeT1uBgZ/FRoUhuI= X-Received: by 2002:a05:6402:3492:b0:640:b625:b920 with SMTP id 4fb4d7f45d1cf-6499ad4d439mr15346782a12.6.1765901249309; Tue, 16 Dec 2025 08:07:29 -0800 (PST) MIME-Version: 1.0 References: <2wk7jo4m4qwh5sn33pfgerdjfujebbccsmmlownybddbh6nawl@mdyyqpqzxjek> In-Reply-To: From: Melanie Plageman Date: Tue, 16 Dec 2025 11:07:17 -0500 X-Gm-Features: AQt7F2oFfxuetBANVyL90y_xSUXhIloyIalD4UWpCfmtNNj6jJvlsM09rmcVjzg 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 Tue, Dec 16, 2025 at 7:18=E2=80=AFAM Peter Eisentraut wrote: > > You are not modifying deadoffsets in prune_freeze_setup(), but you are > assigning its address to a pointer variable that is not const-qualified, > and so it could be used to modify it later on. > > A caller to prune_freeze_setup() that sees the signature const > PruneFreezeResult *presult could pass a pointer to a PruneFreezeResult > object that is notionally in read-only memory. But through the > non-const-qualified pointer you could later modify the pointed-to > memory, which would be invalid. The point of propagating the qualifiers > is to prevent that at compile time. Thanks for the explanation. I've committed your proposed fix. - Melanie