Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQk7q-0001Sj-3M for pgsql-admin@arkaria.postgresql.org; Fri, 22 Jul 2016 23:45:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bQk7p-0005cX-JM for pgsql-admin@arkaria.postgresql.org; Fri, 22 Jul 2016 23:45:01 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bQk6A-0003kJ-0L for pgsql-admin@postgresql.org; Fri, 22 Jul 2016 23:43:18 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bQk66-0005hD-Bp for pgsql-admin@postgresql.org; Fri, 22 Jul 2016 23:43:17 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1bQk64-0006vl-DJ; Fri, 22 Jul 2016 19:43:12 -0400 Date: Fri, 22 Jul 2016 19:43:12 -0400 From: Bruce Momjian To: Jerry Sievers Cc: pgsql-admin@postgresql.org Subject: Re: Pg-Upgrade standbys via rsync... and avoid sending UNlogged data? Message-ID: <20160722234312.GA15377@momjian.us> References: <86d1m5b6bi.fsf@jerry.enova.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86d1m5b6bi.fsf@jerry.enova.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org On Fri, Jul 22, 2016 at 06:29:05PM -0500, Jerry Sievers wrote: > Has anyone found a clever way to $subject that doesn't involved > calculating which are all of the files unnecessary to send and then > running rsync with an exclude list? > > I'm pondering this right now. > > ISTM for each unlogged table/index/toast in pg_class where > relpersistence='u'... > > rsync --exclude-from... (and exclude-from-file contains) > > */base/$dbid/$relfilenode > */base/$dbid/$relfilenode.* > */base/$dbid/$relfilenode_* > ... > > The leading * will match the old/new data directoryes being sent to the > standby. > > MAster upgrade is done using hard-links and the rsync method generally > as per the pg docs. > > I have among others, a 5TB system w/about 40G of unlogged data. > > The rsync method of upgrade takes only several seconds during a snapshot > based test however as the snap was off a live system, the crash recovery > startup trunc'd all the unlogged data. > > This will not be the case during the real upgrade and I just as soon > avoid sending the unlogged data only to have it trunc'd away as soon as > the standby is started after the upgrade. Good question --- I don't think there is an easy answer except to truncate the unlogged tables before the upgrade. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin