Skip to content

Commit df49652

Browse files
committed
pybind/mgr/mgr_module: turn off all automatic transactions
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 <[email protected]>
1 parent 8f415be commit df49652

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/pybind/mgr/mgr_module.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,10 +1335,7 @@ def open_db(self) -> Optional[sqlite3.Connection]:
13351335
self.create_mgr_pool()
13361336
uri = f"file:///{self.MGR_POOL_NAME}:{self.module_name}/main.db?vfs=ceph"
13371337
self.log.debug(f"using uri {uri}")
1338-
try:
1339-
db = sqlite3.connect(uri, check_same_thread=False, uri=True, autocommit=False) # type: ignore[call-arg]
1340-
except TypeError:
1341-
db = sqlite3.connect(uri, check_same_thread=False, uri=True, isolation_level=None)
1338+
db = sqlite3.connect(uri, check_same_thread=False, uri=True, isolation_level=None) # type: ignore[call-arg]
13421339
# if libcephsqlite reconnects, update the addrv for blocklist
13431340
with db:
13441341
cur = db.execute('SELECT json_extract(ceph_status(), "$.addr");')

0 commit comments

Comments
 (0)