Re: Patch: Implement failover on libpq connect level.

From: Mithun Cy <mithun(dot)cy(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, Peter van Hardenberg <pvh(at)pvh(dot)ca>, Peter Eisentraut <peter_e(at)gmx(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Implement failover on libpq connect level.
Date: 2016-11-17 11:33:15
Message-ID: CAD__OugQeEVEB+YdeDw9GT+CZ8M3jnbB7=KmwPhsVqEfK9Wh+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

On Thu, Nov 17, 2016 at 8:27 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>but SELECT pg_is_in_recovery() and SHOW transaction_read_only
>exist in older versions so if we pick either of those methods then it
>will just work.

I am adding next version of the patch it have following fixes.
Tsunakawa's comments
1. PGconn->target_server_type is now freed in freePGconn()
2. Added PGTARGETSERVERTYPE.

*Additional comments from others*
3. Moved from SELECT pg_is_in_recovery() to SHOW transaction_read_only now
should handle different kind of replication, as we recognise server to
which writable connection can be made as primary. Very exactly like JDBC
driver. Also documented about it.
4. renamed words from master to primary.

--
Thanks and Regards
Mithun C Y
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
failover_to_new_master-v2.patch application/octet-stream 12.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2016-11-17 11:56:11 Re: [PATCH] Generic type subscription
Previous Message Amit Langote 2016-11-17 11:27:13 Re: Declarative partitioning - another take

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tsunakawa, Takayuki 2016-11-18 01:09:46 Re: Patch: Implement failover on libpq connect level.
Previous Message Robert Haas 2016-11-17 02:57:27 Re: Patch: Implement failover on libpq connect level.