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 1sP0ze-002TB7-FF for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jul 2024 14:29:58 +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 1sP0zb-009jXu-BN for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jul 2024 14:29:56 +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 1sP0zb-009jXm-0s for pgsql-hackers@lists.postgresql.org; Wed, 03 Jul 2024 14:29:55 +0000 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sP0zY-000DKY-Uy for pgsql-hackers@lists.postgresql.org; Wed, 03 Jul 2024 14:29:54 +0000 Received: by mail-io1-xd2e.google.com with SMTP id ca18e2360f4ac-7f624e70870so294317439f.3 for ; Wed, 03 Jul 2024 07:29:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720016992; x=1720621792; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=7drpakmOJoFxVYw5gKLoJGTTTs09t/rpaTT4/ilo4W4=; b=Wr0frUmN4cxUcRmYW7UKjycNX2EAXQSUb5DTzAXAaPEBMBGZ42dEp77o8JBdOqczV/ lLbpsfsopCdwZZtusSZGYgHDxGbZe260e3Rk8T4hY1jFFKGfTokgrDi7VaKvXRKuxaGI H56dZhDub2t0SZICSwMaG0SzCT7QtPDdtJSjfJts7V9uOfKSpJ2sc6/8zaxCho/wSVv8 oKQPMrFztPUvzkrA+KAECNzr7HskYKYPV3bbQY0Qe/ZTlddoUHFXSsthbYlKm7YMVL3/ nCPOJMEXRojjG0uJYs4HrA7HEzms/7t4eu0HoErckvXYFeOaPsZ4V4K018+lzfg+UuPe 6FXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720016992; x=1720621792; h=in-reply-to: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=7drpakmOJoFxVYw5gKLoJGTTTs09t/rpaTT4/ilo4W4=; b=NaSnNczrK4uxrS2/IL8dMePtefK9QJR9SJsCdmuFWsjEnGhFNlL2+y1BXMsc93q3e7 krIt4HrkXs2kzz+EGQlWX7MIOknRLPJX9f3O2hFjHSSBSrVmSHg2iozDXTI4Iu6iJE6E bO+XyRFz8CHxkuiStzd0kApRjxFXXonfYKYjPejDaxGOEsMsX0zM83YyI1dzxCPJ8KHL ygboUdTSWznrdoI2v7MhaXuOA0SaZYHvM+ioJOqUO4Z7OBhujNidbrID/2k81nHRMoJy Vhl6i8Yvqxs9jufjnhm1m63NrB06f71InYKKAI05LZEVbtP0VAHhFxqJ9wamFsbG/PHT tzwA== X-Gm-Message-State: AOJu0YxZzd6VyeUJI2bSUzrInhVYqQs7Q/k2DGJiDRzTIu1Sgj6BTu0E ta4VPH5KMCmxsMRmLHrnJT+ogv1pUAHq9UKr+rq4pTqlUW2J45fBgwvc5c3o X-Google-Smtp-Source: AGHT+IFBXqXRXAeY0nMegphPKEVy+MgCktaIwbRuNBCA9otAdYPSvAlf/0+Y4/wiLw94THdhWATumQ== X-Received: by 2002:a05:6602:890:b0:7f6:1d7e:a9ca with SMTP id ca18e2360f4ac-7f62ee5247dmr1167543139f.9.1720016992102; Wed, 03 Jul 2024 07:29:52 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4bb73dd6f79sm3443701173.64.2024.07.03.07.29.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 07:29:51 -0700 (PDT) Date: Wed, 3 Jul 2024 09:29:50 -0500 From: Nathan Bossart To: Fujii Masao Cc: 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: <6e30082e-041b-4e31-9633-95a66de76f5d@oss.nttdata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6e30082e-041b-4e31-9633-95a66de76f5d@oss.nttdata.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jul 03, 2024 at 11:08:48PM +0900, Fujii Masao wrote: > +/* > + * GUC check_hook for summarize_wal > + */ > +bool > +check_summarize_wal(bool *newval, void **extra, GucSource source) > +{ > + if (*newval && wal_level == WAL_LEVEL_MINIMAL) > + { > + GUC_check_errmsg("WAL cannot be summarized when \"wal_level\" is \"minimal\""); > + return false; > + } > + return true; > +} IME these sorts of GUC hooks that depend on the value of other GUCs tend to be quite fragile. This one might be okay because wal_level defaults to 'replica' and because there is an additional check in postmaster.c, but that at least deserves a comment. This sort of thing comes up enough that perhaps we should add a better-supported way to deal with GUCs that depend on each other... -- nathan