Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failover not working correctly #328

Open
Hrafnkellos opened this issue Apr 26, 2024 · 0 comments
Open

Failover not working correctly #328

Hrafnkellos opened this issue Apr 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Hrafnkellos
Copy link

Hrafnkellos commented Apr 26, 2024

What versions are you using?

2.1.2

Give your database version.

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production


    import sys
    import platform

    print("platform.platform:", platform.platform())
    print("sys.maxsize > 2**32:", sys.maxsize > 2**32)
    print("platform.python_version:", platform.python_version())

platform.platform: Linux-5.15.133.1-microsoft-standard-WSL2-x86_64-with-glibc2.31
sys.maxsize > 2**32: True
platform.python_version: 3.10.13


    import oracledb
    print("oracledb.__version__:", oracledb.__version__)

oracledb.version: 2.1.2

Is it an error or a hang or a crash?

Its an error

What error(s) or behavior you are seeing?

When I configure my connections string to failover and then take down one oracle RAC Instance the OracleDB does not switch to the other RAC Instance that is alive. Instead I get the error "Error Message: ORA-01109: database not open"

Mostly I was testing with 2 host and one dead host. I indicated the dead host first. If I switch orders of hosts then oracleDB tries to connect to the first host and successfully connects.

Cut and paste text showing the command you ran. No screenshots.

Here is an example connection string

(DESCRIPTION=(TRANSPORT_CONNECT_TIMEOUT=5)(CONNECT_TIMEOUT=5)(RETRY_DELAY=10)(RETRY_COUNT=2)(FAILOVER=ON)(LOAD_BALANCE=off)(ADDRESS=(PROTOCOL=TCP)(HOST=OracleRACInstance1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=OracleRACInstance1)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=DemoServiceName)))

Does your application call init_oracle_client()?

Yes

This tells us whether you are using the python-oracledb Thin or Thick mode.

I tried both Thin and Thick mode. It had the same result.

Include a runnable Python script that shows the problem.

import oracledb 
import environ

def start_pool():
    # Generally a fixed-size pool is recommended, i.e. pool_min=pool_max.  Here
    # the pool contains 4 connections, which will allow 4 concurrent users.

    pool_min = 4
    pool_max = 4
    pool_inc = 1

    pool = oracledb.create_pool(
        user=env('DATABASE_USER'), 
        password=env('DATABASE_PASSWORD'), 
        dsn=env('DATABASE_NAME'), # I added my connection string here
        min=pool_min,
        max=pool_max,
        increment=pool_inc,
        events=True,
    )
@Hrafnkellos Hrafnkellos added the bug Something isn't working label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant