pgsql: Fix initial sync of slot parent directory when restoring status

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix initial sync of slot parent directory when restoring status
Date: 2018-09-02 19:42:32
Message-ID: E1fwYGW-0001YY-KF@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix initial sync of slot parent directory when restoring status

At the beginning of recovery, information from replication slots is
recovered from disk to memory. In order to ensure the durability of the
information, the status file as well as its parent directory are
synced. It happens that the sync on the parent directory was done
directly using the status file path, which is logically incorrect, and
the current code has been doing a sync on the same object twice in a
row.

Reported-by: Konstantin Knizhnik
Diagnosed-by: Konstantin Knizhnik
Author: Michael Paquier
Discussion: https://postgr.es/m/9eb1a6d5-b66f-2640-598d-c5ea46b8f68a@postgrespro.ru
Backpatch-through: 9.4-

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/680f89e5613cc859356152ae65597c78f0cea4dd

Modified Files
--------------
src/backend/replication/slot.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tomas Vondra 2018-09-03 00:31:30 pgsql: Fix memory leak in TRUNCATE decoding
Previous Message Tom Lane 2018-09-01 20:03:06 pgsql: Doc: fix oversights in "Client/Server Character Set Conversions"