From b49753e374e0ba30e61eab0b7d88abb5104e5975 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 11 Oct 2022 13:43:03 -0400 Subject: [PATCH] pybind/mgr: use memory temp_store for sqlite3 db It appears some situations require sqlite3 to open a temporary database to execute the old database dump. Fixes: https://tracker.ceph.com/issues/57851 Signed-off-by: Patrick Donnelly (cherry picked from commit 8d853cc4990dc4dbccdc916115b0b30e0ac9dc19) --- src/pybind/mgr/mgr_module.py | 1 + src/pybind/mgr/snap_schedule/fs/schedule_client.py | 1 + 2 files changed, 2 insertions(+) diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index bd6872b688d7..338b03dfdd75 100644 --- a/src/pybind/mgr/mgr_module.py +++ b/src/pybind/mgr/mgr_module.py @@ -1197,6 +1197,7 @@ class MgrModule(ceph_module.BaseMgrModule, MgrModuleLoggingMixin): db.execute('PRAGMA JOURNAL_MODE = PERSIST') db.execute('PRAGMA PAGE_SIZE = 65536') db.execute('PRAGMA CACHE_SIZE = 64') + db.execute('PRAGMA TEMP_STORE = memory') db.row_factory = sqlite3.Row self.load_schema(db) diff --git a/src/pybind/mgr/snap_schedule/fs/schedule_client.py b/src/pybind/mgr/snap_schedule/fs/schedule_client.py index 486582074767..1fc3217ec7d2 100644 --- a/src/pybind/mgr/snap_schedule/fs/schedule_client.py +++ b/src/pybind/mgr/snap_schedule/fs/schedule_client.py @@ -193,6 +193,7 @@ class SnapSchedClient(CephfsClient): db.execute('PRAGMA JOURNAL_MODE = PERSIST') db.execute('PRAGMA PAGE_SIZE = 65536') db.execute('PRAGMA CACHE_SIZE = 256') + db.execute('PRAGMA TEMP_STORE = memory') db.row_factory = sqlite3.Row # check for legacy dump store pool_param = cast(Union[int, str], poolid) -- 2.47.3