aboutsummaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/logicalfuncs.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2016-05-04 17:32:22 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2016-05-04 17:32:22 -0300
commitc1543a81a7a89207b6c45b8f3f7f07b1148fcc6e (patch)
tree4a19f5b8572e10fee45f184f4b977acbad393bca /src/backend/replication/logical/logicalfuncs.c
parent6535bf399894db3597d257486062fe17311c642e (diff)
downloadpostgresql-c1543a81a7a89207b6c45b8f3f7f07b1148fcc6e.tar.gz
postgresql-c1543a81a7a89207b6c45b8f3f7f07b1148fcc6e.zip
Revert timeline following in replication slots
This reverts commits f07d18b6e94d, 82c83b337202, 3a3b309041b0, and 24c5f1a103ce. This feature has shown enough immaturity that it was deemed better to rip it out before rushing some more fixes at the last minute. There are discussions on larger changes in this area for the next release.
Diffstat (limited to 'src/backend/replication/logical/logicalfuncs.c')
-rw-r--r--src/backend/replication/logical/logicalfuncs.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/replication/logical/logicalfuncs.c b/src/backend/replication/logical/logicalfuncs.c
index 99112ac1b4d..4e4c8cdaeb2 100644
--- a/src/backend/replication/logical/logicalfuncs.c
+++ b/src/backend/replication/logical/logicalfuncs.c
@@ -234,6 +234,12 @@ pg_logical_slot_get_changes_guts(FunctionCallInfo fcinfo, bool confirm, bool bin
rsinfo->setResult = p->tupstore;
rsinfo->setDesc = p->tupdesc;
+ /* compute the current end-of-wal */
+ if (!RecoveryInProgress())
+ end_of_wal = GetFlushRecPtr();
+ else
+ end_of_wal = GetXLogReplayRecPtr(NULL);
+
ReplicationSlotAcquire(NameStr(*name));
PG_TRY();
@@ -273,12 +279,6 @@ pg_logical_slot_get_changes_guts(FunctionCallInfo fcinfo, bool confirm, bool bin
/* invalidate non-timetravel entries */
InvalidateSystemCaches();
- if (!RecoveryInProgress())
- end_of_wal = GetFlushRecPtr();
- else
- end_of_wal = GetXLogReplayRecPtr(NULL);
-
- /* Decode until we run out of records */
while ((startptr != InvalidXLogRecPtr && startptr < end_of_wal) ||
(ctx->reader->EndRecPtr != InvalidXLogRecPtr && ctx->reader->EndRecPtr < end_of_wal))
{