Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRiew-00062V-64 for pgsql-admin@arkaria.postgresql.org; Mon, 25 Jul 2016 16:23:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bRieu-0001dF-6k for pgsql-admin@arkaria.postgresql.org; Mon, 25 Jul 2016 16:23:12 +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 1bRiet-0001cn-Ce for pgsql-admin@postgresql.org; Mon, 25 Jul 2016 16:23:11 +0000 Received: from resqmta-po-01v.sys.comcast.net ([2001:558:fe16:19:96:114:154:160]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bRien-00022i-SG for pgsql-admin@postgresql.org; Mon, 25 Jul 2016 16:23:10 +0000 Received: from resomta-po-19v.sys.comcast.net ([96.114.154.243]) by resqmta-po-01v.sys.comcast.net with SMTP id RidvbHdjWucHZRiegbirAH; Mon, 25 Jul 2016 16:22:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1469463778; bh=SShfoxLN/CKoW64n+20Tw16xTsFxpaXqXusiuyw0Ivw=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=FdtBdu92UXTHuvbQc/JMeNToe7Fe0D+a5AoiOtTnTImSwlbaWY+se8XVYIP+1szRc eCkNeF4cXDaAqJ/gSJg1wA+uY3t1ClXGKSUVsNm8tRcwVCZi8BMeLFe5VIoodXajvL K5wD6zHrwZTHUTGjD9tYF7ZPpzHUzUAd4+Qk6y5DjJ2HVvgND4+Xvc0p6g+CPpbYI2 +NwmI50SxDbOOqgSkTwxsZgcAguA66IrNdjUr6IlcmxScBKHV9KZtyFnzpEAgeiHOf rus4aH1jbELfIdMXeYFo+qaPV+OXWhxnvjDVZvRCyc0Z0oKLXG35dEDuAGPCTyC2Ia DcAtzvC8CyPBg== Received: from jerry.enova.com ([12.187.116.132]) by comcast with SMTP id RieTbRRK4BAm7RieVbxTuf; Mon, 25 Jul 2016 16:22:56 +0000 Received: by jerry.enova.com (Postfix, from userid 1001) id 5C55F740212; Mon, 25 Jul 2016 11:22:44 -0500 (CDT) From: Jerry Sievers To: Bruce Momjian Cc: Jerry Sievers , pgsql-admin@postgresql.org Subject: Re: Pg-Upgrade standbys via rsync... and avoid sending UNlogged data? References: <86d1m5b6bi.fsf@jerry.enova.com> <20160722234312.GA15377@momjian.us> Date: Mon, 25 Jul 2016 11:22:44 -0500 In-Reply-To: <20160722234312.GA15377@momjian.us> (Bruce Momjian's message of "Fri, 22 Jul 2016 19:43:12 -0400") Message-ID: <86twfdr8kr.fsf@jerry.enova.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-CMAE-Envelope: MS4wfLwLhEeQlijJPzqnlqTrUzOxhMI+XMptO8N+A0tuMlorpjwL76zsEdxEsl1mOhyp1ZGD8QI+IyaNc8Dpg6mttH28YdUJUICNf0u8QDMSVXw1euMgvMKp I/xxEYPOcU74Ke2og+4tSAcYWcKEFELYirL8jD8vk5GIoB0PBLLw0OyY6rHPmPdea2JS1FlAdCMvrE4JkUJNgp7QfUsntPTcn1owlEubFeIxGsTpjPb7jwmX VcPK4sweP6n/Oy8P6a2kPQ== X-Pg-Spam-Score: -3.0 (---) 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 Bruce Momjian writes: > 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. Yup, as I suspected. My data warehouse team *rather* not have to dirive the unlogged data again since it takes time... and I rather not needlessly replicate it during upgrade (er, because that takes time.) At my company, if we choose to not avoid replicating unlogged data *and* run for a short interval in production without a standby, snapshot the halted master and take the rsync off of that meanwhile the master is back online. I'll figure something out. Thanks! -- Jerry Sievers e: jerry.sievers@comcast.net p: 312.241.7800 -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin