Re: [HACKERS] Function to move the position of a replication slot

2017-09-04 Thread Andres Freund
On 2017-09-05 11:36:47 +0900, Michael Paquier wrote: > On Thu, Aug 31, 2017 at 9:19 PM, Magnus Hagander wrote: > > PFA an updated and rebased patch. > > > > Rebased. Now named pg_advance_replication_slot. ERROR on logical slots. > > Forward only. > > > > I think that, in the

Re: [HACKERS] Function to move the position of a replication slot

2017-09-04 Thread Michael Paquier
On Thu, Aug 31, 2017 at 9:19 PM, Magnus Hagander wrote: > PFA an updated and rebased patch. > > Rebased. Now named pg_advance_replication_slot. ERROR on logical slots. > Forward only. > > I think that, in the end, covered all the comments? + if (backwards) +

Re: [HACKERS] Function to move the position of a replication slot

2017-09-03 Thread Magnus Hagander
On Sun, Sep 3, 2017 at 12:20 AM, Robert Haas wrote: > On Fri, Sep 1, 2017 at 11:30 PM, Peter Eisentraut > wrote: > > On 8/31/17 08:19, Magnus Hagander wrote: > >> Rebased. Now named pg_advance_replication_slot. ERROR on logical slots. >

Re: [HACKERS] Function to move the position of a replication slot

2017-09-02 Thread Andres Freund
On 2017-09-02 18:31:10 -0400, Tom Lane wrote: > Andres Freund writes: > > I don't quite see how you'd get corruption from a physical slot being > > forwarded? I mean you surely can get into the situation that there's > > missing WAL from wherever a standby is receiving its

Re: [HACKERS] Function to move the position of a replication slot

2017-09-02 Thread Tom Lane
Andres Freund writes: > I don't quite see how you'd get corruption from a physical slot being > forwarded? I mean you surely can get into the situation that there's > missing WAL from wherever a standby is receiving its WAL, but that'll > "just" break replication. Um, doesn't

Re: [HACKERS] Function to move the position of a replication slot

2017-09-02 Thread Andres Freund
On 2017-09-01 23:37:07 -0400, Tom Lane wrote: > Peter Eisentraut writes: > > On 8/31/17 08:19, Magnus Hagander wrote: > >> I think that, in the end, covered all the comments? > > > I didn't see any explanation of what this would actually be useful for. > > I

Re: [HACKERS] Function to move the position of a replication slot

2017-09-02 Thread Robert Haas
On Fri, Sep 1, 2017 at 11:30 PM, Peter Eisentraut wrote: > On 8/31/17 08:19, Magnus Hagander wrote: >> Rebased. Now named pg_advance_replication_slot. ERROR on logical slots. >> Forward only. >> >> I think that, in the end, covered all the comments? > > I didn't

Re: [HACKERS] Function to move the position of a replication slot

2017-09-01 Thread Michael Paquier
On Sat, Sep 2, 2017 at 12:37 PM, Tom Lane wrote: > Peter Eisentraut writes: >> On 8/31/17 08:19, Magnus Hagander wrote: >>> I think that, in the end, covered all the comments? > >> I didn't see any explanation of what this would actually be

Re: [HACKERS] Function to move the position of a replication slot

2017-09-01 Thread Tom Lane
Peter Eisentraut writes: > On 8/31/17 08:19, Magnus Hagander wrote: >> I think that, in the end, covered all the comments? > I didn't see any explanation of what this would actually be useful for. > I suppose you could skip over some changes you don't want

Re: [HACKERS] Function to move the position of a replication slot

2017-09-01 Thread Peter Eisentraut
On 8/31/17 08:19, Magnus Hagander wrote: > Rebased. Now named pg_advance_replication_slot. ERROR on logical slots. > Forward only. > > I think that, in the end, covered all the comments? I didn't see any explanation of what this would actually be useful for. I suppose you could skip over some

Re: [HACKERS] Function to move the position of a replication slot

