Re: Include sequence relation support in logical replication

2020-05-08 Thread Andres Freund
Hi, On 2020-05-08 16:32:38 -0700, Cary Huang wrote: > I have added more regression test cases to the sequence replication > patch with emphasis on transactions and rollback per your > suggestions. I find that when a transaction is aborted with rollback, > the decoder plugin will not receive the ch

Re: Include sequence relation support in logical replication

2020-05-08 Thread Cary Huang
Hi Craig I have added more regression test cases to the sequence replication patch with emphasis on transactions and rollback per your suggestions. I find that when a transaction is aborted with rollback, the decoder plugin will not receive the change but the sequence value will in fact advan

Re: Include sequence relation support in logical replication

2020-04-16 Thread Cary Huang
Hi Craig, Andres Thank you guys so much for your reviews and comments. Really helpful. Yes you guys are right, Sequence does not guarantee free of gaps and replicating sequence is useful for failover cases, then there will be no problem for a subscriber to get a future value 32 increments aft

Re: Include sequence relation support in logical replication

2020-04-15 Thread Craig Ringer
On Thu, 16 Apr 2020 at 07:44, Andres Freund wrote: > > > I would like to ask if you have some suggestions or ideas that can make > subscriber receives the current value without the need to > > > > disabling the 32 increment behavior? > > It simply shouldn't expect that to be the case. What do yo

Re: Include sequence relation support in logical replication

2020-04-15 Thread Andres Freund
Hi, On 2020-03-26 15:33:33 -0700, Cary Huang wrote: > >> For the replication to make sense, the patch actually disables the WAL > > >> update at every 32 nextval() calls, so every call to nextval() will > > >> emit a WAL update for proper replication. This is done by setting > > >> SEQ_LOG_

Re: Include sequence relation support in logical replication

2020-03-26 Thread Cary Huang
Hi Andres thanks for your reply and your patch review. Please see my comments below >On 2020-03-24 16:19:21 -0700, Cary Huang wrote: >> I have shared a patch that allows sequence relation to be supported in >> logical replication via the decoding plugin ( test_decoding for >> example );

Re: Include sequence relation support in logical replication

2020-03-25 Thread Michael Paquier
On Wed, Mar 25, 2020 at 12:27:28PM -0700, Andres Freund wrote: > On 2020-03-24 16:19:21 -0700, Cary Huang wrote: >> For the replication to make sense, the patch actually disables the WAL >> update at every 32 nextval() calls, so every call to nextval() will >> emit a WAL update for proper replicati

Re: Include sequence relation support in logical replication

2020-03-25 Thread Andres Freund
Hi, On 2020-03-24 16:19:21 -0700, Cary Huang wrote: > I have shared a patch that allows sequence relation to be supported in > logical replication via the decoding plugin ( test_decoding for > example ); it does not support sequence relation in logical > replication between a PG publisher and a PG

Re: Include sequence relation support in logical replication

2020-03-24 Thread Andres Freund
On 2020-03-24 16:19:21 -0700, Cary Huang wrote: > Hi > > > > From the PG logical replication documentation, I see that there is a > listed limitation that sequence relation is not replicated > logically. After some examination, I see that retrieving the next > value from a sequence using the nex

Include sequence relation support in logical replication

2020-03-24 Thread Cary Huang
Hi >From the PG logical replication documentation, I see that there is a listed >limitation that sequence relation is not replicated logically. After some >examination, I see that retrieving the next value from a sequence using the >nextval() call will emits a WAL update every 32 calls to nex