Re: [HACKERS] replication slot restart_lsn initialization

2015-09-06 Thread Michael Paquier
On Sun, Sep 6, 2015 at 8:32 PM, Andres Freund wrote: > [fixes] > > Committed, thanks for the patch. > Visibly I missed one/two things when hacking out this stuff. Thanks for the extra cleanup and the commit. -- Michael

Re: [HACKERS] replication slot restart_lsn initialization

2015-09-06 Thread Andres Freund
On 2015-08-15 21:16:11 +0900, Michael Paquier wrote: > Well, this has taken less time than I thought: > =# CREATE_REPLICATION_SLOT toto PHYSICAL; > slot_name | consistent_point | snapshot_name | output_plugin > ---+--+---+--- > toto | 0/0

Re: [HACKERS] replication slot restart_lsn initialization

2015-08-17 Thread Michael Paquier
On Tue, Aug 18, 2015 at 4:46 AM, Andres Freund and...@anarazel.de wrote: On 2015-08-17 15:22:44 -0400, Peter Eisentraut wrote: On 8/14/15 3:54 AM, Andres Freund wrote: I'd name it RESERVE_WAL. Why reserve? Isn't it preserve? Hm. I honestly do not know. I was thinking of ticket

Re: [HACKERS] replication slot restart_lsn initialization

2015-08-17 Thread Peter Eisentraut
On 8/14/15 3:54 AM, Andres Freund wrote: I'd name it RESERVE_WAL. My feeling is that the options for the logical case are geared towards the output plugin, not the walsender. I think it'd be confusing to use (slot_options) differently for physical slots. Why reserve? Isn't it preserve? --

Re: [HACKERS] replication slot restart_lsn initialization

2015-08-17 Thread Andres Freund
On 2015-08-17 15:22:44 -0400, Peter Eisentraut wrote: On 8/14/15 3:54 AM, Andres Freund wrote: I'd name it RESERVE_WAL. Why reserve? Isn't it preserve? Hm. I honestly do not know. I was thinking of ticket reservations... -- Sent via pgsql-hackers mailing list

Re: [HACKERS] replication slot restart_lsn initialization

2015-08-15 Thread Michael Paquier
On Fri, Aug 14, 2015 at 4:54 PM, Andres Freund and...@anarazel.de wrote: On 2015-08-14 16:44:44 +0900, Michael Paquier wrote: Commit 6fcd8851, which is the result of this thread, is not touching the replication protocol at all. This looks like an oversight to me: we should be a maximum

Re: [HACKERS] replication slot restart_lsn initialization

2015-08-14 Thread Michael Paquier
On Wed, Aug 12, 2015 at 8:20 AM, Andres Freund and...@anarazel.de wrote: On 2015-08-11 15:59:59 -0700, Gurjeet Singh wrote: In your version, I don't see a comment that refers to the fact that it works on the currently active (global variable) slot. Hm? /* * Reserve WAL for the currently

Re: [HACKERS] replication slot restart_lsn initialization

2015-08-14 Thread Andres Freund
On 2015-08-14 16:44:44 +0900, Michael Paquier wrote: Commit 6fcd8851, which is the result of this thread, is not touching the replication protocol at all. This looks like an oversight to me: we should be a maximum consistent between the SQL interface and the replication protocol if possible,

Re: [HACKERS] replication slot restart_lsn initialization

2015-08-14 Thread Shulgin, Oleksandr
On Fri, Aug 14, 2015 at 9:54 AM, Andres Freund and...@anarazel.de wrote: On 2015-08-14 16:44:44 +0900, Michael Paquier wrote: Commit 6fcd8851, which is the result of this thread, is not touching the replication protocol at all. This looks like an oversight to me: we should be a maximum

Re: [HACKERS] replication slot restart_lsn initialization

2015-08-14 Thread Andres Freund
On 2015-08-14 11:09:38 +0200, Shulgin, Oleksandr wrote: Yes, but the options list you pass to START_REPLICATION ... LOGICAL, not to CREATE_REPLICATION_SLOT. I know, but we might want to extend that at some point. - Andres -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)

Re: [HACKERS] replication slot restart_lsn initialization

