Re: Pg-Upgrade standbys via rsync... and avoid sending UNlogged data?

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Jerry Sievers <gsievers19(at)comcast(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Pg-Upgrade standbys via rsync... and avoid sending UNlogged data?
Date: 2016-07-25 16:37:00
Message-ID: 20160725163700.GZ4028@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

* Jerry Sievers (gsievers19(at)comcast(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Stephen Frost 2016-07-25 16:43:29 Re: Pg-Upgrade standbys via rsync... and avoid sending UNlogged data?
Previous Message Jerry Sievers 2016-07-25 16:22:44 Re: Pg-Upgrade standbys via rsync... and avoid sending UNlogged data?