Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1cbc948

Browse files
committed
Check interrupts during logical decoding more frequently.
When reading large amounts of preexisting WAL during logical decodingusing the SQL interface we possibly could fail to check interrupts indue time. Similarly the same could happen on systems with a very highWAL volume while creating a new logical replication slot, independentof the used interface.Previously these checks where only performed in xlogreader's read_pagecallbacks, while waiting for new WAL to be produced. That's notsufficient though, if there's never a need to wait. Walsender's sendloop already contains a interrupt check.Backpatch to 9.4 where the logical decoding feature was introduced.
1 parent1c6821b commit1cbc948

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

‎src/backend/replication/logical/logical.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,6 @@ DecodingContextFindStartpoint(LogicalDecodingContext *ctx)
451451
XLogRecord*record;
452452
char*err=NULL;
453453

454-
/*
455-
* If the caller requires that interrupts be checked, the read_page
456-
* callback should do so, as those will often wait.
457-
*/
458-
459454
/* the read_page callback waits for new WAL */
460455
record=XLogReadRecord(ctx->reader,startptr,&err);
461456
if (err)
@@ -470,6 +465,8 @@ DecodingContextFindStartpoint(LogicalDecodingContext *ctx)
470465
/* only continue till we found a consistent spot */
471466
if (DecodingContextReady(ctx))
472467
break;
468+
469+
CHECK_FOR_INTERRUPTS();
473470
}
474471

475472
ctx->slot->data.confirmed_flush=ctx->reader->EndRecPtr;

‎src/backend/replication/logical/logicalfuncs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ pg_logical_slot_get_changes_guts(FunctionCallInfo fcinfo, bool confirm, bool bin
438438
if (upto_nchanges!=0&&
439439
upto_nchanges <=p->returned_rows)
440440
break;
441+
CHECK_FOR_INTERRUPTS();
441442
}
442443
}
443444
PG_CATCH();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp