Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 484a483

Browse files
michaelpqpull[bot]
authored andcommitted
Remove unnecessary break in pg_logical_replication_slot_advance()
pg_logical_replication_slot_advance() included a break condition to stop when a targeted LSN is reached, when processing a series of WAL records with XLogReadRecord(). Since 38a9573, it matched with the check of its main while loop. This condition saved from an extra CFI check, actually pointless, so let's remove this condition and simplify the code. In passing, fix an incorrect comment. Author: Bharath Rupireddy Reviewed-by: Tom Lane, Gurjeet Singh Discussion: https://postgr.es/m/CALj2ACWfGDLQ2cy7ZKwxnJqbDkO6Yvqqrqxne5ZN4HYm=PRTGg@mail.gmail.com
1 parent 5caf4d5 commit 484a483

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/backend/replication/slotfuncs.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ pg_logical_replication_slot_advance(XLogRecPtr moveto)
500500
/* invalidate non-timetravel entries */
501501
InvalidateSystemCaches();
502502

503-
/* Decode at least one record, until we run out of records */
503+
/* Decode records until we reach the requested target */
504504
while (ctx->reader->EndRecPtr < moveto)
505505
{
506506
char *errm = NULL;
@@ -523,10 +523,6 @@ pg_logical_replication_slot_advance(XLogRecPtr moveto)
523523
if (record)
524524
LogicalDecodingProcessRecord(ctx, ctx->reader);
525525

526-
/* Stop once the requested target has been reached */
527-
if (moveto <= ctx->reader->EndRecPtr)
528-
break;
529-
530526
CHECK_FOR_INTERRUPTS();
531527
}
532528

0 commit comments

Comments
 (0)