2
votes

I am I am testing the Fast Connection Failover(FCF) support from Oracle Universal Connection Pool (UCP) version 11.2.0.1.0. The scenario being tried out is a planned outage event. Oracle Database 11g Release 11.2.0.2.0 standard edition is the database version being used. Below are the steps I follow in my test

  1. Get a connection and print the instance it is connected to
  2. Execute "srvctl stop instance -d -n " on one of the nodes
  3. Execute a query on the connection retrieved in the first step.

The 3rd step fails with an error (ORA-03113: end-of-file on communication channel) when it shouldn't since it is a planned outage event. Analyzing the ucp logs I could see that the FAN event is received by the jdbc client and processed by marking the connection status as "STATUS_CLOSE_ON_RETURN" but still executing a query using that borrowed connection fails.

The expected outcome is that any queries executed on the borrowed connections succeeds and the connection still remains valid until it is returned back to the pool. It should be closed by the pool after that. The stop instance command shouldn't succeed until this is done.

Is there anything I am missing in the configuration? Is the above srvctl command correct?

The Oracle Pool Configuration is as below



PoolDataSourceImpl pds = new PoolDataSourceImpl();
        try {
            pds.setConnectionPoolName("Connection Pool");
            pds.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource");
            pds.setConnectionFactoryProperties(getOracleDataSourceProperties());
            pds.setDataSourceName("DataSource");
            pds.setServerName(SERVER_NAME);
            pds.setUser("system");
            pds.setPassword("pass");
            pds.setPortNumber(1521);
            pds.setMinPoolSize(0);
            pds.setMaxPoolSize(25);
            pds.setMaxIdleTime(1800);
            pds.setValidateConnectionOnBorrow(true);
            pds.setONSConfiguration("nodes=v-ind-db-11g-01:6200,v-ind-db-11g-02:6200");
            pds.setFastConnectionFailoverEnabled(true);
            pds.setInactiveConnectionTimeout(20);
            pds.setConnectionWaitTimeout(20);
            pds.setPropertyCycle(60);

            pds.startPool();
        } catch (SQLException e) {
            throw new RuntimeException("Cannot create project datasource", e);
        }

        .......
        Properties getOracleDataSourceProperties() {
            Properties p = new Properties();
            p.put("driverType", "oci");
            p.put("networkProtocol", "tcp");
            p.put("serviceName", SERVICE_NAME);
            return p;
        }

2

2 Answers

1
votes

If you do a SHUTDOWN NORMAL and then complete you transaction, does your app continue gracefully?

Looks like srvctl stop instance -d XXX -n YYY -o normal should do this.

This thread suggests the default shutdown method for srvctl is "immediate" which would explain what you are seeing.

1
votes

I was able to test the UCP support for FCF with two changes

  1. Creating a new service. The service used in the initial attempt was the default one and the FCF feature does not work with the default service as stated here in a Note.

  2. Stopping the service instead of the instance. Stopping an instance would simulate an unplanned outage instead of a planned one.