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 1qh9xt-001Vsg-9l for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Sep 2023 14:38:37 +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 1qh9xq-000WnH-Nw for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Sep 2023 14:38:34 +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 1qh9xq-000Wmf-D1 for pgsql-hackers@lists.postgresql.org; Fri, 15 Sep 2023 14:38:34 +0000 Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qh9xn-004jbs-M6 for pgsql-hackers@lists.postgresql.org; Fri, 15 Sep 2023 14:38:33 +0000 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-1d66bf632bdso224337fac.2 for ; Fri, 15 Sep 2023 07:38:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694788711; x=1695393511; 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=0Wu75fNxHJ4ewVj2izUqZG3wjxYS2DkkrfdrRBfiwY8=; b=nnBlLoEnSMbPvxWFQxa9hPXgsF+d3FxdbDdJDCsFSJWmdkkcoVQbn+kQBh3PjZjS7a verfxNRLVs/dXW73xowftxJOpGCoHczgIVWSUhRRgK/WVj1juw4XdD3MSBZG0ddmCaRK hpXItsYeVkDUJ3578UKnHY+0kumfmY9lC/JDuA74HysFaDl1cp9DwNiwvcZNtpPrLzrZ A61mIqFotkKRLuwxU39fhd0+MJAf5OghG15dXUmPcEJ7E6V0E8xbJ/g1gAd+1S1FT1TW lFGeWIgOgD5WpG643BQ4pOH82UkPOfzIKy8/BHnRGrq35wJ4GLhHIZ53bsjQ7Ld/qXy4 uvTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694788711; x=1695393511; 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=0Wu75fNxHJ4ewVj2izUqZG3wjxYS2DkkrfdrRBfiwY8=; b=sURwMUz3aDS68U6J/JNfGV7SoyRDZjSzKwlzatNob4P4XsajzaDrH+IZ0HZ1S85RHu iWzUGGhp8iRviAd4ksEc0iVm13450BkYj9pO61y/5TAzI2vFfBZL77iXJOnNDV04h162 /TkvlGj3QRqWJ0y5Zy38x/LvPZm0zvXFVwmCA51zD1Ncm6AQ+M6JuzqlO4itlbPjI7mP G5emGXsG1ohd941QGlsbqEzhLkR9y9jnriyjAEIw68BPcoh12fcihi/Ms5Mgf+7LKqEJ 2oYApAq8fSRFp43+KpKJo7Lvk+SfXJACDCZA+qq4j/cxh6MXcImUKZ23I2ufeKulkrUm hPzQ== X-Gm-Message-State: AOJu0YyQjS1MppqO9mf2t4x3/hfH3ebcJxpD+bfcUjdzFp1VvSJhoUP3 35VZJYgVWqfX4TEDJ5Nrwc4= X-Google-Smtp-Source: AGHT+IGjhQU48wiqE97ub9nk82MOs513/v9COoU08/xK8nhOLX4HNkEG/b9sTeAefPDnw1HmfmnNMA== X-Received: by 2002:a05:6870:230e:b0:1d5:bda7:1314 with SMTP id w14-20020a056870230e00b001d5bda71314mr1924682oao.33.1694788710829; Fri, 15 Sep 2023 07:38:30 -0700 (PDT) Received: from nathanxps13 ([2600:1700:48f8:340f:87c9:8cb5:5a0c:ec69]) by smtp.gmail.com with ESMTPSA id lb11-20020a05687c330b00b001c5a3e31474sm1901836oac.45.2023.09.15.07.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 07:38:30 -0700 (PDT) Date: Fri, 15 Sep 2023 07:38:27 -0700 From: Nathan Bossart To: Daniel Gustafsson Cc: Alvaro Herrera , bt23nguyent , pgsql-hackers@lists.postgresql.org Subject: Re: Improve the log message output of basic_archive when basic_archive.archive_directory parameter is not set Message-ID: <20230915143827.GA1912920@nathanxps13> References: <202309151049.dmfsxc5b3wyf@alvherre.pgsql> <7035FAFE-7E91-4B31-AA72-75EE82DB3F7B@yesql.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7035FAFE-7E91-4B31-AA72-75EE82DB3F7B@yesql.se> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Sep 15, 2023 at 02:48:55PM +0200, Daniel Gustafsson wrote: >> On 15 Sep 2023, at 12:49, Alvaro Herrera wrote: >> >> On 2023-Sep-15, Daniel Gustafsson wrote: >> >>> -basic_archive_configured(ArchiveModuleState *state) >>> +basic_archive_configured(ArchiveModuleState *state, const char **errmsg) >>> >>> The variable name errmsg implies that it will contain the errmsg() data when it >>> in fact is used for errhint() data, so it should be named accordingly. I have no objection to allowing this callback to provide additional information, but IMHO this should use errdetail() instead of errhint(). In the provided patch, the new message explains how the module is not configured. It doesn't hint at how to fix it (although presumably one could figure that out pretty easily). >>> It's probably better to define the interface as ArchiveCheckConfiguredCB >>> functions returning an allocated string in the passed pointer which the caller >>> is responsible for freeing. That does seem more flexible. >> Also note that this callback is documented in archive-modules.sgml, so >> that needs to be updated as well. This also means you can't backpatch >> this change, or you risk breaking external software that implements this >> interface. > > Absolutely, this is master only for v17. +1 -- Nathan Bossart Amazon Web Services: https://aws.amazon.com