]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
AsyncConnection: set out seq for message when sending ready
authorHaomai Wang <haomaiwang@gmail.com>
Sun, 21 Jun 2015 16:16:59 +0000 (00:16 +0800)
committerHaomai Wang <haomaiwang@gmail.com>
Sun, 21 Jun 2015 16:31:52 +0000 (00:31 +0800)
Otherwise it will result in higher priority but later message to be issued
firstly, then peer will receive out-of-order message seq

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
src/msg/async/AsyncConnection.cc

index c83bb4471bf528583439ec42cd53b4aeafa7e670..921b9ba75072fe5b92f5da54fabf451f442a4003 100644 (file)
@@ -1942,7 +1942,6 @@ int AsyncConnection::send_message(Message *m)
   prepare_send_message(f, m, bl);
 
   Mutex::Locker l(write_lock);
-  m->set_seq(out_seq.inc());
   // "features" changes will change the payload encoding
   if (can_write == NOWRITE || get_features() != f) {
     // ensure the correctness of message encoding
@@ -2245,6 +2244,7 @@ void AsyncConnection::prepare_send_message(uint64_t features, Message *m, buffer
 int AsyncConnection::write_message(Message *m, bufferlist& bl)
 {
   assert(can_write == CANWRITE);
+  m->set_seq(out_seq.inc());
 
   if (!policy.lossy) {
     // put on sent list