Re: Pg-Upgrade standbys via rsync... and avoid sending UNlogged data? - Mailing list pgsql-admin

From Stephen Frost
Subject Re: Pg-Upgrade standbys via rsync... and avoid sending UNlogged data?
Date
Msg-id 20160725163700.GZ4028@tamriel.snowman.net
Whole thread Raw
In response to Pg-Upgrade standbys via rsync... and avoid sending UNlogged data?  (Jerry Sievers <gsievers19@comcast.net>)
Responses Re: Pg-Upgrade standbys via rsync... and avoid sending UNlogged data?  (Stephen Frost <sfrost@snowman.net>)
List pgsql-admin
* Jerry Sievers (gsievers19@comcast.net) 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.

Certainly an interesting issue to consider.  I have to admit that I
hadn't considered unlogged tables when working out how to do the
hard-link-based approach.

> 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.

You would have to address tablespaces too, if you have any.

> I have among others, a 5TB system  w/about 40G of unlogged data.

Honestly, sending an extra 40G out of 5TB (we're talking less than 1%
here...) might be worth it to keep the process simple.

Thanks!

Stephen

Attachment

pgsql-admin by date:

Previous
From: Jerry Sievers
Date:
Subject: Re: Pg-Upgrade standbys via rsync... and avoid sending UNlogged data?
Next
From: Stephen Frost
Date:
Subject: Re: Pg-Upgrade standbys via rsync... and avoid sending UNlogged data?