Project

General

Profile

Bug #22103

ceph_perf_msgr_client does not work for multiple jobs

Added by Jeegn Chen almost 2 years ago. Updated 5 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
11/10/2017
Due date:
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

In MessengerClient::ready(), msgr->start() is invoked after a connect operation initiated.
But befor msgr->start() initialize my_inst.addr.nonce to a specific uniq value, my_inst.addr.nonce is zero.
As a result, multi jobs' connections to the server side will share the nonce 0, and the server side will consider the connetions are duplicated.

  void ready(int c, int jobs, int ops, int msg_len) {
    entity_addr_t addr;
    addr.parse(serveraddr.c_str());
    addr.set_nonce(0);
    for (int i = 0; i < jobs; ++i) {
      Messenger *msgr = Messenger::create(g_ceph_context, type, entity_name_t::CLIENT(0), "client", getpid()+i, 0);
      msgr->set_default_policy(Messenger::Policy::lossless_client(0));
      entity_inst_t inst(entity_name_t::OSD(0), addr);
      ConnectionRef conn = msgr->get_connection(inst);<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ClientThread *t = new ClientThread(msgr, c, conn, msg_len, ops, think_time_us);
      msgrs.push_back(msgr);
      clients.push_back(t);
      msgr->start();<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    }
    usleep(1000*1000);
  }

The fix is to move "msgr->start()" ahead.

  void ready(int c, int jobs, int ops, int msg_len) {
    entity_addr_t addr;
    addr.parse(serveraddr.c_str());
    addr.set_nonce(0);
    for (int i = 0; i < jobs; ++i) {
      Messenger *msgr = Messenger::create(g_ceph_context, type, entity_name_t::CLIENT(0), "client", getpid()+i, 0);
      msgr->set_default_policy(Messenger::Policy::lossless_client(0));
      msgr->start();<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      entity_inst_t inst(entity_name_t::OSD(0), addr);
      ConnectionRef conn = msgr->get_connection(inst);<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ClientThread *t = new ClientThread(msgr, c, conn, msg_len, ops, think_time_us);
      msgrs.push_back(msgr);
      clients.push_back(t);
     }
    usleep(1000*1000);
  }

History

#2 Updated by Greg Farnum over 1 year ago

  • Status changed from New to Resolved

#3 Updated by Greg Farnum 5 months ago

  • Project changed from RADOS to Messengers

Also available in: Atom PDF