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 1pLY91-0000MR-7p for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Jan 2023 23:28:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pLY90-0008JH-4H for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Jan 2023 23:28:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pLY8z-0008FL-Qx for pgsql-hackers@lists.postgresql.org; Fri, 27 Jan 2023 23:28:29 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pLY8x-0004eF-0M for pgsql-hackers@postgresql.org; Fri, 27 Jan 2023 23:28:29 +0000 Received: by mail-pj1-x102f.google.com with SMTP id m11so6088768pji.0 for ; Fri, 27 Jan 2023 15:28:26 -0800 (PST) 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=K0K4Y7lDFUQ4oweYqlMRRVb8ULSU+CdeeCk/wOjs8Ww=; b=c6JVjxf5rh56eCWsUgpRnLc8wsBrk1cNxeEykmVSm9s3x1KMZ/SyDYkaO/I2Vuh4EL pwPUAGguVukEkkM5nt6zvnO2MwHpXVEgXADoQ7zh5H064QrIo78xZL5xKORawepPWHVn LsA4kOTLY9Nf19uLRi9oNTy4FNPjLcPvrA+1A32/8YVI3zXe+3BNvVCn7tP2r548a+mz QpWjJFy63AKBzzvDwLTqHauzO/KGL8ZgPcjhrqd8h2pRrYOetvm4HNlvHx13IteSpM7/ Q2MCGgLwxTIME9aW7M10v3IYaYbRsClr1lNL4OfobFaOm/O3bRm4Orw4Yf0G6Ebxq1UU Ts0g== 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=K0K4Y7lDFUQ4oweYqlMRRVb8ULSU+CdeeCk/wOjs8Ww=; b=F/vp47MgMkDXoTp9VqtUQo31kOnphc3ZqH8Pdu8JApznZ2HFGw5dvv1oytfJInO/hX p5MUGos8VZtIyAH4GsGxm4COT4fWVXUy/VzaGGrq4l1AGuNSpxPci63+qgk2rqvqRObE 0O3z1n4OSuQFKGGNH6nqDfBTS5n4gcEKxq9vtHJnuvXSyozLmFTfs8niyxiPyRNeXNCb PGBJ95u9DQcbkgZL25PSOiJ0WvevwM/Y1DaxNkKt2c5WG2ZW5MCX0QG5KFsoaVtuiOLi cIb9pW5jD2SCgqLEKmq2vTikSIpGfihVm/KGUj3YFaWeGk6FqYvzIy/qFCsBwM8TwskU VmGQ== X-Gm-Message-State: AO0yUKVmofIwWAlUjrvh9OXQwD46nsBzZ8p0G3ghDDynL1vKJDV7tuQK rpERqpm3MzlWabvUkGHJzWM= X-Google-Smtp-Source: AK7set9t9CP0WG/AYgOHFyfkXyuQM9afnvjNquaTKXQvclfIn4YLW9re/4d3FqlBNSdBeH7muFat8A== X-Received: by 2002:a17:903:1c8:b0:192:d230:6778 with SMTP id e8-20020a17090301c800b00192d2306778mr86842plh.13.1674862104600; Fri, 27 Jan 2023 15:28:24 -0800 (PST) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id e11-20020a170902ed8b00b00194c2f78581sm3376967plj.199.2023.01.27.15.28.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 15:28:23 -0800 (PST) Date: Fri, 27 Jan 2023 15:28:21 -0800 From: Nathan Bossart To: Michael Paquier Cc: Andres Freund , pgsql-hackers@postgresql.org Subject: Re: recovery modules Message-ID: <20230127232821.GA2221918@nathanxps13> References: <20230116224040.GB2714038@nathanxps13> <20230117182356.GA3015764@nathanxps13> <20230118044427.GA3369836@nathanxps13> <20230123214428.GA572995@nathanxps13> <20230127054058.GA2041427@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230127054058.GA2041427@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jan 26, 2023 at 09:40:58PM -0800, Nathan Bossart wrote: > On Wed, Jan 25, 2023 at 04:34:21PM +0900, Michael Paquier wrote: >> The loop part is annoying.. I've never been a fan of adding this >> cross-value checks for the archiver modules in the first place, and it >> would make things much simpler in the checkpointer if we need to think >> about that as we want these values to be reloadable. Perhaps this >> could just be an exception where we just give priority on one over the >> other archive_cleanup_command? The startup process has a well-defined >> sequence after a failure, while the checkpointer is designed to remain >> robust. > > Yeah, there are some problems here. If we ERROR, we'll just bounce back to > the sigsetjmp() block once a second, and we'll never pick up configuration > reloads, shutdown signals, etc. If we FATAL, we'll just rapidly restart > over and over. Given the dicussion about misconfigured archiving > parameters [0], I doubt folks will be okay with giving priority to one or > the other. > > I'm currently thinking that the checkpointer should set a flag and clear > the recovery callbacks when a misconfiguration is detected. Anytime the > checkpointer tries to use the archive-cleanup callback, a WARNING would be > emitted. This is similar to an approach I proposed for archiving > misconfigurations (that we didn't proceed with) [1]. Given the > aformentioned problems, this approach might be more suitable for the > checkpointer than it is for the archiver. The more I think about this, the more I wonder whether we really need to include archive_cleanup_command and recovery_end_command in recovery modules. Another weird thing with the checkpointer is that the restore_library will stay loaded long after recovery is finished, and it'll be loaded regardless of whether recovery is required in the first place. Of course, that typically won't cause any problems, and we could wait until we need to do archive cleanup to load the library (and call its shutdown callback when recovery is finished), but this strikes me as potentially more complexity than the feature is worth. Perhaps we should just focus on covering the restore_command functionality for now and add the rest later. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com