postgres.git / summary / log / commit / refs

commit    1c7a0b387d18c517d45e2f6ec7d8b7d1b2d5fe13
Author:   Alvaro Herrera <alvherre@alvh.no-ip.org>
Date:     Mon Feb 03 21:59:12 2020 +0000
First released in: 13.0, 10.12, 11.7, 12.2

    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


src/backend/executor/execReplication.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/executor/execReplication.c b/src/backend/executor/execReplication.c index 582b0cb0175..30cba89da7e 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. */ [parent: f1f10a1ba9e1]