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 1nDRkB-0001gY-VF for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Jan 2022 13:56:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nDRk9-0006Gf-RT for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Jan 2022 13:56:49 +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 1nDRk9-0006GV-Gb for pgsql-hackers@lists.postgresql.org; Fri, 28 Jan 2022 13:56:49 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nDRk5-0003Rk-RZ for pgsql-hackers@lists.postgresql.org; Fri, 28 Jan 2022 13:56:49 +0000 Received: by mail-pf1-x42b.google.com with SMTP id u130so6205949pfc.2 for ; Fri, 28 Jan 2022 05:56:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=0sLCTp6goUiErrIJSRykRXruxkv8hFCXIASjhMaD2fo=; b=em8WK6KwfWJQwkVgv0b47C1VMkGWuxg1OYEi7C3qIdz85oa0CG7Ac11HwsApyVC5N+ w4a5WH67t0tI+e8uRgl9kOSY4X9QS0vSYc/VyP4UwKAyVrottw7k4SrQsDNU/JWNMJVV ePvaOP0bOTaI7wHwoU79YbjCAxwI9Vhsbgabzl0s1exLy36lzz/GZ3THPJbTgAFN2v3M BmkSgeiCeYpptRoK+TI0mSyCMhDw1wex+nEfm2Xuf2ELUH4Q+ZEB3KCKedwE/nfjImht DLDyy/zHRHvo5EyM93SBDjj1Tp5xODOr4SuGlSJIn8s91SSOZX8oIaqCdVD3kXl504Rd nKMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0sLCTp6goUiErrIJSRykRXruxkv8hFCXIASjhMaD2fo=; b=KiYEFrsufzTb8TAbvJTP0pFCz2cRQVHPoFQFsOEkOUITFs1IX4Z6wSDwUZwVLvp9Do lEv+Eeaagoriulr97r2QCAuPxpJ02vjC0ejqrrgzKVNOm/NELFEUAPsEXtscFkDcBpLy 0UszNPNfzHExwneUhavzehs/R+c+1kiMAB8tIfJtLJOIT8eH2v8e+JSzKZsn7zmDJH8e gxMe0zebGDSanvuuJxOH4+wWkSWN2VPN6LBtbRm7L7ucqOGpA8ESetwhWMdlCeN5sPi6 x2Mdnnf5ws1kwro8p5zgal6di9nPGcHzSrqYpI+T51a50xC1DCLg1i80jrZzSFeB//Na qwKg== X-Gm-Message-State: AOAM530XL+h9HpZTTf2wHfHpMngA7riu8E+6Df7REcx+UP9Nvd/r+rtk MFvJMcAbxorerABcQrjT+6I= X-Google-Smtp-Source: ABdhPJxE0lgvsfymisrzXZPxxnlfCzf0EPH5RL9YGDJ3ZQMLwKDCy1j43qV9jd2rYrOGxIDzQmgZWQ== X-Received: by 2002:a63:fb4a:: with SMTP id w10mr6598628pgj.615.1643378203263; Fri, 28 Jan 2022 05:56:43 -0800 (PST) Received: from jrouhaud (2001-b011-1005-557a-942d-0024-7821-6548.dynamic-ip6.hinet.net. [2001:b011:1005:557a:942d:24:7821:6548]) by smtp.gmail.com with ESMTPSA id mw14sm2924334pjb.6.2022.01.28.05.56.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jan 2022 05:56:42 -0800 (PST) Date: Fri, 28 Jan 2022 21:56:36 +0800 From: Julien Rouhaud To: Denis Laxalde Cc: Andres Freund , pgsql-hackers@lists.postgresql.org, Jehan-Guillaume de Rorthais Subject: Re: [PATCH] Disable bgworkers during servers start in pg_upgrade Message-ID: <20220128135636.ls2zjbajirbdmrzb@jrouhaud> References: <20210121152357.s6eflhqyh4g5e6dv@dalibo.com> <20210124003611.lkyxhd2mpdmv5xzh@alap3.anarazel.de> <20210127102511.tvhu2wmrxoz3tle4@dalibo.com> <20210127144132.215fe4bb@firost> <20210312082325.weltivlokfpc3gt2@nol> <54f0d813-a38a-6b72-269a-7d6dd02bcc5b@dalibo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54f0d813-a38a-6b72-269a-7d6dd02bcc5b@dalibo.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Fri, Jan 28, 2022 at 11:02:46AM +0100, Denis Laxalde wrote: > > I tried that simple change first: > > diff --git a/src/backend/access/transam/xlog.c > b/src/backend/access/transam/xlog.c > index dfe2a0bcce..8feab0cb96 100644 > --- a/src/backend/access/transam/xlog.c > +++ b/src/backend/access/transam/xlog.c > @@ -8498,6 +8498,9 @@ HotStandbyActiveInReplay(void) > bool > XLogInsertAllowed(void) > { > + if (IsBinaryUpgrade) > + return false; > + > > > But then, pg_upgrade's tests (make -C src/bin/pg_upgrade/ check) fail at > vaccumdb but not during pg_dumpall: > > [...] > > command: "/home/denis/src/pgsql/build/tmp_install/home/denis/.local/pgsql/bin/vacuumdb" > --host /home/denis/src/pgsql/build/src/bin/pg_upgrade --port 51696 > --username denis --all --analyze >> "pg_upgrade_utility.log" 2>&1 > vacuumdb: vacuuming database "postgres" > vacuumdb: error: processing of database "postgres" failed: PANIC: cannot > make new WAL entries during recovery > > In contrast with pg_dump/pg_dumpall, vacuumdb has no --binary-upgrade flag, > so it does not seem possible to use a special GUC setting to allow WAL > writes in that vacuumdb session at the moment. > Should we add --binary-upgrade to vacuumdb as well? Or am I going in the > wrong direction? I think having a new option for vacuumdb is the right move. It seems unlikely that any cron or similar on the host will try to run some concurrent vacuumdb, but we still have to enforce that only the one executed by pg_upgrade can succeed. I guess it could be an undocumented option, similar to postgres' -b, which would only be allowed iff --all and --freeze is also passed to be extra safe. While at it: > vacuumdb: error: processing of database "postgres" failed: PANIC: cannot > make new WAL entries during recovery Should we tweak that message when IsBinaryUpgrade is true?