]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/smb: use the sqlite mirroring store by default
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 6 Jul 2024 17:37:31 +0000 (13:37 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Sat, 6 Jul 2024 18:53:06 +0000 (14:53 -0400)
We added the sqlite db for performance reasons and now have enhanced it
with the mirroring store for a consistent policy of only storing
possibly sensitive information in the mon config key store, like cephadm
does for certs and stuff. Enable the sqlite mirroring store by default.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/pybind/mgr/smb/module.py

index 69b890a6af31e3036d89a06627757ef6cc647f29..8044678ca41c89591408a9bf4b9176480418f32c 100644 (file)
@@ -84,14 +84,20 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
         # Store conf is meant for devs, maybe testers to experiment with
         # certain backend options at run time. This is not meant to be
         # a formal or friendly interface.
+        name = 'default'
+        opts = {}
         if store_conf:
             parts = [v.strip() for v in store_conf.split(';')]
             assert parts
             name = parts[0]
             opts = dict(p.split('=', 1) for p in parts[1:])
-        else:
-            name = 'db'
-            opts = {}
+        if name == 'default':
+            log.info('Using default backend: sqlite3 with mirroring')
+            mc_store = mon_store.ModuleConfigStore(self)
+            db_store = sqlite_store.mgr_sqlite3_db_with_mirroring(
+                self, mc_store, opts
+            )
+            return db_store
         if name == 'mon':
             log.info('Using specified backend: module config internal store')
             return mon_store.ModuleConfigStore(self)