summaryrefslogtreecommitdiffstats
path: root/src/test/crimson/test_config.cc
diff options
context:
space:
mode:
authorKefu Chai <kchai@redhat.com>2018-07-27 14:30:13 +0200
committerKefu Chai <kchai@redhat.com>2018-07-28 17:13:41 +0200
commit74fd334a6ebe023c1c4b6d80d298857e2d4fe7bf (patch)
tree380615cd447dd9f5e74a2fcc9b38ae33d4b82d99 /src/test/crimson/test_config.cc
parentcrimson/common: throw if fails to change config (diff)
downloadceph-74fd334a6ebe023c1c4b6d80d298857e2d4fe7bf.tar.xz
ceph-74fd334a6ebe023c1c4b6d80d298857e2d4fe7bf.zip
crimson/common: write configs synchronously on shard.0
to avoid potential racings on the same shard. before this change, we apply the change in async. after this change, all changes happens on the owner shard (i.e. shard.0), and the changes are applied synchronously. Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to '')
-rw-r--r--src/test/crimson/test_config.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/test/crimson/test_config.cc b/src/test/crimson/test_config.cc
index eaf9261c30a..5d0c104b8fc 100644
--- a/src/test/crimson/test_config.cc
+++ b/src/test/crimson/test_config.cc
@@ -11,17 +11,15 @@ static seastar::future<> test_config()
return ceph::common::sharded_conf().start().then([] {
return ceph::common::sharded_conf().invoke_on(0, &Config::start);
}).then([] {
- return ceph::common::sharded_conf().invoke_on_all([](auto& config) {
+ return ceph::common::sharded_conf().invoke_on_all([](Config& config) {
return config.set_val("osd_tracing", "true");
});
}).then([] {
- return ceph::common::local_conf().get_val<bool>("osd_tracing");
- }).then([](bool osd_tracing) {
- if (osd_tracing) {
- return seastar::make_ready_future<>();
- } else {
- throw std::runtime_error("run osd_tracing");
- }
+ return ceph::common::sharded_conf().invoke_on_all([](Config& config) {
+ if (!config.get_val<bool>("osd_tracing")) {
+ throw std::runtime_error("run osd_tracing");
+ }
+ });
}).then([] {
return ceph::common::sharded_conf().stop();
});