summaryrefslogtreecommitdiffstats
path: root/src/os
diff options
context:
space:
mode:
authorAdam Kupczyk <akupczyk@ibm.com>2024-07-25 09:48:14 +0200
committerAdam Kupczyk <akupczyk@ibm.com>2024-08-07 12:55:46 +0200
commit7de8a6c42b932f41f96c186edf6ae7a51458e4d5 (patch)
tree9f6456f419ab6a640f26c3631616b831a809db1c /src/os
parentos/bluestore: Add compression fallback (diff)
downloadceph-7de8a6c42b932f41f96c186edf6ae7a51458e4d5.tar.xz
ceph-7de8a6c42b932f41f96c186edf6ae7a51458e4d5.zip
os/bluestore: Add conf.bluestore_write_v2_random
Added conf.bluestore_write_v2_random. This is useful only for testing. If set, it overrides value of bluestore_write_v2 with a random true/false selection. It is useful for v1 / v2 compatibility testing. Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
Diffstat (limited to 'src/os')
-rw-r--r--src/os/bluestore/BlueStore.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc
index 299cd90d000..d35a59a4639 100644
--- a/src/os/bluestore/BlueStore.cc
+++ b/src/os/bluestore/BlueStore.cc
@@ -9149,7 +9149,12 @@ int BlueStore::_mount()
return r;
}
}
- use_write_v2 = cct->_conf.get_val<bool>("bluestore_write_v2");
+ use_write_v2 = cct->_conf.get_val<bool>("bluestore_write_v2");
+ if (cct->_conf.get_val<bool>("bluestore_write_v2_random")) {
+ srand(time(NULL));
+ use_write_v2 = rand() % 2;
+ cct->_conf.set_val("bluestore_write_v2", std::to_string(use_write_v2));
+ }
_kv_only = false;
if (cct->_conf->bluestore_fsck_on_mount) {
int rc = fsck(cct->_conf->bluestore_fsck_on_mount_deep);