]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #52032 from Matan-B/wip-matanb-crimson-no-ignore
authorMatan <mbreizma@redhat.com>
Sun, 2 Jul 2023 10:53:25 +0000 (13:53 +0300)
committerGitHub <noreply@github.com>
Sun, 2 Jul 2023 10:53:25 +0000 (13:53 +0300)
crimson/osd: don't ignore start_pg_operation returned future

Reviewed-by: Samuel Just <sjust@redhat.com>
1  2 
src/crimson/osd/osd.cc

index 44fe8fd6410e1105c230e23e42e60c6351517be8,8bc05deddccabf095888a126a08a80d2cd490507..342a8225dd9bc06c59ecfa7efbddd936b905f67b
@@@ -1142,22 -1013,20 +1142,22 @@@ seastar::future<> OSD::ShardDispatcher:
    });
  }
  
 -seastar::future<> OSD::handle_osd_op(crimson::net::ConnectionRef conn,
 -                                     Ref<MOSDOp> m)
 +seastar::future<> OSD::ShardDispatcher::handle_osd_op(
 +  crimson::net::ConnectionRef conn,
 +  Ref<MOSDOp> m)
  {
-   (void) pg_shard_manager.start_pg_operation<ClientRequest>(
+   return pg_shard_manager.start_pg_operation<ClientRequest>(
      get_shard_services(),
      conn,
-     std::move(m));
-   return seastar::now();
+     std::move(m)).second;
  }
  
 -seastar::future<> OSD::handle_pg_create(crimson::net::ConnectionRef conn,
 -                                      Ref<MOSDPGCreate2> m)
 +seastar::future<> OSD::ShardDispatcher::handle_pg_create(
 +  crimson::net::ConnectionRef conn,
 +  Ref<MOSDPGCreate2> m)
  {
-   for (auto& [pgid, when] : m->pgs) {
+   return seastar::do_for_each(m->pgs, [this, conn, m](auto& pg) {
+     auto& [pgid, when] = pg;
      const auto &[created, created_stamp] = when;
      auto q = m->pg_extra.find(pgid);
      ceph_assert(q != m->pg_extra.end());
          m->epoch,
          NullEvt(),
          true,
-         new PGCreateInfo(pgid, m->epoch, history, pi, true));
+         new PGCreateInfo(pgid, m->epoch, history, pi, true)).second;
      }
-   }
-   return seastar::now();
+   });
  }
  
 -seastar::future<> OSD::handle_update_log_missing(
 +seastar::future<> OSD::ShardDispatcher::handle_update_log_missing(
    crimson::net::ConnectionRef conn,
    Ref<MOSDPGUpdateLogMissing> m)
  {
    m->decode_payload();
-   (void) pg_shard_manager.start_pg_operation<LogMissingRequest>(
+   return pg_shard_manager.start_pg_operation<LogMissingRequest>(
      std::move(conn),
-     std::move(m));
-   return seastar::now();
+     std::move(m)).second;
  }
  
 -seastar::future<> OSD::handle_update_log_missing_reply(
 +seastar::future<> OSD::ShardDispatcher::handle_update_log_missing_reply(
    crimson::net::ConnectionRef conn,
    Ref<MOSDPGUpdateLogMissingReply> m)
  {
    m->decode_payload();
-   (void) pg_shard_manager.start_pg_operation<LogMissingRequestReply>(
+   return pg_shard_manager.start_pg_operation<LogMissingRequestReply>(
      std::move(conn),
-     std::move(m));
-   return seastar::now();
+     std::move(m)).second;
  }
  
 -seastar::future<> OSD::handle_rep_op(crimson::net::ConnectionRef conn,
 -                                   Ref<MOSDRepOp> m)
 +seastar::future<> OSD::ShardDispatcher::handle_rep_op(
 +  crimson::net::ConnectionRef conn,
 +  Ref<MOSDRepOp> m)
  {
    m->finish_decode();
-   std::ignore = pg_shard_manager.start_pg_operation<RepRequest>(
+   return pg_shard_manager.start_pg_operation<RepRequest>(
      std::move(conn),
-     std::move(m));
-   return seastar::now();
+     std::move(m)).second;
  }
  
 -seastar::future<> OSD::handle_rep_op_reply(crimson::net::ConnectionRef conn,
 -                                         Ref<MOSDRepOpReply> m)
 +seastar::future<> OSD::ShardDispatcher::handle_rep_op_reply(
 +  crimson::net::ConnectionRef conn,
 +  Ref<MOSDRepOpReply> m)
  {
    spg_t pgid = m->get_spg();
    return pg_shard_manager.with_pg(
@@@ -1272,13 -1133,11 +1269,12 @@@ seastar::future<> OSD::ShardDispatcher:
    return seastar::now();
  }
  
 -seastar::future<> OSD::handle_recovery_subreq(crimson::net::ConnectionRef conn,
 -                                 Ref<MOSDFastDispatchOp> m)
 +seastar::future<> OSD::ShardDispatcher::handle_recovery_subreq(
 +  crimson::net::ConnectionRef conn,
 +  Ref<MOSDFastDispatchOp> m)
  {
-   std::ignore = pg_shard_manager.start_pg_operation<RecoverySubRequest>(
-     conn, std::move(m));
-   return seastar::now();
+   return pg_shard_manager.start_pg_operation<RecoverySubRequest>(
+     conn, std::move(m)).second;
  }
  
  bool OSD::should_restart() const
@@@ -1375,14 -1234,13 +1371,13 @@@ seastar::future<> OSD::ShardDispatcher:
      conn,
      pg_shard_t{from, m->get_spg().shard},
      m->get_spg(),
-     std::move(*evt));
-   return seastar::now();
+     std::move(*evt)).second;
  }
  
 -seastar::future<> OSD::check_osdmap_features()
 +seastar::future<> OSD::ShardDispatcher::check_osdmap_features()
  {
    return store.write_meta("require_osd_release",
 -                          stringify((int)osdmap->require_osd_release));
 +                          stringify((int)osd.osdmap->require_osd_release));
  }
  
  seastar::future<> OSD::prepare_to_stop()