pgsql: Fix remote position tracking in logical replication

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix remote position tracking in logical replication
Date: 2017-04-04 12:35:17
Message-ID: E1cvNg5-000451-6F@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix remote position tracking in logical replication

We need to set the origin remote position to end_lsn, not commit_lsn, as
commit_lsn is the start of commit record, and we use the origin remote
position as start position when restarting replication stream. If we'd
use commit_lsn, we could request data that we already received from the
remote server after a crash of a downstream server.

Author: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/fe7bbc4ddb82c635ef08b5eadc5ce472ad515996

Modified Files
--------------
src/backend/replication/logical/worker.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Stephen Frost 2017-04-04 12:43:11 pgsql: Remove --verbose from PROVE_FLAGS
Previous Message Robert Haas 2017-04-04 11:45:18 pgsql: Fix formula in _hash_spareindex.