Skip to content

Commit 8178667

Browse files
mgr/smb: use the sqlite mirroring store by default
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 <[email protected]>
1 parent b1cbf7c commit 8178667

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/pybind/mgr/smb/module.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,20 @@ def _backend_store(self, store_conf: str = '') -> ConfigStore:
8484
# Store conf is meant for devs, maybe testers to experiment with
8585
# certain backend options at run time. This is not meant to be
8686
# a formal or friendly interface.
87+
name = 'default'
88+
opts = {}
8789
if store_conf:
8890
parts = [v.strip() for v in store_conf.split(';')]
8991
assert parts
9092
name = parts[0]
9193
opts = dict(p.split('=', 1) for p in parts[1:])
92-
else:
93-
name = 'db'
94-
opts = {}
94+
if name == 'default':
95+
log.info('Using default backend: sqlite3 with mirroring')
96+
mc_store = mon_store.ModuleConfigStore(self)
97+
db_store = sqlite_store.mgr_sqlite3_db_with_mirroring(
98+
self, mc_store, opts
99+
)
100+
return db_store
95101
if name == 'mon':
96102
log.info('Using specified backend: module config internal store')
97103
return mon_store.ModuleConfigStore(self)

0 commit comments

Comments
 (0)