Re: logical decoding and replication of sequences
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: vignesh C <vignesh21@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Petr Jelinek <petr.jelinek@enterprisedb.com>
Date: 2021-07-30T18:58:16Z
Lists: pgsql-hackers
On Tue, Jul 20, 2021 at 5:41 PM Tomas Vondra <tomas.vondra@enterprisedb.com> wrote: > I think the crucial aspect of this that needs discussion/feedback the > most is the transactional vs. non-transactional behavior. All the other > questions are less important / cosmetic. Yeah, it seems really tricky to me to get this right. The hard part is, I think, mostly figuring out what the right behavior really is. DDL in PostgreSQL is transactional. Non-DDL operations on sequences are non-transactional. If a given transaction does only one of those things, it seems clear enough what to do, but when the same (sub)transaction does both, it gets messy. I'd be tempted to think about something like: 1. When a transaction performs only non-transactional operations on sequences, they are emitted immediately. 2. If a transaction performs transactional operations on sequences, the decoded operations acquire a dependency on the transaction and cannot be emitted until that transaction is fully decoded. When commit or abort of that XID is reached, emit the postponed non-transactional operations at that point. I think this is similar to what you've designed, but I'm not sure that it's exactly equivalent. I think in particular that it may be better to insist that all of these operations are non-transactional and that the debate is only about when they can be sent, rather than trying to sort of convert them into an equivalent series of transactional operations. That approach seems confusing especially in the case where some (sub)transactions abort. But this is just my $0.02. -- Robert Haas EDB: http://www.enterprisedb.com
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