Re: Allow replication roles to use file access functions

From: Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Re: Allow replication roles to use file access functions
Date: 2015-12-15 11:50:06
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 03.09.2015 05:40, Michael Paquier wrote:
> Ah, OK. I thought that you were referring to a protocol where caller
> sends a single LSN from which it gets a differential backup that needs
> to scan all the relation files of the source cluster to get the data
> blocks with an LSN newer than the one sent, and then sends them back
> to the caller.
> I guess that what you are suggesting instead is an approach where
> caller sends something like that through the replication protocol with
> a relation OID and a block list:
> BLOCK_DIFF relation_oid BLOCK_LIST m,n,[o, ...]
> Which is close to what pg_read_binary_file does now for a superuser.
> We would need as well to extend BASE_BACKUP so as it does not include
> relation files though for this use case.
> Regards,


we need to run pg_rewind without using a superuser role too. What if the
new parameter EXCLUDE_DATA_FILES will be added to the BASE_BACKUP
command? This parameter will force the BASE_BACKUP command to not
include relation files.

And pg_rewind can execute, for example, the following command:


This command will be executed if --source-server parameter is defined.
Are there any pitfalls in this condition?

Artur Zakirov
Postgres Professional:
Russian Postgres Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2015-12-15 12:11:19 Re: Patch: fix lock contention for HASHHDR.mutex
Previous Message Fabien COELHO 2015-12-15 11:41:44 Re: pgbench stats per script & other stuff