]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/crimson/net/Dispatcher.h
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / crimson / net / Dispatcher.h
index cc6fd4574c7518da11c8471352ba1b0f35d0671d..9eea0a858f0645beb1d8284f985a402d7af60239 100644 (file)
@@ -30,11 +30,27 @@ class Dispatcher {
   // used to throttle the connection if it's too busy.
   virtual std::optional<seastar::future<>> ms_dispatch(ConnectionRef, MessageRef) = 0;
 
-  virtual void ms_handle_accept(ConnectionRef conn) {}
+  // The connection is moving to the new_shard under accept/connect.
+  // User should not operate conn in this shard thereafter.
+  virtual void ms_handle_shard_change(
+      ConnectionRef conn,
+      seastar::shard_id new_shard,
+      bool is_accept_or_connect) {}
+
+  // The connection is accepted or recoverred(lossless), all the followup
+  // events and messages will be dispatched to this shard.
+  //
+  // is_replace=true means the accepted connection has replaced
+  // another connecting connection with the same peer_addr, which currently only
+  // happens under lossy policy when both sides wish to connect to each other.
+  virtual void ms_handle_accept(ConnectionRef conn, seastar::shard_id prv_shard, bool is_replace) {}
 
-  virtual void ms_handle_connect(ConnectionRef conn) {}
+  // The connection is (re)connected, all the followup events and messages will
+  // be dispatched to this shard.
+  virtual void ms_handle_connect(ConnectionRef conn, seastar::shard_id prv_shard) {}
 
   // a reset event is dispatched when the connection is closed unexpectedly.
+  //
   // is_replace=true means the reset connection is going to be replaced by
   // another accepting connection with the same peer_addr, which currently only
   // happens under lossy policy when both sides wish to connect to each other.