Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAm22-0006Ah-23 for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2019 02:18:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iAm20-0002Dl-Rf for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2019 02:18:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAm20-0002DE-HV for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 02:18:52 +0000 Received: from resqmta-ch2-07v.sys.comcast.net ([2001:558:fe21:29:69:252:207:39]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAm1p-0002wJ-Tr for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 02:18:48 +0000 Received: from resomta-ch2-08v.sys.comcast.net ([69.252.207.104]) by resqmta-ch2-07v.sys.comcast.net with ESMTP id AlQ2iVNjTWy6XAm1liSJRN; Thu, 19 Sep 2019 02:18:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1568859517; bh=blMuD9ovbrihHxk0w8/Bh7xSRY3recPLPpB2jaFnELo=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=GfmW6fzYobYmSWQZsNSDaMKEA+5wi9yikvuaOszxtZuZvUSxVIF9sZpQ74Bph+M0+ lVixgIjoupxf9BDZlRaLxP4BFeJzVr4MRAMQM/CnIWWwReeXVFK8kOh1e3tLIi11z0 2yIUg3RTtSc7BJq5k+HEkOHdkq5if7ObFVWk4TYuHL5wJTiLdu2Epu7YuVktF/NoCo 2jUl+Dw8U9/aEPW6o4y29CrRvQsiDDqCMCTxBPBSkpbLqbgElK1ocEZVlwXIgyMsTd YY0f+Wtdz/yvOvlXiXehfdysf1r6pnukuKSYGLB/Ke1g1UjZW5IpEBpUery/2yKRK/ mCH21QbOhZiGQ== Received: from jsievers.comcast.net ([12.187.116.132]) by resomta-ch2-08v.sys.comcast.net with ESMTPA id Am1Yirs2aPR8vAm1ZidHju; Thu, 19 Sep 2019 02:18:34 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgedufedrudelgdehvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucevohhmtggrshhtqdftvghsihdpqfgfvfdppffquffrtefokffrnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfgvrhhrhicuufhivghvvghrshcuoehgshhivghvvghrshduleestghomhgtrghsthdrnhgvtheqnecukfhppeduvddrudekjedrudduiedrudefvdenucfrrghrrghmpehhvghlohepjhhsihgvvhgvrhhsrdgtohhmtggrshhtrdhnvghtpdhinhgvthepuddvrddukeejrdduudeirddufedvpdhmrghilhhfrhhomhepghhsihgvvhgvrhhsudelsegtohhmtggrshhtrdhnvghtpdhrtghpthhtoheprhhonhhljhhohhhnshhonhhjrhesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghlsehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopegurghvihgusehpghhmrghsthgvrhhsrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd X-Xfinity-VMeta: sc=-100;st=legit Received: from jsievers.enova.com (localhost [127.0.0.1]) by jsievers.comcast.net (Postfix) with ESMTP id 9C7D326005A; Wed, 18 Sep 2019 21:18:24 -0500 (CDT) From: Jerry Sievers To: David Steele Cc: Ron , pgsql-general@lists.postgresql.org Subject: Re: pgbackrest - question about restoring cluster to a new cluster on same server References: <0c037137-9480-3afa-a4b7-1400a9879cd2@gmail.com> Date: Wed, 18 Sep 2019 21:18:24 -0500 In-Reply-To: (David Steele's message of "Wed, 18 Sep 2019 21:58:11 -0400") Message-ID: <871rwdm3kf.fsf@jsievers.enova.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Steele writes: > On 9/18/19 9:40 PM, Ron wrote: > >> >> I'm concerned with one pgbackrest process stepping over another one and >> the restore (or the "pg_ctl start" recovery phase) accidentally >> corrupting the production database by writing WAL files to the original >> cluster. > > This is not an issue unless you seriously game the system. When a And/or your recovery system is running archive_mode=always :-) I don't know how popular that setting value is but that plus an identical archive_command as the origin... duplicate archival with whatever consequences. Disclaimer: I don't know if pgbackrest guards against such a configuration. > cluster is promoted it selects a new timeline and all WAL will be > archived to the repo on that new timeline. It's possible to promote a > cluster without a timeline switch by tricking it but this is obviously a > bad idea. > > So, if you promote the new cluster and forget to disable archive_command > there will be no conflict because the clusters will be generating WAL on > separate timelines. > > In the case of a future failover a higher timeline will be selected so > there still won't be a conflict. > > Unfortunately, that dead WAL from the rogue cluster will persist in the > repo until an PostgreSQL upgrade because expire doesn't know when it can > be removed since it has no context. We're not quite sure how to handle > this but it seems a relatively minor issue, at least as far as > consistency is concerned. > > If you do have a split-brain situation where two primaries are archiving > on the same timeline then first-in wins. WAL from the losing primary > will be rejected. > > Regards, -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net