]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: Fix calls to Messenger::create with new parameter 13329/head
authorSarit Zubakov <saritz@mellanox.com>
Wed, 8 Feb 2017 10:42:46 +0000 (10:42 +0000)
committerAdir Lev <adirl@mellanox.com>
Thu, 9 Feb 2017 11:54:46 +0000 (11:54 +0000)
Update all calls to Messenger::create()
take 'ms_public_type' or 'ms_cluster_type' instead of 'ms_type'

issue: 971661

Change-Id: Ib234daf393d1838ef596dde35a6d83c1aeecaf10
Signed-off-by: Sarit Zubakov <saritz@mellanox.com>
src/mgr/DaemonServer.cc
src/test/mon/test-mon-msg.cc
src/test/mon/test_mon_workloadgen.cc
src/test/msgr/perf_msgr_client.cc
src/test/msgr/perf_msgr_server.cc
src/test/msgr/test_msgr.cc
src/test/osd/TestOSDScrub.cc
src/test/testmsgr.cc

index 995228ae4017e9096e45f4100e8fded922006360..e3f327c0ecc19f9e965f14ba1e929ced72978c50 100644 (file)
@@ -46,7 +46,8 @@ DaemonServer::~DaemonServer() {
 int DaemonServer::init(uint64_t gid, entity_addr_t client_addr)
 {
   // Initialize Messenger
-  msgr = Messenger::create(g_ceph_context, g_conf->ms_type,
+  std::string public_msgr_type = g_conf->ms_public_type.empty() ? g_conf->ms_type : g_conf->ms_public_type;
+  msgr = Messenger::create(g_ceph_context, public_msgr_type,
                           entity_name_t::MGR(gid), "server", getpid(), 0);
   int r = msgr->bind(g_conf->public_addr);
   if (r < 0) {
index 0c5f7011521a9587480dbd4ce0d535f8bdcb0c1f..ddf333d87a778a6e74aad228068d0d23116e6377 100644 (file)
@@ -79,7 +79,8 @@ public:
   int init_messenger() {
     dout(1) << __func__ << dendl;
 
-    msg = Messenger::create(cct, cct->_conf->ms_type, entity_name_t::CLIENT(-1),
+    std::string public_msgr_type = cct->_conf->ms_public_type.empty() ? cct->_conf->ms_type : cct->_conf->ms_public_type;
+    msg = Messenger::create(cct, public_msgr_type, entity_name_t::CLIENT(-1),
                             "test-mon-msg", 0, 0);
     assert(msg != NULL);
     msg->set_default_policy(Messenger::Policy::lossy_client(0,0));
index 9bb28ef8b99f5f4c50fb1cb1dc0647b67f02eef2..64a618d2ec89a15a0d6816a77d8718e7ebcc544f 100644 (file)
@@ -361,7 +361,8 @@ class OSDStub : public TestStub
             << cct->_conf->auth_supported << dendl;
     stringstream ss;
     ss << "client-osd" << whoami;
-    messenger.reset(Messenger::create(cct, cct->_conf->ms_type, entity_name_t::OSD(whoami),
+    std::string public_msgr_type = cct->_conf->ms_public_type.empty() ? cct->_conf->ms_type : cct->_conf->ms_public_type;
+    messenger.reset(Messenger::create(cct, public_msgr_type, entity_name_t::OSD(whoami),
                                      ss.str().c_str(), getpid(), 0));
 
     Throttle throttler(g_ceph_context, "osd_client_bytes",
index 9ab0af267aca03cbe0e8ed0051ff16401b87a760..f71682ce340319e2fc1de77c96c8313e04805b36 100644 (file)
@@ -189,14 +189,18 @@ int main(int argc, char **argv)
   int think_time = atoi(args[4]);
   int len = atoi(args[5]);
 
-  cerr << " using ms-type " << g_ceph_context->_conf->ms_type << std::endl;
+  std::string public_msgr_type = g_ceph_context->_conf->ms_public_type.empty() ? g_ceph_context->_conf->ms_type : g_ceph_context->_conf->ms_public_type;
+
+  cerr << " using ms-public-type " << public_msgr_type << std::endl;
   cerr << "       server ip:port " << args[0] << std::endl;
   cerr << "       numjobs " << numjobs << std::endl;
   cerr << "       concurrency " << concurrent << std::endl;
   cerr << "       ios " << ios << std::endl;
   cerr << "       thinktime(us) " << think_time << std::endl;
   cerr << "       message data bytes " << len << std::endl;
-  MessengerClient client(g_ceph_context->_conf->ms_type, args[0], think_time);
+
+  MessengerClient client(public_msgr_type, args[0], think_time);
+
   client.ready(concurrent, numjobs, ios, len);
   Cycles::init();
   uint64_t start = Cycles::rdtsc();
index c7f161d52bf6034e6f1fa303951e917e661ca2d3..86c652bb708cce5961d0ee684a789ef6602899f8 100644 (file)
@@ -157,15 +157,17 @@ int main(int argc, char **argv)
 
   int worker_threads = atoi(args[1]);
   int think_time = atoi(args[2]);
+  std::string public_msgr_type = g_ceph_context->_conf->ms_public_type.empty() ? g_ceph_context->_conf->ms_type : g_ceph_context->_conf->ms_public_type;
+
   cerr << " This tool won't handle connection error alike things, " << std::endl;
   cerr << "please ensure the proper network environment to test." << std::endl;
   cerr << " Or ctrl+c when meeting error and restart tests" << std::endl;
-  cerr << " using ms-type " << g_ceph_context->_conf->ms_type << std::endl;
+  cerr << " using ms-public-type " << public_msgr_type << std::endl;
   cerr << "       bind ip:port " << args[0] << std::endl;
   cerr << "       worker threads " << worker_threads << std::endl;
   cerr << "       thinktime(us) " << think_time << std::endl;
 
-  MessengerServer server(g_ceph_context->_conf->ms_type, args[0], worker_threads, think_time);
+  MessengerServer server(public_msgr_type, args[0], worker_threads, think_time);
   server.start();
 
   return 0;
index 9aa5332b096bc2cbef9902f71d1fd08a97e9ee5d..02d42fe21b94c665835c2a146c780325b4e50506 100644 (file)
@@ -1498,7 +1498,7 @@ INSTANTIATE_TEST_CASE_P(
   Messenger,
   MessengerTest,
   ::testing::Values(
-    "async",
+    "async+posix",
     "simple"
   )
 );
index 223beb2b8c9889b4fb6bd281645f1f84a3c55b2c..9c0a2f2503b65d70dcef29dee18193dea2e7bdcf 100644 (file)
@@ -56,7 +56,8 @@ TEST(TestOSDScrub, scrub_time_permit) {
              g_conf->osd_objectstore,
              g_conf->osd_data,
              g_conf->osd_journal);
-  Messenger *ms = Messenger::create(g_ceph_context, g_conf->ms_type,
+  std::string cluster_msgr_type = g_conf->ms_cluster_type.empty() ? g_conf->ms_type : g_conf->ms_cluster_type;
+  Messenger *ms = Messenger::create(g_ceph_context, cluster_msgr_type,
                                    entity_name_t::OSD(0), "make_checker",
                                    getpid(), 0);
   ms->set_cluster_protocol(CEPH_OSD_PROTOCOL);
index a693461bc927a85849bba854ce161e7d08fbeb7f..26c3f398e5ac666fd45bece18a6885b920018236 100644 (file)
@@ -92,8 +92,9 @@ int main(int argc, const char **argv, const char *envp[]) {
   std::string sss(ss.str());
   g_ceph_context->_conf->set_val("public_addr", sss.c_str());
   g_ceph_context->_conf->apply_changes(NULL);
+  std::string public_msgr_type = g_conf->ms_public_type.empty() ? g_conf->ms_type : g_conf->ms_public_type;
   Messenger *rank = Messenger::create(g_ceph_context,
-                                     g_conf->ms_type,
+                                     public_msgr_type,
                                      entity_name_t::MON(whoami), "tester",
                                      getpid());
   int err = rank->bind(g_ceph_context->_conf->public_addr);