]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Implement review feedback and remove unused variables from ceph_test_rados_io_sequence
authorAdam Lyon-Jones <adamlyon@uk.ibm.com>
Tue, 9 Sep 2025 08:26:10 +0000 (09:26 +0100)
committerAdam Lyon-Jones <adamlyon@uk.ibm.com>
Fri, 12 Sep 2025 08:27:12 +0000 (09:27 +0100)
Signed-off-by: Adam Lyon-Jones <adamlyon@uk.ibm.com>
src/common/io_exerciser/Model.cc
src/common/io_exerciser/RadosIo.cc
src/common/io_exerciser/RadosIo.h
src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc

index 536c406539ab1d4df68d21bd3f398efec932f210..8c791bbc0eb3e82ecc008b6da77c74bb67c2768b 100644 (file)
@@ -21,11 +21,11 @@ void Model::set_secondary_oid(const std::string& new_oid) {
 
 void Model::swap_primary_secondary_oid() {
     std::string old_primary;
-    old_primary = Model::get_primary_oid();
-    Model::set_primary_oid(Model::get_secondary_oid());
-    Model::set_secondary_oid(old_primary);
+    old_primary = get_primary_oid();
+    set_primary_oid(Model::get_secondary_oid());
+    set_secondary_oid(old_primary);
 }
 
 const uint64_t Model::get_block_size() const { return block_size; }
 
-int Model::get_num_io() const { return num_io; }
\ No newline at end of file
+int Model::get_num_io() const { return num_io; }
index 90fc8c217c9e1e4f964bb9262619e5e35263595a..3985665a05530c6e1ef140e1a567b12a1cf8bc39 100644 (file)
@@ -44,7 +44,6 @@ int send_mon_command(S& s, librados::Rados& rados, const char* name,
 
 RadosIo::RadosIo(librados::Rados& rados, boost::asio::io_context& asio,
                  const std::string& pool, const std::string& primary_oid, const std::string& secondary_oid,
-                 const std::optional<std::vector<int>>& cached_shard_order,
                  uint64_t block_size, int seed, int threads, ceph::mutex& lock,
                  ceph::condition_variable& cond, bool is_replicated_pool,
                  bool ec_optimizations)
@@ -55,7 +54,6 @@ RadosIo::RadosIo(librados::Rados& rados, boost::asio::io_context& asio,
       db(data_generation::DataGenerator::create_generator(
           data_generation::GenerationType::HeaderedSeededRandom, *om)),
       pool(pool),
-      cached_shard_order(cached_shard_order),
       threads(threads),
       lock(lock),
       cond(cond),
index d1464f3545cf5efd8d45bb9a8a0a55a2fa3f1eb8..593f5e8e604eb9bf576d5be00300c3e222a40cb2 100644 (file)
@@ -32,7 +32,6 @@ class RadosIo : public Model {
   std::unique_ptr<ceph::io_exerciser::data_generation::DataGenerator> db;
   std::unique_ptr<ceph::consistency::ConsistencyChecker> cc;
   std::string pool;
-  std::optional<std::vector<int>> cached_shard_order;
   int threads;
   ceph::mutex& lock;
   ceph::condition_variable& cond;
@@ -46,7 +45,6 @@ class RadosIo : public Model {
  public:
   RadosIo(librados::Rados& rados, boost::asio::io_context& asio,
           const std::string& pool, const std::string& primary_oid, const std::string& secondary_oid,
-          const std::optional<std::vector<int>>& cached_shard_order,
           uint64_t block_size, int seed, int threads, ceph::mutex& lock,
           ceph::condition_variable& cond, bool is_replicated_pool,
           bool ec_optimizations);
index 42348343893419bcef28db41ad47acac33fba716..e6de83372ad817814f7bc31788cec932be51745c 100644 (file)
@@ -1047,38 +1047,11 @@ ceph::io_sequence::tester::TestObject::TestObject(
     bufferlist inbl, outbl;
     auto formatter = std::make_unique<JSONFormatter>(false);
 
-    std::optional<std::vector<int>> cached_shard_order = std::nullopt;
-
-    if (!spo.get_allow_pool_autoscaling() && !spo.get_allow_pool_balancer() &&
-        !spo.get_allow_pool_deep_scrubbing() &&
-        !spo.get_allow_pool_scrubbing()) {
-      {
-        ceph::messaging::osd::OSDMapRequest osdMapRequest{pool, primary_oid, ""};
-        int rc = send_mon_command(osdMapRequest, rados, "OSDMapRequest", inbl,
-                                  &outbl, formatter.get());
-        ceph_assert(rc == 0);
-      }
-      {
-        ceph::messaging::osd::OSDMapRequest osdMapRequest{pool, secondary_oid, ""};
-        int rc = send_mon_command(osdMapRequest, rados, "OSDMapRequest", inbl,
-                                  &outbl, formatter.get());
-        ceph_assert(rc == 0);
-      }
-
-      JSONParser p;
-      bool success = p.parse(outbl.c_str(), outbl.length());
-      ceph_assert(success);
-
-      ceph::messaging::osd::OSDMapReply reply{};
-      reply.decode_json(&p);
-      cached_shard_order = reply.acting;
-    }
-
     exerciser_model = std::make_unique<ceph::io_exerciser::RadosIo>(
-        rados, asio, pool, primary_oid, secondary_cached_shard_order, sbs.select(), rng(),
+        rados, asio, pool, primary_oid, secondary_oid, sbs.select(), rng(),
         threads, lock, cond, spo.is_replicated_pool(),
         spo.get_allow_pool_ec_optimizations());
-    dout(0) << "= " << oid << " pool=" << pool << " threads=" << threads
+    dout(0) << "= " << primary_oid << " pool=" << pool << " threads=" << threads
             << " blocksize=" << exerciser_model->get_block_size() << " ="
             << dendl;
   }
@@ -1195,7 +1168,7 @@ ceph::io_sequence::tester::TestRunner::TestRunner(
   allow_pool_deep_scrubbing = vm.contains("allow_pool_deep_scrubbing");
   allow_pool_scrubbing = vm.contains("allow_pool_scrubbing");
 
-  if (testrecovery && (num_objects > 1)) {
+  if (testrecovery && (num_object_pairs > 1)) {
     throw std::invalid_argument("testrecovery option not allowed if parallel is"
                                 " specified, except when parallel=1 is used");
   }
@@ -1343,28 +1316,12 @@ bool ceph::io_sequence::tester::TestRunner::run_interactive_test() {
     bufferlist inbl, outbl;
     auto formatter = std::make_unique<JSONFormatter>(false);
 
-    {
-    ceph::messaging::osd::OSDMapRequest osd_map_request{pool, primary_object_name, ""};
-    int rc = send_mon_command(osd_map_request, rados, "OSDMapRequest", inbl,
-                              &outbl, formatter.get());
-    ceph_assert(rc == 0);
-    }
-    {
-      ceph::messaging::osd::OSDMapRequest osdMapRequest{pool, secondary_object_name, ""};
-      int rc = send_mon_command(osdMapRequest, rados, "OSDMapRequest", inbl,
-                                &outbl, formatter.get());
-      ceph_assert(rc == 0);
-    }
-
     JSONParser p;
     bool success = p.parse(outbl.c_str(), outbl.length());
     ceph_assert(success);
 
-    ceph::messaging::osd::OSDMapReply osd_map_reply{};
-    osd_map_reply.decode_json(&p);
-
     model = std::make_unique<ceph::io_exerciser::RadosIo>(
-        rados, asio, pool, primary_object_name, secondary_object_name, osd_map_reply.acting, sbs.select(), rng(),
+        rados, asio, pool, primary_object_name, secondary_object_name, sbs.select(), rng(),
         1,  // 1 thread
         lock, cond, spo.is_replicated_pool(),
         spo.get_allow_pool_ec_optimizations());