Skip to content

Commit 380bc88

Browse files
committed
Add missing break out seqscan loop in logical replication
When replica identity is FULL (an admittedly unusual case), the loop that searches for tuples in execReplication.c didn't stop scanning the table when once a matching tuple was found. Add the missing 'break'. Note slight behavior change: we now return the first matching tuple rather than the last one. They are supposed to be indistinguishable anyway, so this shouldn't matter. Author: Konstantin Knizhnik Discussion: https://postgr.es/m/379743f6-ae91-b866-f7a2-5624e6d2b0a4@postgrespro.ru
1 parent 8b1a649 commit 380bc88

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/executor/execReplication.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,9 @@ RelationFindReplTupleSeq(Relation rel, LockTupleMode lockmode,
314314
XactLockTableWait(xwait, NULL, NULL, XLTW_None);
315315
goto retry;
316316
}
317+
318+
/* Found our tuple and it's not locked */
319+
break;
317320
}
318321

319322
/* Found tuple, try to lock it in the lockmode. */

0 commit comments

Comments
 (0)