2015-08-11 Thread Gurjeet Singh
On Mon, Aug 10, 2015 at 7:12 AM, Andres Freund and...@anarazel.de wrote: On 2015-07-07 09:42:54 -0700, Gurjeet Singh wrote: /* + * Grab and save an LSN value to prevent WAL recycling past that point. + */ +void +ReplicationSlotRegisterRestartLSN() +{ Didn't like that description

Re: [HACKERS] replication slot restart_lsn initialization

2015-08-11 Thread Andres Freund
On 2015-08-11 15:59:59 -0700, Gurjeet Singh wrote: In your version, I don't see a comment that refers to the fact that it works on the currently active (global variable) slot. Hm? /* * Reserve WAL for the currently active slot. * * Compute and set restart_lsn in a manner that's appropriate

Re: [HACKERS] replication slot restart_lsn initialization

2015-08-10 Thread Andres Freund
On 2015-07-07 09:42:54 -0700, Gurjeet Singh wrote: --- a/src/backend/replication/slot.c +++ b/src/backend/replication/slot.c @@ -40,10 +40,10 @@ #include sys/stat.h #include access/transam.h +#include access/xlog_internal.h #include common/string.h #include miscadmin.h #include

Re: [HACKERS] replication slot restart_lsn initialization

2015-07-07 Thread Gurjeet Singh
On Tue, Jul 7, 2015 at 6:49 AM, Andres Freund and...@anarazel.de wrote: On 2015-07-07 06:41:55 -0700, Gurjeet Singh wrote: There seems to be a misplaced not operator ! in that if statement, as well. That sucks :( The MacOS gcc binary is actually clang, and its output is too noisy [1],

Re: [HACKERS] replication slot restart_lsn initialization

2015-07-07 Thread Andres Freund
On 2015-07-07 09:42:54 -0700, Gurjeet Singh wrote: On a side note, I see that the pg_create_*_replication_slot() functions do not behave transactionally; that is, rolling back a transaction does not undo the slot creation. It can't, because otherwise you couldn't run them on a standby.

Re: [HACKERS] replication slot restart_lsn initialization

2015-07-07 Thread Andres Freund
On 2015-06-10 13:13:41 -0700, Gurjeet Singh wrote: /* + * Grab and save an LSN value to prevent WAL recycling past that point. + */ +void +ReplicationSlotRegisterRestartLSN() +{ + ReplicationSlot *slot = MyReplicationSlot; + + Assert(slot != NULL); +

Re: [HACKERS] replication slot restart_lsn initialization

2015-07-07 Thread Gurjeet Singh
On Tue, Jul 7, 2015 at 4:59 AM, Andres Freund and...@anarazel.de wrote: On 2015-06-10 13:13:41 -0700, Gurjeet Singh wrote: + /* + * Log an xid snapshot for logical replication. It's not needed for + * physical slots as it is

Re: [HACKERS] replication slot restart_lsn initialization

2015-07-07 Thread Andres Freund
On 2015-07-07 06:41:55 -0700, Gurjeet Singh wrote: There seems to be a misplaced not operator ! in that if statement, as well. That sucks :( The MacOS gcc binary is actually clang, and its output is too noisy [1], which is probably why I might have missed warning if any. Which version of

Re: [HACKERS] replication slot restart_lsn initialization

2015-06-10 Thread Gurjeet Singh
On Wed, Jun 10, 2015 at 8:36 AM, Andres Freund and...@anarazel.de wrote: On 2015-06-10 08:24:23 -0700, Gurjeet Singh wrote: On Wed, Jun 10, 2015 at 8:07 AM, Andres Freund and...@anarazel.de wrote: That doesn't look right to me. Why is this code logging a standby snapshot for physical

Re: [HACKERS] replication slot restart_lsn initialization

2015-05-05 Thread Andres Freund
Hi, On 2015-05-06 00:42:14 +, Duran, Danilo wrote: I am looking to better understand the thought behind a replication slot's restart_lsn initialization. Currently in 9.4 and master, a replication slot's restart_lsn is set to InvalidXLogRecPtr and will only start tracking restart_lsn once