Re: logical decoding and replication of sequences - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: logical decoding and replication of sequences
Date
Msg-id 22aef14d-0ea1-9044-c2e7-29f88762eaec@enterprisedb.com
Whole thread Raw
In response to logical decoding and replication of sequences  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Responses Re: logical decoding and replication of sequences
List pgsql-hackers
Hi,

Here's a rebased version of the patch series. I decided to go back to 
the version from 2021/12/14, which does not include the changes to WAL 
logging. So this has the same issue with nextval() now waiting for WAL 
flush (and/or sync replica), as demonstrated by occasional failures of 
the TAP test in 0003, but my reasoning is this:

1) This is a preexisting issue, affecting sequences in general. It's not 
related to this patch, really. The fix will be independent of this, and 
there's little reason to block the decoding until that happens.

2) We've discussed a couple ways to fix this in [1] - logging individual 
sequence increments, flushing everything right away, waiting for page 
LSN, etc. My opinion is we'll use some form of waiting for page LSN, but 
no matter what fix we use it'll have almost no impact on this patch. 
There might be minor changes to the test, but that's about it.

3) There are ways to stabilize the tests even without that - it's enough 
to generate a little bit of WAL / get XID, not just nextval(). But 
that's only for 0003 which I don't intend to commit yet, and 0001/0002 
have no problems at all.


regards

[1] 
https://www.postgresql.org/message-id/712cad46-a9c8-1389-aef8-faf0203c9be9@enterprisedb.com

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment

pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Skipping logical replication transactions on subscriber side
Next
From: Amit Kapila
Date:
Subject: Re: Skipping logical replication transactions on subscriber side