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 1nFWW5-0004jw-DQ for pgsql-admin@arkaria.postgresql.org; Thu, 03 Feb 2022 07:26:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nFWW3-0004hL-RI for pgsql-admin@arkaria.postgresql.org; Thu, 03 Feb 2022 07:26:51 +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 1nFWW3-0004hC-Fw; Thu, 03 Feb 2022 07:26:51 +0000 Received: from admin.sibptus.ru ([2001:19f0:5001:21dc::10]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFWW1-0002xs-5N; Thu, 03 Feb 2022 07:26:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sibptus.ru; s=20181118; h=In-Reply-To:Message-ID:Subject:To:From:Date; bh=y9CIhTvYOQXUtSxNv8RhRnspw5/UcpXg+AKgQMj6wJA=; b=acCZo9lrMj77YVmJN3UteJKpf5 z1PPxWMPXmbNnk/iflnvo3P5RQwQlO+fZQPcuwr8B9etRxPe0AU4ZQcfgGE2/ZAZLeyGcJYkF+1Ra 1nRGmJOMvG7KMv3l89z8NZc0JIdHthCJB9z1v3axKmfReNN6BvgcfepFVG/bYzd9llX4=; Received: from vas by admin.sibptus.ru with local (Exim 4.95 (FreeBSD)) (envelope-from ) id 1nFWVz-0005ki-HC; Thu, 03 Feb 2022 07:26:47 +0000 Date: Thu, 3 Feb 2022 07:26:47 +0000 From: Victor Sudakov To: Vijaykumar Jain Cc: Pgsql-admin , pgsql-admin , Nikhil Shetty Subject: Re: Lost replication slots after pg_upgrade. Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-PGP-Key: http://admin.sibptus.ru/~vas/ X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Vijaykumar Jain wrote: > On Thu, Feb 3, 2022, 10:54 AM Victor Sudakov wrote: > > > Nikhil Shetty wrote: > > > Hi, > > > I have a Primary and Standby running on Postgres v11.7. > > > > > > I was following the document to upgrade a PG v11.7 cluster to PG v13.4. > > > After upgrade using pg_upgrade on primary, I ran rsync to setup standby > > > PG13 but when I started the primary, the replication slots were not > > > present. How will standby start streaming in this case? > > > > > > We are using physical replication slots. > > > > You can create the replication slots manually with > > pg_create_physical_replication_slot() any time. > > > > However, unless you are very brave and know what you are doing, I'd > > recommend using pg_basebackup to setup a standby, not rsync. You can > > even use the -C and -S options of pg_basebackup to create the slots > > for you, and many other pg_basebackup's nice > > > > A small demo of 11 to 13 upgrade using pg_upgrade and rsync. > It might not be all the best practices, but just following the doc on my > laptop. > > > > https://gist.github.com/cabecada/4517af13245383b888833cfc69d741be > > Just ensure the backed up configs are in back in and also create the > replication slot. The black magick of using rsync instead of pg_basebackup is even documented in https://www.postgresql.org/docs/13/pgupgrade.html but it's much more difficult and error-prone than using pg_basebackup. -- Victor Sudakov VAS4-RIPE http://vas.tomsk.ru/ 2:5005/49@fidonet