gluent / goe

GOE: a simple and flexible way to copy data from an Oracle Database to Google BigQuery.
Apache License 2.0
8 stars 2 forks source link

Make Oracle session code more robust in oracle_offload_transport_rdbms_api.py #160

Closed swnerd closed 2 months ago

swnerd commented 2 months ago

Add handling for session to retry on connection errors like ORA-3113. File "/opt/goe/offload/.venv/lib64/python3.11/site-packages/goe/offload/oracle/oracle_offload_transport_rdbms_api.py", line 511, in get_rdbms_scn scn = ora_curs.execute("SELECT current_scn FROM v$database").fetchone()[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cx_Oracle.DatabaseError: DPI-1080: connection was closed by ORA-3113

nj1973 commented 2 months ago

We intentionally close Oracle connections during Offload transport to get around problems with idle sessions being sniped. We recently introduced a bug by moving code that checked the oracle version to later in the process of building a transport source query without including a disconnect. Due to this a second partition chunk failed with ORA-3113.

If Offload transport used OracleFrontendApi then this would not have happened, I've created an issue for that, https://github.com/gluent/goe/issues/161, but for now we should introduce the missing disconnect.