From: Patrick Donnelly Date: Tue, 11 Oct 2022 17:43:03 +0000 (-0400) Subject: pybind/mgr: use memory temp_store for sqlite3 db X-Git-Tag: v17.2.6~27^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F50286%2Fhead;p=ceph.git 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) --- 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)