aboutsummaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/logicalfuncs.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2014-06-29 17:08:04 +0200
committerAndres Freund <andres@anarazel.de>2014-06-30 10:49:39 +0200
commit1cbc9480106241aaa8db112331e93d0a265b6db0 (patch)
tree9d0e1f4b4d9ca54835bfac2c3050d2e119b51d4d /src/backend/replication/logical/logicalfuncs.c
parent1c6821be31f91ab92547a8ed4246762c8cefb1b3 (diff)
downloadpostgresql-1cbc9480106241aaa8db112331e93d0a265b6db0.tar.gz
postgresql-1cbc9480106241aaa8db112331e93d0a265b6db0.zip
Check interrupts during logical decoding more frequently.
When reading large amounts of preexisting WAL during logical decoding using the SQL interface we possibly could fail to check interrupts in due time. Similarly the same could happen on systems with a very high WAL volume while creating a new logical replication slot, independent of the used interface. Previously these checks where only performed in xlogreader's read_page callbacks, while waiting for new WAL to be produced. That's not sufficient though, if there's never a need to wait. Walsender's send loop already contains a interrupt check. Backpatch to 9.4 where the logical decoding feature was introduced.
Diffstat (limited to 'src/backend/replication/logical/logicalfuncs.c')
-rw-r--r--src/backend/replication/logical/logicalfuncs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/replication/logical/logicalfuncs.c b/src/backend/replication/logical/logicalfuncs.c
index 2da6bb10b22..a3a58e6a49c 100644
--- a/src/backend/replication/logical/logicalfuncs.c
+++ b/src/backend/replication/logical/logicalfuncs.c
@@ -438,6 +438,7 @@ pg_logical_slot_get_changes_guts(FunctionCallInfo fcinfo, bool confirm, bool bin
if (upto_nchanges != 0 &&
upto_nchanges <= p->returned_rows)
break;
+ CHECK_FOR_INTERRUPTS();
}
}
PG_CATCH();