Re: logical copy_replication_slot issues

2020-03-18 Thread Masahiko Sawada
On Wed, 18 Mar 2020 at 04:24, Alvaro Herrera wrote: > > Thanks Arseny and Masahiko, I pushed this patch just now. I changed > some comments while at it, hopefully they are improvements. > > On 2020-Mar-09, Masahiko Sawada wrote: > > > ctx = CreateInitDecodingContext(plugin, NIL, > > -

Re: logical copy_replication_slot issues

2020-03-17 Thread Alvaro Herrera
Thanks Arseny and Masahiko, I pushed this patch just now. I changed some comments while at it, hopefully they are improvements. On 2020-Mar-09, Masahiko Sawada wrote: > ctx = CreateInitDecodingContext(plugin, NIL, > - false, /* do not build snapshot */ > +

Re: logical copy_replication_slot issues

2020-03-09 Thread Masahiko Sawada
On Mon, 9 Mar 2020 at 21:46, Arseny Sher wrote: > > > Masahiko Sawada writes: > > > /* > > -* Create logical decoding context, to build the initial snapshot. > > +* Create logical decoding context to find start point or, if we don't > > +* need it, to 1) bump slot's restart_lsn an

Re: logical copy_replication_slot issues

2020-03-09 Thread Arseny Sher
Masahiko Sawada writes: > /* > -* Create logical decoding context, to build the initial snapshot. > +* Create logical decoding context to find start point or, if we don't > +* need it, to 1) bump slot's restart_lsn and xmin 2) check plugin sanity. > */ > > Do we need to num

Re: logical copy_replication_slot issues

2020-03-08 Thread Masahiko Sawada
On Fri, 6 Mar 2020 at 20:02, Arseny Sher wrote: > > I wrote: > > > It looks good to me now. > > After lying for some time in my head it reminded me that > CreateInitDecodingContext not only pegs the LSN, but also xmin, so > attached makes a minor comment correction. > > While taking a look at the

Re: logical copy_replication_slot issues

2020-03-06 Thread Arseny Sher
I wrote: > It looks good to me now. After lying for some time in my head it reminded me that CreateInitDecodingContext not only pegs the LSN, but also xmin, so attached makes a minor comment correction. While taking a look at the nearby code it seemed weird to me that GetOldestSafeDecodingTransa

Re: logical copy_replication_slot issues

2020-03-04 Thread Arseny Sher
Masahiko Sawada writes: > I've attached the updated version patch that incorporated your > comments. I believe we're going in the right direction for fixing this > bug. I'll register this item to the next commit fest so as not to > forget. I've moved confirmed_flush check to the second lookup o

Re: logical copy_replication_slot issues

2020-02-19 Thread Masahiko Sawada
On Mon, 10 Feb 2020 at 23:01, Arseny Sher wrote: > > > Masahiko Sawada writes: > > > I've attached the draft patch fixing this issue but I'll continue > > investigating it more deeply. > > There also should be a check that source slot itself has consistent > snapshot (valid confirmed_flush) -- ot

Re: logical copy_replication_slot issues

2020-02-10 Thread Arseny Sher
Masahiko Sawada writes: > I've attached the draft patch fixing this issue but I'll continue > investigating it more deeply. There also should be a check that source slot itself has consistent snapshot (valid confirmed_flush) -- otherwise it might be possible to create not initialized slot whic

Re: logical copy_replication_slot issues

2020-02-09 Thread Masahiko Sawada
On Mon, 10 Feb 2020 at 01:29, Arseny Sher wrote: > > Hi, > > While jumping around partically decoded xacts questions [1], I've read > through the copy replication slots code (9f06d79ef) and found a couple > of issues. > > 1) It seems quite reckless to me to dive into > DecodingContextFindStartpoin

logical copy_replication_slot issues

2020-02-09 Thread Arseny Sher
Hi, While jumping around partically decoded xacts questions [1], I've read through the copy replication slots code (9f06d79ef) and found a couple of issues. 1) It seems quite reckless to me to dive into DecodingContextFindStartpoint without actual WAL reservation (donors slot restart_lsn is used,