Re: logical decoding and replication of sequences
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>,
Noah Misch <noah@leadboat.com>, Amit Kapila <amit.kapila16@gmail.com>,
Petr Jelinek <petr.jelinek@enterprisedb.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-08-29T21:42:02Z
Lists: pgsql-hackers
Attachments
- v2-0001-Fix-cache-invalidation-in-rare-recovery_prefetch-.patch (text/x-patch) patch v2-0001
- v2-0002-Improve-xlogrecovery.c-xlogreader.c-boundary.patch (text/x-patch) patch v2-0002
- v2-0003-Don-t-retry-inside-XLogPageRead-if-reading-ahead.patch (text/x-patch) patch v2-0003
On Tue, Aug 30, 2022 at 6:04 AM Tomas Vondra <tomas.vondra@enterprisedb.com> wrote: > On 8/29/22 12:21, Thomas Munro wrote: > > 0001: Instead of figuring out when to invalidate the cache, let's > > just invalidate it before every read attempt. It is only marked valid > > after success (ie state->readLen > 0). No need to worry about error > > cases. > > Maybe I misunderstand how all this works, but won't this have a really > bad performance impact. If not, why do we need the cache at all? It's a bit confusing because there are several levels of "read". The cache remains valid as long as the caller of ReadPageInternal() keeps asking for data that is in range (see early return after comment "/* check whether we have all the requested data already */"). As soon as the caller asks for something not in range, this patch marks the cache invalid before calling the page_read() callback (= XLogPageRead()). It is only marked valid again after that succeeds. Here's a new version with no code change, just a better commit message to try to explain that more clearly.
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