Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1orQ98-0004xJ-Cv for pgsql-hackers@arkaria.postgresql.org; Sat, 05 Nov 2022 20:52:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1orQ96-0006jm-S2 for pgsql-hackers@arkaria.postgresql.org; Sat, 05 Nov 2022 20:52:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1orQ96-0006jd-FR for pgsql-hackers@lists.postgresql.org; Sat, 05 Nov 2022 20:52:04 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1orQ90-0007Ra-Sr for pgsql-hackers@postgresql.org; Sat, 05 Nov 2022 20:52:03 +0000 Received: by mail-pf1-x429.google.com with SMTP id k15so7353803pfg.2 for ; Sat, 05 Nov 2022 13:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=wByxnZDfZFFiUqoOZI0aat+njLzQLjSRntNRW0plKaI=; b=d2vD+5MPZkFW2/LjPlQ80eprkFVL3CsJmlSQV7NE36jK9osiLd9YuBu1BPXqF82uz8 0xpRn96Bdksido1j2vm5s7AgYdfQPPNK5QvueZzSGj4SexC8/+jpqdwMbfkDfKpvy6Zu lUbLicy5BYSUpsNcjZxLTlaoSxa05QFQ5G9kNK/y8BDzaCDfNeyQS8+16TZHSnX6+XrR EUT79nZZ5BQ4xOP78xCMPPWXwlerVB7kKoc4heqlYW1YtR7xCy0bBVixjLuQjF4AhEGy ygrLdyJyOJoyPcLrsEFB/FVRVsidwBKs+QvteWmjs+e+0fJMsOX3dqoFYuzHmmJPb5mY zceA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=wByxnZDfZFFiUqoOZI0aat+njLzQLjSRntNRW0plKaI=; b=7dPIxOowSk6n31CxIbJbTzIEGhfIBcNZqLAdiPf/xeuUsNn1znr3rUggTwwdp7ribU fvVwCw7cbzUH8DN80wbEksxuJAKqfecfAFHRUm/j0ux8hj/zhojzEmGg49OSEo/y3ujI kkKTPsYSpbAO9sf/zPUN2sFQsbpwowKvIJbVXLQqX2V1YYI+OH58a5iAlCF8CVKhP+lI wG8H2gsDiIHHUXN0Kbba3CQacoALEgjH3J1dk7dASFH7AXa6XPV0TMbCF47cCDP7kZlC 4Fzy3WOeOshkCCQfQ3jI7gZewUogQDh1gglQktXuNMaONUA/UP0xFGZ5ZXZku8Xj/30P ZAsw== X-Gm-Message-State: ACrzQf3I37aba91ps3hh0Qo5zbZcW5Jg7h82trcN44789Vnyu/v0t2Sh 3gulyvvk8J/rzM6SpHQh0/o= X-Google-Smtp-Source: AMsMyM59VBu0+JAwncCMpxF65y9mRgtix5BzovkGxnAyBZYWkEtXUXTtYU1NUo07tLkP0dM0Iw2Q0A== X-Received: by 2002:a63:1e47:0:b0:43c:261f:f773 with SMTP id p7-20020a631e47000000b0043c261ff773mr36460786pgm.1.1667681517570; Sat, 05 Nov 2022 13:51:57 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id i3-20020a17090332c300b00174c235e1fdsm2056629plr.199.2022.11.05.13.51.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Nov 2022 13:51:56 -0700 (PDT) Date: Sat, 5 Nov 2022 13:51:54 -0700 From: Nathan Bossart To: Ian Lawrence Barwick Cc: Bharath Rupireddy , Michael Paquier , Tom Lane , Peter Eisentraut , Benoit =?iso-8859-1?Q?Lobr=E9au?= , Alvaro Herrera , Robert Haas , "Bossart, Nathan" , David Steele , Fujii Masao , "pgsql-hackers@postgresql.org" , Magnus Hagander , Stephen Frost Subject: Re: archive modules Message-ID: <20221105205154.GA137360@nathanxps13> References: <1d9cb989-91b0-919e-f42b-4788f5fc7911@enterprisedb.com> <20221013182408.GA1551106@nathanxps13> <1061703.1665687218@sss.pgh.pa.us> <20221014185130.GC1678424@nathanxps13> <20221014214256.GA1819154@nathanxps13> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="fUYQa+Pmc3FrFX/N" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Nov 04, 2022 at 12:05:26PM +0900, Ian Lawrence Barwick wrote: > cfbot reports the patch no longer applies [1]. As CommitFest 2022-11 is > currently underway, this would be an excellent time to update the patch. Indeed. Here is a new version of the patch. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com --fUYQa+Pmc3FrFX/N Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="fail_arch_v3.patch" diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 559eb898a9..2ffd82ab66 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -3597,9 +3597,11 @@ include_dir 'conf.d' This parameter can only be set in the postgresql.conf - file or on the server command line. It is ignored unless + file or on the server command line. It is only used if archive_mode was enabled at server start and - archive_library is set to an empty string. + archive_library is set to an empty string. If both + archive_command and archive_library + are set, archiving will fail. If archive_command is an empty string (the default) while archive_mode is enabled (and archive_library is set to an empty string), WAL archiving is temporarily @@ -3624,7 +3626,9 @@ include_dir 'conf.d' The library to use for archiving completed WAL file segments. If set to an empty string (the default), archiving via shell is enabled, and - is used. Otherwise, the specified + is used. If both + archive_command and archive_library + are set, archiving will fail. Otherwise, the specified shared library is used for archiving. The WAL archiver process is restarted by the postmaster when this parameter changes. For more information, see and diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c index 2670e41666..3e11a4ce12 100644 --- a/src/backend/postmaster/pgarch.c +++ b/src/backend/postmaster/pgarch.c @@ -792,6 +792,12 @@ HandlePgArchInterrupts(void) ConfigReloadPending = false; ProcessConfigFile(PGC_SIGHUP); + if (XLogArchiveLibrary[0] != '\0' && XLogArchiveCommand[0] != '\0') + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("both archive_command and archive_library specified"), + errdetail("Only one of archive_command, archive_library may be set."))); + archiveLibChanged = strcmp(XLogArchiveLibrary, archiveLib) != 0; pfree(archiveLib); @@ -825,6 +831,12 @@ LoadArchiveLibrary(void) { ArchiveModuleInit archive_init; + if (XLogArchiveLibrary[0] != '\0' && XLogArchiveCommand[0] != '\0') + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("both archive_command and archive_library specified"), + errdetail("Only one of archive_command, archive_library may be set."))); + memset(&ArchiveContext, 0, sizeof(ArchiveModuleCallbacks)); /* --fUYQa+Pmc3FrFX/N--