]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/mgr_module: turn off all automatic transactions 61763/head
authorPatrick Donnelly <pdonnell@ibm.com>
Wed, 12 Feb 2025 02:28:40 +0000 (21:28 -0500)
committerPatrick Donnelly <pdonnell@ibm.com>
Wed, 12 Feb 2025 02:48:25 +0000 (21:48 -0500)
I misunderstood autocommit=False in prior patches. The sqlite3 binding will
still create transactions automatically which confused newer bindings using
autocommit.

So, turn off automatic transaction management completely to maintain backwards
compatibility.

Fixes: https://tracker.ceph.com/issues/69912
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/pybind/mgr/mgr_module.py

index 76ad8d9d0ce35839931c26f8665f93071962d917..8d45273cc7cfbf8b9b9ea456e057cf4b6850b00b 100644 (file)
@@ -1335,10 +1335,7 @@ class MgrModule(ceph_module.BaseMgrModule, MgrModuleLoggingMixin):
             self.create_mgr_pool()
         uri = f"file:///{self.MGR_POOL_NAME}:{self.module_name}/main.db?vfs=ceph"
         self.log.debug(f"using uri {uri}")
-        try:
-            db = sqlite3.connect(uri, check_same_thread=False, uri=True, autocommit=False)  # type: ignore[call-arg]
-        except TypeError:
-            db = sqlite3.connect(uri, check_same_thread=False, uri=True, isolation_level=None)
+        db = sqlite3.connect(uri, check_same_thread=False, uri=True, isolation_level=None)  # type: ignore[call-arg]
         # if libcephsqlite reconnects, update the addrv for blocklist
         with db:
             cur = db.execute('SELECT json_extract(ceph_status(), "$.addr");')