Re: logical decoding and replication of sequences
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Petr Jelinek <petr.jelinek@enterprisedb.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-04-02T10:35:35Z
Lists: pgsql-hackers
On Fri, Apr 1, 2022 at 8:32 PM Tomas Vondra <tomas.vondra@enterprisedb.com> wrote: > > On 3/28/22 07:29, Amit Kapila wrote: > > I thought about changing snapshot dealing of > > non-transactional sequence changes similar to transactional ones but > > that also won't work because it is only at commit we decide whether we > > can send the changes. > > > I wonder if there's some earlier LSN (similar to the consistent point) > which might be useful for this. > > Or maybe we should queue even the non-transactional changes, not > per-transaction but in a global list, and then at each commit either > discard inspect them (at that point we know the lowest LSN for all > transactions and the consistent point). Seems complex, though. > I couldn't follow '..discard inspect them ..'. Do you mean we inspect them and discard whichever are not required? It seems here we are talking about a new global ReorderBufferGlobal instead of ReorderBufferTXN to collect these changes but we don't need only consistent point LSN because we do send if the commit of containing transaction is after consistent point LSN, so we need some transaction information as well. I think it could bring new challenges. > > For the transactional case, as we are considering the create sequence > > operation as transactional, we would unnecessarily queue them even > > though that is not required. Basically, they don't need to be > > considered transactional and we can simply ignore such messages like > > other DDLs. But for that probably we need to distinguish Alter/Create > > case which may or may not be straightforward. Now, queuing them is > > probably harmless unless it causes the transaction to spill/stream. > > > > I'm not sure I follow. Why would we queue them unnecessarily? > > Also, there's the bug with decoding changes in transactions that create > the sequence and add it to a publication. I think the agreement was that > this behavior was incorrect, we should not decode changes until the > subscription is refreshed. Doesn't that mean can't be any CREATE case, > just ALTER? > Yeah, but how will we distinguish them. Aren't they using the same kind of WAL record? -- With Regards, Amit Kapila.
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