Please implement simple failover scenario - Mailing list pgsql-jdbc

From Enrico Olivelli - Diennea
Subject Please implement simple failover scenario
Date
Msg-id ADD972C51196844491C410BCD4146DCD60A99AA817@dnaexc01.diennea.lan
Whole thread Raw
Responses Re: Please implement simple failover scenario
List pgsql-jdbc

Hi,

we are going to switch from Oracle to PostgreSQL and we would like to setup a simple hot-standby/warm-standby replication scenario.

Actually your JDBC driver does not have native support for failover to the slave host.

 

We are interestend in this scenario in order to implement the warm-standby case:

 

Case 1: WARM-STANDBY (slave is not accepting connections)

 

JDBC configuration:   use URL1 on getConnection….and URL2 as failover

Step of “getConnection”:

1)      Connect to URL1

2)      Connection OK à proceed with URL1

3)      Connection FAILED à proceed with URL2

 

Case 2: HOT-STANDBY (slave is accepting connections)

 

In order to implement the hot-standby we need to configure a query on getConnection in order to ask to the server if actually it is the actual “master”

 

1)      Connect to URL1

2)      Connection OK

a.       Ask “Are you the master?”

b.      Yes à proceed with URL1

c.       No à proceed with URL2

3)      Connection FAILED

a.       proceed with URL2

 

I known that this implementation is really “skinny” and some more advanced features are needed for more complete setups but this is what we need

 

We can contribute with some patch

 

 

Enrico Olivelli
Software Development Manager @Diennea
Tel.: (+39) 0546 066100 - Int. 925
Viale G.Marconi 30/14 - 48018 Faenza (RA)

MagNews - E-mail Marketing Solutions
http://www.magnews.it
Diennea -
Digital Marketing Solutions
http://www.diennea.com

 

 



Rimani aggiornato sul mondo dell’email marketing e del digital marketing: visita il nostro blog! http://blog.magnews.it

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Patch to allow setting schema/search_path in the connectionURL
Next
From: Enrico Olivelli - Diennea
Date:
Subject: Disk buffering of resultsets