summaryrefslogtreecommitdiff
path: root/oslo_db/sqlalchemy
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2021-03-31 18:36:35 +0100
committerStephen Finucane <stephenfin@redhat.com>2021-07-28 18:10:53 +0100
commitbd69e86d523a5f44d061310373c0516881bd8624 (patch)
treeecf53a232b1a198358a75aa512a932d4af2ef123 /oslo_db/sqlalchemy
parentf3bdd4d4220a884e4752ce6b61c2605bfd72f2fb (diff)
downloadoslo-db-bd69e86d523a5f44d061310373c0516881bd8624.tar.gz
Drop checks for IBM DB2
This hasn't been supported by any project for many years. Quoting from the nova patch that removed DB2 support [1] This removes db2 support from tree completely. This is an oddball non open database that made doing live data migrations difficult. It is used by 0% of users in the OpenStack User Survey. Supporting commercial software that doesn't have users at the cost of delivering features and fixes to our community is the wrong tradeoff. This corrects that. There's no need to keep this around. [1] Ifeb9929e4515e3483eb65d371126afd7672b92a4 Change-Id: I8c3f23083e09e5ac924e35d1b7b3248a0d074e1b Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Diffstat (limited to 'oslo_db/sqlalchemy')
-rw-r--r--oslo_db/sqlalchemy/engines.py2
-rw-r--r--oslo_db/sqlalchemy/exc_filters.py43
-rw-r--r--oslo_db/sqlalchemy/provision.py2
3 files changed, 10 insertions, 37 deletions
diff --git a/oslo_db/sqlalchemy/engines.py b/oslo_db/sqlalchemy/engines.py
index 0e19c18..de3719a 100644
--- a/oslo_db/sqlalchemy/engines.py
+++ b/oslo_db/sqlalchemy/engines.py
@@ -69,7 +69,7 @@ def _connect_ping_listener(connection, branch):
connection.should_close_with_result = False
try:
# run a SELECT 1. use a core select() so that
- # any details like that needed by Oracle, DB2 etc. are handled.
+ # any details like that needed by the backend are handled.
connection.scalar(select([1]))
except exception.DBConnectionError:
# catch DBConnectionError, which is raised by the filter
diff --git a/oslo_db/sqlalchemy/exc_filters.py b/oslo_db/sqlalchemy/exc_filters.py
index 2b3ce2c..e578987 100644
--- a/oslo_db/sqlalchemy/exc_filters.py
+++ b/oslo_db/sqlalchemy/exc_filters.py
@@ -67,29 +67,25 @@ def filters(dbname, exception_type, regex):
r"^.*\b1213\b.*Deadlock: wsrep aborted.*")
@filters("postgresql", sqla_exc.OperationalError, r"^.*deadlock detected.*")
@filters("postgresql", sqla_exc.DBAPIError, r"^.*deadlock detected.*")
-@filters("ibm_db_sa", sqla_exc.DBAPIError, r"^.*SQL0911N.*")
def _deadlock_error(operational_error, match, engine_name, is_disconnect):
"""Filter for MySQL or Postgresql deadlock error.
NOTE(comstud): In current versions of DB backends, Deadlock violation
messages follow the structure:
- mysql+mysqldb:
- (OperationalError) (1213, 'Deadlock found when trying to get lock; try '
- 'restarting transaction') <query_str> <query_args>
+ mysql+mysqldb::
- mysql+mysqlconnector:
- (InternalError) 1213 (40001): Deadlock found when trying to get lock; try
- restarting transaction
+ (OperationalError) (1213, 'Deadlock found when trying to get lock; '
+ 'try restarting transaction') <query_str> <query_args>
- postgresql:
- (TransactionRollbackError) deadlock detected <deadlock_details>
+ mysql+mysqlconnector::
+ (InternalError) 1213 (40001): Deadlock found when trying to get lock;
+ try restarting transaction
- ibm_db_sa:
- SQL0911N The current transaction has been rolled back because of a
- deadlock or timeout <deadlock details>
+ postgresql::
+ (TransactionRollbackError) deadlock detected <deadlock_details>
"""
raise exception.DBDeadlock(operational_error)
@@ -137,9 +133,6 @@ def _default_dupe_key_error(integrity_error, match, engine_name,
key 'c1'
N columns - (IntegrityError) 1062 (23000): Duplicate entry 'values
joined with -' for key 'name_of_our_constraint'
-
-
-
"""
columns = match.group('columns')
@@ -184,7 +177,6 @@ def _sqlite_dupe_key_error(integrity_error, match, engine_name, is_disconnect):
sqlite since 3.8.2:
(IntegrityError) PRIMARY KEY must be unique
-
"""
columns = []
# NOTE(ochuprykov): We can get here by last filter in which there are no
@@ -321,24 +313,6 @@ def _check_database_non_existing(
raise exception.DBNonExistentDatabase(database, error)
-@filters("ibm_db_sa", sqla_exc.IntegrityError, r"^.*SQL0803N.*$")
-def _db2_dupe_key_error(integrity_error, match, engine_name, is_disconnect):
- """Filter for DB2 duplicate key errors.
-
- N columns - (IntegrityError) SQL0803N One or more values in the INSERT
- statement, UPDATE statement, or foreign key update caused by a
- DELETE statement are not valid because the primary key, unique
- constraint or unique index identified by "2" constrains table
- "NOVA.KEY_PAIRS" from having duplicate values for the index
- key.
-
- """
-
- # NOTE(mriedem): The ibm_db_sa integrity error message doesn't provide the
- # columns so we have to omit that from the DBDuplicateEntry error.
- raise exception.DBDuplicateEntry([], integrity_error)
-
-
@filters("mysql", sqla_exc.DBAPIError, r".*\b1146\b")
def _raise_mysql_table_doesnt_exist_asis(
error, match, engine_name, is_disconnect):
@@ -400,7 +374,6 @@ def _raise_operational_errors_directly_filter(operational_error,
@filters("mysql", sqla_exc.InternalError, r".*\(.*(?:1927)") # noqa
@filters("mysql", sqla_exc.InternalError, r".*Packet sequence number wrong") # noqa
@filters("postgresql", sqla_exc.OperationalError, r".*could not connect to server") # noqa
-@filters("ibm_db_sa", sqla_exc.OperationalError, r".*(?:30081)")
def _is_db_connection_error(operational_error, match, engine_name,
is_disconnect):
"""Detect the exception as indicating a recoverable error on connect."""
diff --git a/oslo_db/sqlalchemy/provision.py b/oslo_db/sqlalchemy/provision.py
index 5addab4..199cba2 100644
--- a/oslo_db/sqlalchemy/provision.py
+++ b/oslo_db/sqlalchemy/provision.py
@@ -263,7 +263,7 @@ class Backend(object):
eng = sqlalchemy.create_engine(url)
except ImportError as i_e:
# SQLAlchemy performs an "import" of the DBAPI module
- # within create_engine(). So if ibm_db_sa, cx_oracle etc.
+ # within create_engine(). So if mysql etc.
# isn't installed, we get an ImportError here.
LOG.info(
"The %(dbapi)s backend is unavailable: %(err)s",