pg_rewind hangs if --source-server is used and syncrep is enabled

From: Michael Banck <michael(dot)banck(at)credativ(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pg_rewind hangs if --source-server is used and syncrep is enabled
Date: 2016-10-05 14:39:39
Message-ID: 20161005143938.GA12247@nighthawk.caipicrew.dd-dns.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

if pg_rewind is told to fetch data via a libpq connection
(--source-server), synchronous replication is enabled and there is only
one sync standby (pilot error, but sill); pg_rewinding the old master
hangs at the CREATE TEMPORARY TABLE step (CREATE TABLE waiting for
X/XXXXXXXX). At least this happened to one of our clients while
evaluating pg_rewind.

To the user, the last thing printed is "need to copy XXXX MB [...]". If
the user cancels the pg_rewind command with ^C, the backend keeps
hanging around even in --dry-run mode. That won't hurt too much as it
does not seem to block future pg_rewind runs after synchronous_commit
has been set to a different value, but looks surprising to me.

Not sure whether pg_rewind could error out gracefully without hanging in
this case, but maybe it could/should clean up the query on SIGTERM? And
at the least, maybe this caveat should be documented?

Michael

--
Michael Banck
Projektleiter / Senior Berater
Tel.: +49 2166 9901-171
Fax: +49 2166 9901-100
Email: michael(dot)banck(at)credativ(dot)de

credativ GmbH, HRB Mönchengladbach 12080
USt-ID-Nummer: DE204566209
Trompeterallee 108, 41189 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2016-10-05 14:45:23 Re: WIP: Secure Transport support as OpenSSL alternative on macOS
Previous Message Masahiko Sawada 2016-10-05 14:28:40 Autovacuum launcher process launches worker process at high frequency