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 1sTQl2-00GCUy-L9 for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jul 2024 18:49:08 +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 1sTQl1-00CLW6-8j for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jul 2024 18:49:07 +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 1sTQjM-00CHTE-2Z for pgsql-hackers@lists.postgresql.org; Mon, 15 Jul 2024 18:47:24 +0000 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sTQjE-002D13-W1 for pgsql-hackers@lists.postgresql.org; Mon, 15 Jul 2024 18:47:22 +0000 Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-36da84df7adso13407815ab.1 for ; Mon, 15 Jul 2024 11:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721069236; x=1721674036; darn=lists.postgresql.org; h=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=MPS8QfdZo3AC8Hr4eUbNKCM1VOr4BgxpkOI5YKXK9bQ=; b=P5kiGv6x2H+LR24WwAjTvLMZFo+l+79fyaZTj3XGWg8QARWWEqMJ0NSmtI+LwPARJx Rqajrs8Vhbon3izX+1ckR5HORIKpkaJ/c6n68KQWTC+Meen+RsBfLZR3Tnfv0m3ZgXDc tn7+puboK5aZazfEn4QbOsNX6LVVMi+BOpRh68su7NYyqDLPJJDyXTC63B28iN2gIufw i0kqe3ZPQShLHr1Q5yj8pi3JmTpLqh46Wi5c5zL92jdDytdkVAfDSDyFUh51edEQmnWr Kg6BcW5nHnSt23k4VkiobxcoHiUXASU1BhP3URNHMinMqEcO0bVKDJ9iRHNM4t19lfZf VJCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721069236; x=1721674036; h=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=MPS8QfdZo3AC8Hr4eUbNKCM1VOr4BgxpkOI5YKXK9bQ=; b=egJtITn5wdDLtBtmTXbs2pQhDIInbSVr8NZA1Fv0Khl+N01/yNlIOvgUC5Tqno/4Ax TauGysCt8qmc7+zgXSHkVVHDtfbP3jLTDv4Vdr41EGrKsJxjBPPoL9CTLik+P0s8AU2M hb1w8K0plgO+6KxEi6adYjMFRJKr9AEwTQbgX7LGtpwcMVX4ulCF6ns722f54ps4ZvWq tCnfZ270nBjsViNIWNbDydE95kvU4kvSfB8E4vW4bPnnqWYnotcQui/eAYktwPP4Nq3N SdRmiTWgYxpMABXuXHZg2hX/QOxj1ZThVazfjOdq8jMShghmLykm/B04HHp34lPOJJkJ 7VHA== X-Forwarded-Encrypted: i=1; AJvYcCWzalMrWDFcFHy0SCMZrtlsk9hBUGIxa3gZv5vpocS8inMuWssCGbF9ATmHxk1pNuAiLtGnu3osBcuDEgQm1xqZuZfqYvc9P38xSAvEr745JaHQ X-Gm-Message-State: AOJu0YwQCJwsIRhDLUloD26PoOkFoKF1WTO/eWGFICBqJJpOF9B9rxcW bXM9C222xy7hd9zmlqqeJ2InomegfA1NZBeFiKWLQsS4WLDorhXM X-Google-Smtp-Source: AGHT+IHCgW4GkN0Z2tBHP2BYDbMy0J04/4fBjP1LeCvshNCwWsVXsDLTB+JA/hLnWKsp+saPy/MX7Q== X-Received: by 2002:a05:6e02:1aac:b0:376:210a:80e5 with SMTP id e9e14a558f8ab-39394ba4014mr5423265ab.7.1721069235827; Mon, 15 Jul 2024 11:47:15 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3900fa20430sm17950705ab.46.2024.07.15.11.47.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jul 2024 11:47:15 -0700 (PDT) Date: Mon, 15 Jul 2024 13:47:14 -0500 From: Nathan Bossart To: Robert Haas Cc: Fujii Masao , pgsql-hackers@lists.postgresql.org Subject: Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal Message-ID: References: <802ff3d5-fdc7-4b08-9046-2e9fc5fdae0e@oss.nttdata.com> <7c1b48d8-0f08-4733-a4e6-d55f04581db7@oss.nttdata.com> <8a668c51-c6af-4744-a978-c6a2ce3b1d83@oss.nttdata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jul 15, 2024 at 02:30:42PM -0400, Robert Haas wrote: > On Sun, Jul 14, 2024 at 10:56 PM Fujii Masao > wrote: >> I don't think it's a rare scenario since summarize_wal can be enabled >> after starting the server with wal_level=minimal. Therefore, I believe >> such a configuration should be prohibited using a GUC check hook, >> as my patch does. > > I guess I'm in the group of people who doesn't understand how this can > possibly work. There's no guarantee about the order in which GUC check > hooks are called, so you don't know if the value of the other variable > has already been set to the final value or not, which seems like a > fatal problem even if the code happens to work correctly as of today. > Even if you have such a guarantee, you can't prohibit a configuration > change at pg_ctl reload time: the server can refuse to start in case > of an invalid configuration, but a running server can't decide to shut > down or stop working at reload time. My understanding is that the correctness of this GUC check hook depends on wal_level being a PGC_POSTMASTER GUC. The check hook would always return true during startup, and there'd be an additional cross-check in PostmasterMain() that would fail startup if necessary. After that point, we know that wal_level cannot change, so the GUC check hook for summarize_wal can depend on wal_level. If it fails, my expectation would be that the server would just ignore that change and continue. -- nathan