0

Scenario:

server SERV_A, database DBNAME primary

server SERV_B, database DBNAME standby with DB2_HADR_ROS enabled

Then this situation occurs:

  1. connection CON is made from client to DBNAME when primary is on SERV_A
  2. takeover DBNAME to SERV_B -> DBNAME becomes primary on SERV_B
  3. connection is rerouted with ACR (Automatic Client Reroute) to SERV_B
  4. takeover DBNAME back to SERV_A -> DBNAME becomes primary on SERV_A
  5. Connection CON does not goes back to SERV_A but remains connected to SERV_B in readolny mode.

How to avoid this situation? The active connection remains on standby database in read only mode until you restart the connection. Even worse with some apps which are using connection pools (Websphere Application Server) when you have to restart the entire application server to force the connection pool to first connect to primary server.

This occurs with ibm db2 dsdriver with ACR configured, jdbc driver type 4. Tested on multiple versions (fixpacks) of db2 10.5 and 11.

Aljaz Vidmar
  • 165
  • 4

2 Answers2

0

ACR is not supported with reads on standby feature.

Reads on standby restrictions

Use VIPs.

-2

Have you tried this with TSAMP configured with a VIP? It has been years since I've seen someone try to rely only on ACR without TSAMP.

  • 1
    we are actually using HA cluster and TSAMP with different clients. Nevertheless this does not actually answer my question which was how to "convince" application to reconnect to primary when standby is readonly. – Aljaz Vidmar Aug 21 '18 at 08:51