2017-08-31 Thread Magnus Hagander
On Thu, Aug 17, 2017 at 2:19 AM, Craig Ringer wrote: > On 17 August 2017 at 07:30, Michael Paquier > wrote: > >> >> Definitely agreed on that. Any move function would need to check if >> the WAL position given by caller is already newer than

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Craig Ringer
On 17 August 2017 at 09:33, Andres Freund wrote: > On 2017-08-16 21:25:48 -0400, Robert Haas wrote: > > On Wed, Aug 16, 2017 at 5:55 PM, Andres Freund > wrote: > > > I think we should constrain the API to only allow later LSNs than > > > currently in the

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Andres Freund
On 2017-08-16 21:25:48 -0400, Robert Haas wrote: > On Wed, Aug 16, 2017 at 5:55 PM, Andres Freund wrote: > > I think we should constrain the API to only allow later LSNs than > > currently in the slot, rather than arbitrary ones. That's why I was > > thinking of "forward".

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Robert Haas
On Wed, Aug 16, 2017 at 5:55 PM, Andres Freund wrote: > I think we should constrain the API to only allow later LSNs than > currently in the slot, rather than arbitrary ones. That's why I was > thinking of "forward". I'm not convinced it's a good / safe idea to > allow

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Michael Paquier
On Thu, Aug 17, 2017 at 9:19 AM, Craig Ringer wrote: > pg_advance_replication_slot(...) > > ERROR's on logical slot, for now. Physical slots only. > > Forward-only. > > Future work to allow it to use the logical decoding infrastructure to > fast-forward a slot by reading

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Craig Ringer
On 17 August 2017 at 07:30, Michael Paquier wrote: > > Definitely agreed on that. Any move function would need to check if > the WAL position given by caller is already newer than what's > available in the local pg_wal (minimum of all other slots), with a > shared lock

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Michael Paquier
On Thu, Aug 17, 2017 at 7:14 AM, Tom Lane wrote: > Andres Freund writes: >> On 2017-08-16 17:06:42 -0400, Tom Lane wrote: >>> If I understand what this is meant to do, maybe better >>> pg_move_replication_slot_lsn() or pg_change_replication_slot_lsn() ?

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Andres Freund
On 2017-08-16 18:14:45 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2017-08-16 17:06:42 -0400, Tom Lane wrote: > >> If I understand what this is meant to do, maybe better > >> pg_move_replication_slot_lsn() or pg_change_replication_slot_lsn() ? > >> The point being

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Tom Lane
Alvaro Herrera writes: > Andres Freund wrote: >> I think we should constrain the API to only allow later LSNs than >> currently in the slot, rather than arbitrary ones. That's why I was >> thinking of "forward". I'm not convinced it's a good / safe idea to >> allow

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Alvaro Herrera
Andres Freund wrote: > On 2017-08-16 17:06:42 -0400, Tom Lane wrote: > > If I understand what this is meant to do, maybe better > > pg_move_replication_slot_lsn() or pg_change_replication_slot_lsn() ? > > The point being that you're adjusting the LSN pointer contained > > in the slot, which is

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Tom Lane
Andres Freund writes: > On 2017-08-16 17:06:42 -0400, Tom Lane wrote: >> If I understand what this is meant to do, maybe better >> pg_move_replication_slot_lsn() or pg_change_replication_slot_lsn() ? >> The point being that you're adjusting the LSN pointer contained >> in the

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Andres Freund
On 2017-08-16 17:06:42 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2017-08-16 12:24:11 -0400, Peter Eisentraut wrote: > >> On 5/4/17 08:05, Magnus Hagander wrote: > >>> PFA a patch that adds a new function, pg_move_replication_slot, that > >>> makes it possible to

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Tom Lane
Andres Freund writes: > On 2017-08-16 12:24:11 -0400, Peter Eisentraut wrote: >> On 5/4/17 08:05, Magnus Hagander wrote: >>> PFA a patch that adds a new function, pg_move_replication_slot, that >>> makes it possible to move the location of a replication slot without >>>

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Andres Freund
On 2017-08-16 12:24:11 -0400, Peter Eisentraut wrote: > On 5/4/17 08:05, Magnus Hagander wrote: > > PFA a patch that adds a new function, pg_move_replication_slot, that > > makes it possible to move the location of a replication slot without > > actually consuming all the WAL on it. > > The name

Re: [HACKERS] Function to move the position of a replication slot

2017-08-16 Thread Peter Eisentraut
On 5/4/17 08:05, Magnus Hagander wrote: > PFA a patch that adds a new function, pg_move_replication_slot, that > makes it possible to move the location of a replication slot without > actually consuming all the WAL on it. The name keeps confusing me. I understand "move" to be "rename" or

Re: [HACKERS] Function to move the position of a replication slot

2017-05-10 Thread Petr Jelinek
On 10/05/17 22:17, Dmitry Dolgov wrote: >> On 4 May 2017 at 20:05, Magnus Hagander > wrote: >> >> PFA a patch that adds a new function, pg_move_replication_slot, that > makes it >> possible to move the location of a replication slot without

Re: [HACKERS] Function to move the position of a replication slot

2017-05-10 Thread Dmitry Dolgov
> On 4 May 2017 at 20:05, Magnus Hagander wrote: > > PFA a patch that adds a new function, pg_move_replication_slot, that makes it > possible to move the location of a replication slot without actually > consuming all the WAL on it. Just a few questions just a few questions

Re: [HACKERS] Function to move the position of a replication slot

2017-05-04 Thread Craig Ringer
On 4 May 2017 at 20:45, Magnus Hagander wrote: > On Thu, May 4, 2017 at 2:42 PM, Craig Ringer wrote: >> >> On 4 May 2017 at 20:05, Magnus Hagander wrote: >> > PFA a patch that adds a new function, pg_move_replication_slot, that >>

Re: [HACKERS] Function to move the position of a replication slot

2017-05-04 Thread Magnus Hagander
On Thu, May 4, 2017 at 2:42 PM, Craig Ringer wrote: > On 4 May 2017 at 20:05, Magnus Hagander wrote: > > PFA a patch that adds a new function, pg_move_replication_slot, that > makes > > it possible to move the location of a replication slot without

Re: [HACKERS] Function to move the position of a replication slot

2017-05-04 Thread Craig Ringer
On 4 May 2017 at 20:05, Magnus Hagander wrote: > PFA a patch that adds a new function, pg_move_replication_slot, that makes > it possible to move the location of a replication slot without actually > consuming all the WAL on it. > This can be useful for example to keep

[HACKERS] Function to move the position of a replication slot

2017-05-04 Thread Magnus Hagander
PFA a patch that adds a new function, pg_move_replication_slot, that makes it possible to move the location of a replication slot without actually consuming all the WAL on it. This can be useful for example to keep replication slots in sync between different servers in a replication cluster.