From fd184893ac073cdbb8873a37e7a2cd302df9ced2 Mon Sep 17 00:00:00 2001 From: Jon Bailey Date: Thu, 30 Jan 2025 16:57:03 +0000 Subject: [PATCH] test/osd: Code formatting changes for plugin support in ceph_test_rados_io_support Modified variables used in ceph_test_rados_io_sequence to use snake_case instead of camelCase to be consistent with prior work. Signed-off-by: Jon Bailey --- src/common/io_exerciser/EcIoSequence.cc | 106 ++++++++-------- src/common/io_exerciser/EcIoSequence.h | 16 +-- .../ceph_test_rados_io_sequence.cc | 120 +++++++++--------- .../ceph_test_rados_io_sequence.h | 56 ++++---- 4 files changed, 149 insertions(+), 149 deletions(-) diff --git a/src/common/io_exerciser/EcIoSequence.cc b/src/common/io_exerciser/EcIoSequence.cc index c28008b5f05e3..4b879fc7d5b3c 100644 --- a/src/common/io_exerciser/EcIoSequence.cc +++ b/src/common/io_exerciser/EcIoSequence.cc @@ -14,7 +14,7 @@ bool EcIoSequence::is_supported(Sequence sequence) const { return true; } std::unique_ptr EcIoSequence::generate_sequence( Sequence sequence, std::pair obj_size_range, std::optional> km, - std::optional> mappingLayers, + std::optional> mappinglayers, int seed) { switch (sequence) { case Sequence::SEQUENCE_SEQ0: @@ -45,9 +45,9 @@ std::unique_ptr EcIoSequence::generate_sequence( [[fallthrough]]; case Sequence::SEQUENCE_SEQ14: return std::make_unique(obj_size_range, seed, - sequence, km, mappingLayers); + sequence, km, mappinglayers); case Sequence::SEQUENCE_SEQ10: - return std::make_unique(obj_size_range, seed, km, mappingLayers); + return std::make_unique(obj_size_range, seed, km, mappinglayers); default: ceph_abort_msg("Unrecognised sequence"); } @@ -62,19 +62,19 @@ EcIoSequence::EcIoSequence(std::pair obj_size_range, int seed) void EcIoSequence::select_random_data_shard_to_inject_read_error( std::optional> km, std::optional> - mappingLayers) { + mappinglayers) { if (km) { shard_to_inject = rng(km->first - 1); } - if (mappingLayers) { - int count = std::ranges::count(mappingLayers->first, 'D'); - int dataShardPosition = rng(count - 1); + if (mappinglayers) { + int count = std::ranges::count(mappinglayers->first, 'D'); + int data_shard_position = rng(count - 1); shard_to_inject = 0; - for (int i = 0; i < dataShardPosition; i++) { + for (int i = 0; i < data_shard_position; i++) { shard_to_inject = - std::distance(std::find(mappingLayers->first.begin(), - mappingLayers->first.end(), *shard_to_inject), - mappingLayers->first.begin()); + std::distance(std::find(mappinglayers->first.begin(), + mappinglayers->first.end(), *shard_to_inject), + mappinglayers->first.begin()); ceph_assert(*shard_to_inject != std::string::npos); } } @@ -84,23 +84,23 @@ void EcIoSequence::select_random_data_shard_to_inject_read_error( void EcIoSequence::select_random_data_shard_to_inject_write_error( std::optional> km, std::optional> - mappingLayers) { + mappinglayers) { // Write errors do not support injecting to the primary OSD if (km) { shard_to_inject = rng(1, km->first - 1); } - if (mappingLayers) { - int count = std::ranges::count(mappingLayers->first, 'D'); - if (mappingLayers->first[0] == 'D') { + if (mappinglayers) { + int count = std::ranges::count(mappinglayers->first, 'D'); + if (mappinglayers->first[0] == 'D') { count--; } - int dataShardPosition = rng(1, count - 1); + int data_shard_position = rng(1, count - 1); shard_to_inject = 0; - for (int i = 1; i < dataShardPosition; i++) { + for (int i = 1; i < data_shard_position; i++) { shard_to_inject = - std::distance(std::find(mappingLayers->first.begin(), - mappingLayers->first.end(), *shard_to_inject), - mappingLayers->first.begin()); + std::distance(std::find(mappinglayers->first.begin(), + mappinglayers->first.end(), *shard_to_inject), + mappinglayers->first.begin()); ceph_assert(*shard_to_inject != std::string::npos); } } @@ -110,19 +110,19 @@ void EcIoSequence::select_random_data_shard_to_inject_write_error( void EcIoSequence::select_random_shard_to_inject_read_error( std::optional> km, std::optional> - mappingLayers) { + mappinglayers) { if (km) { shard_to_inject = rng(km->first + km->second - 1); } - if (mappingLayers) { - int count = std::ranges::count(mappingLayers->first, 'D'); - int dataShardPosition = rng(count - 1); + if (mappinglayers) { + int count = std::ranges::count(mappinglayers->first, 'D'); + int data_shard_position = rng(count - 1); shard_to_inject = 0; - for (int i = 0; i < dataShardPosition; i++) { + for (int i = 0; i < data_shard_position; i++) { shard_to_inject = - std::distance(std::find(mappingLayers->first.begin(), - mappingLayers->first.end(), *shard_to_inject), - mappingLayers->first.begin()); + std::distance(std::find(mappinglayers->first.begin(), + mappinglayers->first.end(), *shard_to_inject), + mappinglayers->first.begin()); ceph_assert(*shard_to_inject != std::string::npos); } } @@ -132,23 +132,23 @@ void EcIoSequence::select_random_shard_to_inject_read_error( void EcIoSequence::select_random_shard_to_inject_write_error( std::optional> km, std::optional> - mappingLayers) { + mappinglayers) { // Write errors do not support injecting to the primary OSD if (km) { shard_to_inject = rng(1, km->first + km->second - 1); } - if (mappingLayers) { - int count = std::ranges::count(mappingLayers->first, 'D'); - if (mappingLayers->first[0] == 'D') { + if (mappinglayers) { + int count = std::ranges::count(mappinglayers->first, 'D'); + if (mappinglayers->first[0] == 'D') { count--; } - int dataShardPosition = rng(count - 1); + int data_shard_position = rng(count - 1); shard_to_inject = 0; - for (int i = 0; i < dataShardPosition; i++) { + for (int i = 0; i < data_shard_position; i++) { shard_to_inject = - std::distance(std::find(mappingLayers->first.begin(), - mappingLayers->first.end(), *shard_to_inject), - mappingLayers->first.begin()); + std::distance(std::find(mappinglayers->first.begin(), + mappinglayers->first.end(), *shard_to_inject), + mappinglayers->first.begin()); ceph_assert(*shard_to_inject != std::string::npos); } } @@ -172,10 +172,10 @@ ceph::io_exerciser::ReadInjectSequence::ReadInjectSequence( int seed, Sequence s, std::optional> km, - std::optional> mappingLayers) + std::optional> mappinglayers) : EcIoSequence(obj_size_range, seed) { child_sequence = IoSequence::generate_sequence(s, obj_size_range, seed); - select_random_data_shard_to_inject_read_error(km, mappingLayers); + select_random_data_shard_to_inject_read_error(km, mappinglayers); generate_random_read_inject_type(); } @@ -196,17 +196,17 @@ std::string ceph::io_exerciser::ReadInjectSequence::get_name() const { std::unique_ptr ReadInjectSequence::next() { step++; - if (nextOp) { - std::unique_ptr retOp = nullptr; - nextOp.swap(retOp); - return retOp; + if (next_op) { + std::unique_ptr ret_op = nullptr; + next_op.swap(ret_op); + return ret_op; } - std::unique_ptr childOp = child_sequence->next(); + std::unique_ptr child_op = child_sequence->next(); - switch (childOp->getOpType()) { + switch (child_op->getOpType()) { case OpType::Remove: - nextOp.swap(childOp); + next_op.swap(child_op); switch (inject_op_type) { ceph_assert(shard_to_inject.has_value()); case InjectOpType::ReadEIO: @@ -226,19 +226,19 @@ std::unique_ptr ReadInjectSequence::next() { case OpType::Create: switch (inject_op_type) { case InjectOpType::ReadEIO: - nextOp = InjectReadErrorOp::generate( + next_op = InjectReadErrorOp::generate( *shard_to_inject, 0, 0, std::numeric_limits::max()); break; case InjectOpType::ReadMissingShard: - nextOp = InjectReadErrorOp::generate( + next_op = InjectReadErrorOp::generate( *shard_to_inject, 1, 0, std::numeric_limits::max()); break; case InjectOpType::WriteFailAndRollback: - nextOp = InjectWriteErrorOp::generate( + next_op = InjectWriteErrorOp::generate( *shard_to_inject, 0, 0, std::numeric_limits::max()); break; case InjectOpType::WriteOSDAbort: - nextOp = InjectWriteErrorOp::generate( + next_op = InjectWriteErrorOp::generate( *shard_to_inject, 3, 0, std::numeric_limits::max()); break; case InjectOpType::None: @@ -252,7 +252,7 @@ std::unique_ptr ReadInjectSequence::next() { break; } - return childOp; + return child_op; } std::unique_ptr @@ -267,7 +267,7 @@ ceph::io_exerciser::ReadInjectSequence::_next() { ceph::io_exerciser::Seq10::Seq10( std::pair obj_size_range, int seed, std::optional> km, - std::optional> mappingLayers) + std::optional> mappinglayers) : EcIoSequence(obj_size_range, seed), offset(0), length(1), @@ -279,7 +279,7 @@ ceph::io_exerciser::Seq10::Seq10( test_all_sizes( false) // Only test obj_size(rand()) due to time constraints { - select_random_shard_to_inject_write_error(km, mappingLayers); + select_random_shard_to_inject_write_error(km, mappinglayers); // We will inject specifically as part of our sequence in this sequence setup_inject = false; if (!test_all_sizes) { diff --git a/src/common/io_exerciser/EcIoSequence.h b/src/common/io_exerciser/EcIoSequence.h index 33d46fbbe41ab..8082b2267a78e 100644 --- a/src/common/io_exerciser/EcIoSequence.h +++ b/src/common/io_exerciser/EcIoSequence.h @@ -11,7 +11,7 @@ class EcIoSequence : public IoSequence { Sequence s, std::pair obj_size_range, std::optional> km, std::optional> - mappingLayers, + mappinglayers, int seed); protected: @@ -27,19 +27,19 @@ class EcIoSequence : public IoSequence { void select_random_data_shard_to_inject_read_error( std::optional> km, std::optional> - mappingLayers); + mappinglayers); void select_random_data_shard_to_inject_write_error( std::optional> km, std::optional> - mappingLayers); + mappinglayers); void select_random_shard_to_inject_read_error( std::optional> km, std::optional> - mappingLayers); + mappinglayers); void select_random_shard_to_inject_write_error( std::optional> km, std::optional> - mappingLayers); + mappinglayers); void generate_random_read_inject_type(); void generate_random_write_inject_type(); }; @@ -50,7 +50,7 @@ class ReadInjectSequence : public EcIoSequence { std::pair obj_size_range, int seed, Sequence s, std::optional> km, std::optional> - mappingLayers); + mappinglayers); Sequence get_id() const override; std::string get_name() const override; @@ -59,7 +59,7 @@ class ReadInjectSequence : public EcIoSequence { private: std::unique_ptr child_sequence; - std::unique_ptr nextOp; + std::unique_ptr next_op; }; class Seq10 : public EcIoSequence { @@ -67,7 +67,7 @@ class Seq10 : public EcIoSequence { Seq10(std::pair obj_size_range, int seed, std::optional> km, std::optional> - mappingLayers); + mappinglayers); Sequence get_id() const override; std::string get_name() const override; diff --git a/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc b/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc index d645edbd0f134..2d6806fbed8a5 100644 --- a/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc +++ b/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc @@ -89,14 +89,14 @@ void validate(boost::any& v, const std::vector& values, po::validators::check_first_occurrence(v); const std::string& s = po::validators::get_single_string(values); - const std::string_view* pluginIt = - std::find(ceph::io_sequence::tester::pluginChoices.begin(), - ceph::io_sequence::tester::pluginChoices.end(), s); - if (ceph::io_sequence::tester::pluginChoices.end() == pluginIt) { + const std::string_view* plugin_iter = + std::find(ceph::io_sequence::tester::plugin_choices.begin(), + ceph::io_sequence::tester::plugin_choices.end(), s); + if (ceph::io_sequence::tester::plugin_choices.end() == plugin_iter) { throw po::validation_error(po::validation_error::invalid_option_value); } - v = boost::any(*pluginIt); + v = boost::any(*plugin_iter); } constexpr std::string_view usage[] = { @@ -590,38 +590,38 @@ ceph::io_sequence::tester::SelectErasureProfile::select() { shec::SelectErasureC ssc{rng, vm, profile.plugin, profile.km, first_use}; profile.c = ssc.select(); } else if (profile.plugin == "lrc") { - std::pair mappingAndLayers = sml.select(); - profile.mapping = mappingAndLayers.first; - profile.layers = mappingAndLayers.second; + std::pair mappinglayers = sml.select(); + profile.mapping = mappinglayers.first; + profile.layers = mappinglayers.second; } - ErasureCodeProfile erasureCodeProfile; - erasureCodeProfile["plugin"] = std::string(profile.plugin); + ErasureCodeProfile erasure_code_profile; + erasure_code_profile["plugin"] = std::string(profile.plugin); if (profile.km) { - erasureCodeProfile["k"] = std::to_string(profile.km->first); - erasureCodeProfile["m"] = std::to_string(profile.km->second); + erasure_code_profile["k"] = std::to_string(profile.km->first); + erasure_code_profile["m"] = std::to_string(profile.km->second); } if (profile.technique) { - erasureCodeProfile["technique"] = *profile.technique; + erasure_code_profile["technique"] = *profile.technique; } if (profile.packet_size) { - erasureCodeProfile["packetsize"] = std::to_string(*profile.packet_size); + erasure_code_profile["packetsize"] = std::to_string(*profile.packet_size); } if (profile.c) { - erasureCodeProfile["c"] = std::to_string(*profile.c); + erasure_code_profile["c"] = std::to_string(*profile.c); } if (profile.w) { - erasureCodeProfile["packetsize"] = std::to_string(*profile.w); + erasure_code_profile["packetsize"] = std::to_string(*profile.w); } if (profile.jerasure_per_chunk_alignment) { - erasureCodeProfile["jerasure_per_chunk_alignment"] = + erasure_code_profile["jerasure_per_chunk_alignment"] = std::to_string(*profile.jerasure_per_chunk_alignment); } if (profile.mapping) { - erasureCodeProfile["mapping"] = *profile.mapping; + erasure_code_profile["mapping"] = *profile.mapping; } if (profile.layers) { - erasureCodeProfile["layers"] = *profile.layers; + erasure_code_profile["layers"] = *profile.layers; } ErasureCodePluginRegistry& instance = ErasureCodePluginRegistry::instance(); @@ -629,7 +629,7 @@ ceph::io_sequence::tester::SelectErasureProfile::select() { std::stringstream ss; instance.factory(std::string(profile.plugin), cct->_conf.get_val("erasure_code_dir"), - erasureCodeProfile, &ec_impl, &ss); + erasure_code_profile, &ec_impl, &ss); ceph_assert(ec_impl); SelectErasureChunkSize scs{rng, vm, ec_impl, first_use}; @@ -704,10 +704,10 @@ void ceph::io_sequence::tester::SelectErasureProfile::create( bool force = profile.chunk_size.has_value() && (*(profile.chunk_size) % 4096 != 0); - ceph::messaging::osd::OSDECProfileSetRequest ecProfileSetRequest{ + ceph::messaging::osd::OSDECProfileSetRequest ec_profile_set_request{ profile.name, profile_values, force}; int rc = - send_mon_command(ecProfileSetRequest, rados, "OSDECProfileSetRequest", + send_mon_command(ec_profile_set_request, rados, "OSDECProfileSetRequest", inbl, &outbl, formatter.get()); ceph_assert(rc == 0); } @@ -719,9 +719,9 @@ ceph::io_sequence::tester::SelectErasureProfile::selectExistingProfile( bufferlist inbl, outbl; auto formatter = std::make_shared(false); - ceph::messaging::osd::OSDECProfileGetRequest osdECProfileGetRequest{ + ceph::messaging::osd::OSDECProfileGetRequest ec_profile_get_request{ profile_name}; - rc = send_mon_command(osdECProfileGetRequest, rados, "OSDECProfileGetRequest", + rc = send_mon_command(ec_profile_get_request, rados, "OSDECProfileGetRequest", inbl, &outbl, formatter.get()); ceph_assert(rc == 0); @@ -802,10 +802,10 @@ const std::string ceph::io_sequence::tester::SelectErasurePool::select() { bool success = p.parse(outbl.c_str(), outbl.length()); ceph_assert(success); - ceph::messaging::osd::OSDPoolGetReply osdPoolGetReply; - osdPoolGetReply.decode_json(&p); + ceph::messaging::osd::OSDPoolGetReply pool_get_reply; + pool_get_reply.decode_json(&p); - profile = sep.selectExistingProfile(osdPoolGetReply.erasure_code_profile); + profile = sep.selectExistingProfile(pool_get_reply.erasure_code_profile); } else { created_pool_name = create(); } @@ -829,9 +829,9 @@ std::string ceph::io_sequence::tester::SelectErasurePool::create() { profile = sep.select(); pool_name = fmt::format("testpool-pr{}", profile->name); - ceph::messaging::osd::OSDECPoolCreateRequest poolCreateRequest{ + ceph::messaging::osd::OSDECPoolCreateRequest pool_create_request{ pool_name, "erasure", 8, 8, profile->name}; - rc = send_mon_command(poolCreateRequest, rados, "OSDECPoolCreateRequest", + rc = send_mon_command(pool_create_request, rados, "OSDECPoolCreateRequest", inbl, &outbl, formatter.get()); ceph_assert(rc == 0); @@ -849,21 +849,21 @@ void ceph::io_sequence::tester::SelectErasurePool::configureServices( auto formatter = std::make_shared(false); if (!allow_pool_autoscaling) { - ceph::messaging::osd::OSDSetRequest setNoAutoscaleRequest{"noautoscale", + ceph::messaging::osd::OSDSetRequest no_autoscale_request{"noautoscale", std::nullopt}; - rc = send_mon_command(setNoAutoscaleRequest, rados, "OSDSetRequest", inbl, + rc = send_mon_command(no_autoscale_request, rados, "OSDSetRequest", inbl, &outbl, formatter.get()); ceph_assert(rc == 0); } if (!allow_pool_balancer) { - ceph::messaging::balancer::BalancerOffRequest balancerOffRequest; - rc = send_mon_command(balancerOffRequest, rados, "BalancerOffRequest", inbl, + ceph::messaging::balancer::BalancerOffRequest balancer_off_request; + rc = send_mon_command(balancer_off_request, rados, "BalancerOffRequest", inbl, &outbl, formatter.get()); ceph_assert(rc == 0); - ceph::messaging::balancer::BalancerStatusRequest balancerStatusRequest; - rc = send_mon_command(balancerStatusRequest, rados, "BalancerStatusRequest", + ceph::messaging::balancer::BalancerStatusRequest balancer_status_request; + rc = send_mon_command(balancer_status_request, rados, "BalancerStatusRequest", inbl, &outbl, formatter.get()); ceph_assert(rc == 0); @@ -871,37 +871,37 @@ void ceph::io_sequence::tester::SelectErasurePool::configureServices( bool success = p.parse(outbl.c_str(), outbl.length()); ceph_assert(success); - ceph::messaging::balancer::BalancerStatusReply reply; - reply.decode_json(&p); - ceph_assert(!reply.active); + ceph::messaging::balancer::BalancerStatusReply balancer_status_reply; + balancer_status_reply.decode_json(&p); + ceph_assert(!balancer_status_reply.active); } - if (allow_pool_deep_scrubbing) { - ceph::messaging::osd::OSDSetRequest setNoDeepScrubRequest{"nodeep-scrub", + if (!allow_pool_deep_scrubbing) { + ceph::messaging::osd::OSDSetRequest no_deep_scrub_request{"nodeep-scrub", std::nullopt}; - rc = send_mon_command(setNoDeepScrubRequest, rados, "setNoDeepScrubRequest", + rc = send_mon_command(no_deep_scrub_request, rados, "setNoDeepScrubRequest", inbl, &outbl, formatter.get()); ceph_assert(rc == 0); } - if (allow_pool_scrubbing) { - ceph::messaging::osd::OSDSetRequest setNoScrubRequest{"noscrub", + if (!allow_pool_scrubbing) { + ceph::messaging::osd::OSDSetRequest no_scrub_request{"noscrub", std::nullopt}; - rc = send_mon_command(setNoScrubRequest, rados, "OSDSetRequest", inbl, + rc = send_mon_command(no_scrub_request, rados, "OSDSetRequest", inbl, &outbl, formatter.get()); ceph_assert(rc == 0); } if (test_recovery) { - ceph::messaging::config::ConfigSetRequest configSetBluestoreDebugRequest{ + ceph::messaging::config::ConfigSetRequest bluestore_debug_request{ "global", "bluestore_debug_inject_read_err", "true", std::nullopt}; - rc = send_mon_command(configSetBluestoreDebugRequest, rados, + rc = send_mon_command(bluestore_debug_request, rados, "ConfigSetRequest", inbl, &outbl, formatter.get()); ceph_assert(rc == 0); - ceph::messaging::config::ConfigSetRequest configSetMaxMarkdownRequest{ + ceph::messaging::config::ConfigSetRequest max_markdown_request{ "global", "osd_max_markdown_count", "99999999", std::nullopt}; - rc = send_mon_command(configSetMaxMarkdownRequest, rados, + rc = send_mon_command(max_markdown_request, rados, "ConfigSetRequest", inbl, &outbl, formatter.get()); ceph_assert(rc == 0); } @@ -922,9 +922,9 @@ ceph::io_sequence::tester::TestObject::TestObject( const std::string pool = spo.select(); if (!dryrun) { ceph_assert(spo.getProfile()); - poolKM = spo.getProfile()->km; + pool_km = spo.getProfile()->km; if (spo.getProfile()->mapping && spo.getProfile()->layers) { - poolMappingLayers = {*spo.getProfile()->mapping, + pool_mappinglayers = {*spo.getProfile()->mapping, *spo.getProfile()->layers}; } } @@ -966,7 +966,7 @@ ceph::io_sequence::tester::TestObject::TestObject( if (testrecovery) { seq = ceph::io_exerciser::EcIoSequence::generate_sequence( - curseq, obj_size_range, poolKM, poolMappingLayers, + curseq, obj_size_range, pool_km, pool_mappinglayers, seqseed.value_or(rng())); } else { seq = ceph::io_exerciser::IoSequence::generate_sequence( @@ -1005,7 +1005,7 @@ bool ceph::io_sequence::tester::TestObject::next() { } else { if (testrecovery) { seq = ceph::io_exerciser::EcIoSequence::generate_sequence( - curseq, obj_size_range, poolKM, poolMappingLayers, + curseq, obj_size_range, pool_km, pool_mappinglayers, seqseed.value_or(rng())); } else { seq = ceph::io_exerciser::IoSequence::generate_sequence( @@ -1103,15 +1103,15 @@ void ceph::io_sequence::tester::TestRunner::list_sequence(bool testrecovery) { std::optional profile = spo.getProfile(); std::optional> km; - std::optional> mappingLayers; + std::optional> mappinglayers; if (profile) { km = profile->km; if (profile->mapping && profile->layers) { - mappingLayers = {*spo.getProfile()->mapping, *spo.getProfile()->layers}; + mappinglayers = {*spo.getProfile()->mapping, *spo.getProfile()->layers}; } } seq = ceph::io_exerciser::EcIoSequence::generate_sequence( - s, obj_size_range, km, mappingLayers, seqseed.value_or(rng())); + s, obj_size_range, km, mappinglayers, seqseed.value_or(rng())); } else { seq = ceph::io_exerciser::IoSequence::generate_sequence( s, obj_size_range, seqseed.value_or(rng())); @@ -1207,8 +1207,8 @@ bool ceph::io_sequence::tester::TestRunner::run_interactive_test() { bufferlist inbl, outbl; auto formatter = std::make_unique(false); - ceph::messaging::osd::OSDMapRequest osdMapRequest{pool, object_name, ""}; - int rc = send_mon_command(osdMapRequest, rados, "OSDMapRequest", inbl, + ceph::messaging::osd::OSDMapRequest osd_map_request{pool, object_name, ""}; + int rc = send_mon_command(osd_map_request, rados, "OSDMapRequest", inbl, &outbl, formatter.get()); ceph_assert(rc == 0); @@ -1216,11 +1216,11 @@ bool ceph::io_sequence::tester::TestRunner::run_interactive_test() { bool success = p.parse(outbl.c_str(), outbl.length()); ceph_assert(success); - ceph::messaging::osd::OSDMapReply reply{}; - reply.decode_json(&p); + ceph::messaging::osd::OSDMapReply osd_map_reply{}; + osd_map_reply.decode_json(&p); model = std::make_unique( - rados, asio, pool, object_name, reply.acting, sbs.select(), rng(), + rados, asio, pool, object_name, osd_map_reply.acting, sbs.select(), rng(), 1, // 1 thread lock, cond); } diff --git a/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.h b/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.h index 986b823104e49..dabe8faf748bb 100644 --- a/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.h +++ b/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.h @@ -84,9 +84,9 @@ class ErasureCodePlugin; namespace io_sequence { namespace tester { // Choices for min and max object size -inline static constexpr size_t objectSizeSize = 10; -inline static constexpr std::array, objectSizeSize> - objectSizeChoices = {{{1, 32}, // Default - best for boundary checking +inline static constexpr size_t object_size_array_size = 10; +inline static constexpr std::array, object_size_array_size> + object_size_choices = {{{1, 32}, // Default - best for boundary checking {12, 14}, {28, 30}, {36, 38}, @@ -99,30 +99,30 @@ inline static constexpr std::array, objectSizeSize> using SelectObjectSize = ProgramOptionSelector, - io_sequence::tester ::objectSizeSize, - io_sequence::tester ::objectSizeChoices>; + io_sequence::tester::object_size_array_size, + io_sequence::tester::object_size_choices>; // Choices for block size -inline static constexpr int blockSizeSize = 5; -inline static constexpr std::array blockSizeChoices = { +inline static constexpr int block_size_array_size = 5; +inline static constexpr std::array block_size_choices = { {2048, // Default - test boundaries for EC 4K chunk size 512, 3767, 4096, 32768}}; using SelectBlockSize = ProgramOptionSelector; + io_sequence::tester::block_size_array_size, + io_sequence::tester::block_size_choices>; // Choices for number of threads -inline static constexpr int threadArraySize = 4; -inline static constexpr std::array threadCountChoices = { +inline static constexpr int thread_array_size = 4; +inline static constexpr std::array thread_count_choices = { {1, // Default 2, 4, 8}}; using SelectNumThreads = ProgramOptionSelector; + io_sequence::tester::thread_array_size, + io_sequence::tester::thread_count_choices>; class SelectSeqRange : public ProgramOptionReader - pluginChoices = {{"jerasure", "isa", "clay", "shec", "lrc"}}; +inline static constexpr int plugin_array_size = 5; +inline static constexpr std::array + plugin_choices = {{"jerasure", "isa", "clay", "shec", "lrc"}}; using SelectErasurePlugin = ProgramOptionSelector; + io_sequence::tester::plugin_array_size, + io_sequence::tester::plugin_choices>; class SelectErasureKM : public ProgramOptionGeneratedSelector> { @@ -226,9 +226,9 @@ class SelectErasurePacketSize namespace lrc { // Choices for lrc mappings and layers. The index selected for the mapping // matches what index will be chosen from the layers array. -inline static constexpr int mappingLayerListSizes = 15; +inline static constexpr int mapping_layer_array_sizes = 15; -inline static std::array mappingChoices = {{ +inline static std::array mapping_choices = {{ "_DD", "_DDD", "_DDDD", @@ -246,7 +246,7 @@ inline static std::array mappingChoices = {{ "_D_D_DDDD", }}; -inline static std::array layerChoices = {{ +inline static std::array layer_choices = {{ "[[\"cDD\",\"\"]]", "[[\"cDDD\",\"\"]]", "[[\"cDDDD\",\"\"]]", @@ -266,13 +266,13 @@ inline static std::array layerChoices = {{ using SelectMapping = ProgramOptionSelector; + io_sequence::tester::lrc::mapping_layer_array_sizes, + io_sequence::tester::lrc::mapping_choices>; using SelectLayers = ProgramOptionSelector; + io_sequence::tester::lrc::mapping_layer_array_sizes, + io_sequence::tester::lrc::layer_choices>; class SelectMappingAndLayers { public: @@ -358,7 +358,7 @@ class SelectErasureProfile : public ProgramOptionReader { SelectErasurePlugin spl; lrc::SelectMappingAndLayers sml; - std::unique_ptr erasureCode; + std::unique_ptr erasure_code; }; class SelectErasurePool : public ProgramOptionReader { @@ -442,9 +442,9 @@ class TestObject { ceph::util::random_number_generator& rng; bool verbose; std::optional seqseed; - std::optional> poolKM; + std::optional> pool_km; std::optional> - poolMappingLayers; + pool_mappinglayers; bool testrecovery; }; -- 2.39.5