Re: logical decoding and replication of sequences
Tomas Vondra <tomas.vondra@enterprisedb.com>
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>,
Petr Jelinek <petr.jelinek@enterprisedb.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-01-28T00:25:24Z
Lists: pgsql-hackers
Attachments
- 0001-Logical-decoding-of-sequences-20220128.patch (text/x-patch) patch 0001
- 0002-Add-support-for-decoding-sequences-to-test_-20220128.patch (text/x-patch) patch 0002
- 0003-Add-support-for-decoding-sequences-to-built-20220128.patch (text/x-patch) patch 0003
On 1/27/22 17:05, Peter Eisentraut wrote: > On 27.01.22 00:32, Tomas Vondra wrote: >> >> On 1/26/22 14:01, Petr Jelinek wrote: >>> I would not remove it altogether, there is plenty of consumers of >>> this extension's output in the wild (even if I think it's >>> unfortunate) that might not be interested in sequences, but changing >>> it to off by default certainly makes sense. >> >> Indeed. Attached is an updated patch series, with 0003 switching it to >> false by default (and fixing the fallout). For commit I'll merge that >> into 0002, of course. > > (could be done in separate patches too IMO) > > test_decoding.c uses %zu several times for int64 values, which is not > correct. This should use INT64_FORMAT or %lld with a cast to (long long > int). > Good point - INT64_FORMAT seems better. Also, the formatting was not quite right (missing space between the colon), so I fixed that too. > I don't know, maybe it's worth commenting somewhere how the expected > values in contrib/test_decoding/expected/sequence.out come about. > Otherwise, it's quite a puzzle to determine where the 3830 comes from, > for example. > Yeah, that's probably a good idea - I had to think about the expected output repeatedly, so an explanation would help. I'll do that in the next version of the patch. > I think the skip-sequences options is better turned around into a > positive name like include-sequences. There is a mix of "skip" and > "include" options in test_decoding, but there are more "include" ones > right now. > Hmmm. I don't see much difference between skip-sequences and include-sequences, but I don't feel very strongly about it either so I switched that to include-sequences (which defaults to true). > In the 0003, a few files have been missed, apparently, so the tests > don't fully pass. See attached patch. > D'oh! I'd swear I've fixed those too. > I haven't looked fully through the 0004 patch, but I notice that there > was a confusing mix of FOR ALL SEQUENCE and FOR ALL SEQUENCES. I have > corrected that in the other attached patch. > > Other than the mentioned cosmetic issues, I think 0001-0003 are ready to go. Thanks. I think we'll have time to look at 0004 more closely once the initial parts get committed. Attached is a a rebased/squashed version of the patches, with all the fixes discussed here. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Fix cache invalidation bug in recovery_prefetch.
- d0d934490020 15.0 landed
- 932b01630095 16.0 landed
-
Revert "Logical decoding of sequences"
- 2c7ea57e56ca 15.0 landed
-
Minor improvements in sequence decoding code and docs
- 05843b1aa49d 15.0 landed
-
Handle sequences in preprocess_pubobj_list
- 002c9dd97a0c 15.0 landed
-
Update tab-completion for CREATE PUBLICATION with sequences
- 2d2232933b02 15.0 landed
-
Add decoding of sequences to built-in replication
- 75b1521dae1f 15.0 landed
-
Stabilize test_decoding touching with sequences
- a180c2b34de0 15.0 landed
-
Call ReorderBufferProcessXid from sequence_decode
- d5ed9da41d96 15.0 landed
-
Add decoding of sequences to test_decoding
- 80901b32913f 15.0 landed
-
Replace Test::More plans with done_testing
- 549ec201d613 15.0 cited
-
Logical decoding of sequences
- 0da92dc530c9 15.0 landed
-
Respect permissions within logical replication.
- a2ab9c06ea15 15.0 cited