pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Victor Wagner <vitus@wagner.pp.ru>
To: pgsql-hackers@postgresql.org
Subject: Re: Patch: Implement failover on libpq connect level.
Date: Mon, 9 Nov 2015 12:44:04 +0300
Message-ID: <20151109124404.1af6ba0c@fafnir> (raw)
In-Reply-To: <CAMsr+YHr740oGcVQcuyvLt1bwBPLQtpm5U-O+tTEFifBgHWdzw@mail.gmail.com>
References: <20150818041850.GA5092@wagner.pp.ru>
	<20151014104151.GA6744@wagner.pp.ru>
	<562E8C55.9030409@gmx.net>
	<20151028111839.6e73c68a@fafnir>
	<56327381.5040108@gmx.net>
	<CA+TgmoY8J2Jp1fM4EmtU6=3hHLpHc9+qyOJW3OgCNRN6QTgyDg@mail.gmail.com>
	<56379A44.9080609@gmx.net>
	<20151105151235.GA21434@wagner.pp.ru>
	<CA+TgmoYKvGsZGJB-cKU=xhHnq=b6XOM=qbseVC72HwH2+p5+TA@mail.gmail.com>
	<CAMsr+YGXTK3+i5zL3AkkR5BRP+Tw+f4+Ph=Z2_g7KD-nbb+cYg@mail.gmail.com>
	<20151106153807.GA6104@alvherre.pgsql>
	<CA+TgmoYYUeojjos=7ZT6Emkmri1f4n753tx9v7jEU-y28_8zOw@mail.gmail.com>
	<CAMsr+YHr740oGcVQcuyvLt1bwBPLQtpm5U-O+tTEFifBgHWdzw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On Mon, 9 Nov 2015 15:14:02 +0800
Craig Ringer <craig@2ndquadrant.com> wrote:


> 
> I'd rather not see convoluted and complex connstrings, per my prior
> post. The JDBC extended URL style seems good enough.

It is what my patch implements.
 
> IMO the biggest problem is that client-side failover is way more
> complex than "got -ECONNREFUSED, try next host". I think we're all
> focusing on not being able to twiddle arbitrary settings while
> ignoring the real problem with client failover, i.e. making it
> actually work in the real world.
> 
I've tried to deal with some of these problems. 

My patch have support for following things:

1. Check whether database instance is in the recovery/standby mode and
try to find another one if so.
2. Let cluster management software to have some time to promote one of
the standbys to master. I.e. there can be failover timeout specified to
allow retry after some time if no working master found.

Really there is room for some improvements in handling of connect
timeout (which became much more important thing when ability to try
next host appears). Now it is handled only by blocking-mode connect
functions, not by async state machine. But I decided to publish patch
without these improvements to get feedback from community.




-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (165+ messages)  latest in thread

Message-ID: <20151109124404.1af6ba0c@fafnir>
Permalink:  ../20151109124404.1af6ba0c@fafnir/
Also on:    postgresql.org/message-id/20151109124404.1af6ba0c@fafnir

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: vitus@wagner.pp.ru, pgsql-hackers@postgresql.org
  Subject: Re: Patch: Implement failover on libpq connect level.
  In-Reply-To: <20151109124404.1af6ba0c@fafnir>
  References: <20150818041850.GA5092@wagner.pp.ru> <20151014104151.GA6744@wagner.pp.ru> <562E8C55.9030409@gmx.net> <20151028111839.6e73c68a@fafnir> <56327381.5040108@gmx.net> <CA+TgmoY8J2Jp1fM4EmtU6=3hHLpHc9+qyOJW3OgCNRN6QTgyDg@mail.gmail.com> <56379A44.9080609@gmx.net> <20151105151235.GA21434@wagner.pp.ru> <CA+TgmoYKvGsZGJB-cKU=xhHnq=b6XOM=qbseVC72HwH2+p5+TA@mail.gmail.com> <CAMsr+YGXTK3+i5zL3AkkR5BRP+Tw+f4+Ph=Z2_g7KD-nbb+cYg@mail.gmail.com> <20151106153807.GA6104@alvherre.pgsql> <CA+TgmoYYUeojjos=7ZT6Emkmri1f4n753tx9v7jEU-y28_8zOw@mail.gmail.com> <CAMsr+YHr740oGcVQcuyvLt1bwBPLQtpm5U-O+tTEFifBgHWdzw@mail.gmail.com> <20151109124404.1af6ba0c@fafnir>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox