Re: primary_conninfo missing from pg_stat_wal_receiver

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Tatsuo Ishii <ishii(at)postgresql(dot)org>, Vik Fearing <vik(at)2ndquadrant(dot)fr>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: primary_conninfo missing from pg_stat_wal_receiver
Date: 2016-06-30 12:30:19
Message-ID: CAB7nPqTpw0W6Vr8O1Vyi9LXWi9niSmXyyzh22EP9gMPGRyJ2nw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 30, 2016 at 8:59 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> (2)
> +retry:
> + SpinLockAcquire(&walrcv->mutex);
> + if (!walrcv->ready_to_display)
> + {
> + SpinLockRelease(&walrcv->mutex);
> + CHECK_FOR_INTERRUPTS();
> + pg_usleep(1000);
> + goto retry;
> + }
> + SpinLockRelease(&walrcv->mutex);
>
> ISTM that we will never be able to get out of this loop if walreceiver
> fails to connect to the master (e.g., password is wrong) after we enter
> this loop.

Wouldn't it be cleaner to just return an error here instead of retrying?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2016-06-30 12:35:27 Re: primary_conninfo missing from pg_stat_wal_receiver
Previous Message Alvaro Herrera 2016-06-30 12:30:02 Re: primary_conninfo missing from pg_stat_wal_receiver