pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedMissing break in RelationFindReplTupleSeq
3+ messages / 2 participants
[nested] [flat]
Commits from this thread:
2020-02-03 1c7a0b387d 42e3187a82 beefab6540 380bc88295 Add missing break out seqscan loop in logical replication
* Missing break in RelationFindReplTupleSeq
@ 2020-01-31 13:46 Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Knizhnik @ 2020-01-31 13:46 UTC (permalink / raw)
To: pgsql-hackers
Eventually we find out that logical replication in the current version
of Postgres works significantly slower on table with replica identity
full than old pglogical implementation.
The comment to RelationFindReplTupleSeq says:
Note that this stops on the first matching tuple.
But actually this function continue traversal until end of the table
even if tuple was found.
I wonder if break; should be added to the end of for loop.
--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Missing break in RelationFindReplTupleSeq
@ 2020-01-31 13:58 Alvaro Herrera <alvherre@2ndquadrant.com>
parent: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
0 siblings, 1 reply; 3+ messages in thread
From: Alvaro Herrera @ 2020-01-31 13:58 UTC (permalink / raw)
To: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>; +Cc: pgsql-hackers
On 2020-Jan-31, Konstantin Knizhnik wrote:
> Eventually we find out that logical replication in the current version of
> Postgres works significantly slower on table with replica identity full than
> old pglogical implementation.
>
> The comment to RelationFindReplTupleSeq says:
>
> Note that this stops on the first matching tuple.
>
> But actually this function continue traversal until end of the table even if
> tuple was found.
> I wonder if break; should be added to the end of for loop.
Wow, you're right, and the "break" is missing there. I propose it like
this.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Attachments:
fix-replident-full.patch (text/x-diff, 435B) download
diff --git a/src/backend/executor/execReplication.c b/src/backend/executor/execReplication.c
index 582b0cb017..30cba89da7 100644
--- a/src/backend/executor/execReplication.c
+++ b/src/backend/executor/execReplication.c
@@ -327,6 +327,9 @@ retry:
XactLockTableWait(xwait, NULL, NULL, XLTW_None);
goto retry;
}
+
+ /* Found our tuple and it's not locked */
+ break;
}
/* Found tuple, try to lock it in the lockmode. */
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Missing break in RelationFindReplTupleSeq
@ 2020-02-03 22:04 Alvaro Herrera <alvherre@2ndquadrant.com>
parent: Alvaro Herrera <alvherre@2ndquadrant.com>
0 siblings, 0 replies; 3+ messages in thread
From: Alvaro Herrera @ 2020-02-03 22:04 UTC (permalink / raw)
To: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>; +Cc: pgsql-hackers
On 2020-Jan-31, Alvaro Herrera wrote:
> On 2020-Jan-31, Konstantin Knizhnik wrote:
>
> > Eventually we find out that logical replication in the current version of
> > Postgres works significantly slower on table with replica identity full than
> > old pglogical implementation.
> >
> > The comment to RelationFindReplTupleSeq says:
> >
> > Note that this stops on the first matching tuple.
> >
> > But actually this function continue traversal until end of the table even if
> > tuple was found.
> > I wonder if break; should be added to the end of for loop.
>
> Wow, you're right, and the "break" is missing there. I propose it like
> this.
Pushed, thanks for reporting.
I had one very strange thing happen while testing this -- I put the
tests to run in all branches in parallel, and they took about 12 minutes
to finish instead of the normal 5. I tried to repeat this result but
was unable to do so. My only hypothesis is that my laptop entered some
kind of low-performance mode.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2020-02-03 22:04 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-01-31 13:46 Missing break in RelationFindReplTupleSeq Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
2020-01-31 13:58 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2020-02-03 22:04 ` Alvaro Herrera <alvherre@2ndquadrant.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox