Skip to content

Commit

Permalink
msg: drop pointless specification of supported features
Browse files Browse the repository at this point in the history
Whatever we specify is OR'd onto CEPH_FEATURE_SUPPORTED_DEFAULT (which is
all features) in the Policy() ctor.  This argument is pointless.

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Mar 3, 2017
1 parent 3b8162f commit 5fd15bd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 46 deletions.
17 changes: 4 additions & 13 deletions src/ceph_mds.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,28 +153,19 @@ int main(int argc, const char **argv)

cout << "starting " << g_conf->name << " at " << msgr->get_myaddr()
<< std::endl;
uint64_t supported =
CEPH_FEATURE_UID |
CEPH_FEATURE_NOSRCADDR |
CEPH_FEATURE_DIRLAYOUTHASH |
CEPH_FEATURE_MDS_INLINE_DATA |
CEPH_FEATURE_PGID64 |
CEPH_FEATURE_MSG_AUTH |
CEPH_FEATURE_EXPORT_PEER |
CEPH_FEATURE_MDS_QUOTA;
uint64_t required =
CEPH_FEATURE_OSDREPLYMUX;

msgr->set_default_policy(Messenger::Policy::lossy_client(supported, required));
msgr->set_default_policy(Messenger::Policy::lossy_client(0, required));
msgr->set_policy(entity_name_t::TYPE_MON,
Messenger::Policy::lossy_client(supported,
Messenger::Policy::lossy_client(0,
CEPH_FEATURE_UID |
CEPH_FEATURE_PGID64));
msgr->set_policy(entity_name_t::TYPE_MDS,
Messenger::Policy::lossless_peer(supported,
Messenger::Policy::lossless_peer(0,
CEPH_FEATURE_UID));
msgr->set_policy(entity_name_t::TYPE_CLIENT,
Messenger::Policy::stateful_server(supported, 0));
Messenger::Policy::stateful_server(0, 0));

int r = msgr->bind(g_conf->public_addr);
if (r < 0)
Expand Down
25 changes: 10 additions & 15 deletions src/ceph_mon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -660,27 +660,22 @@ int main(int argc, const char **argv)
msgr->set_cluster_protocol(CEPH_MON_PROTOCOL);
msgr->set_default_send_priority(CEPH_MSG_PRIO_HIGH);

uint64_t supported =
CEPH_FEATURE_UID |
CEPH_FEATURE_NOSRCADDR |
CEPH_FEATURE_PGID64 |
CEPH_FEATURE_MSG_AUTH;
msgr->set_default_policy(Messenger::Policy::stateless_server(supported, 0));
msgr->set_default_policy(Messenger::Policy::stateless_server(0, 0));
msgr->set_policy(entity_name_t::TYPE_MON,
Messenger::Policy::lossless_peer_reuse(
supported,
CEPH_FEATURE_UID |
CEPH_FEATURE_PGID64 |
CEPH_FEATURE_MON_SINGLE_PAXOS));
0,
CEPH_FEATURE_UID |
CEPH_FEATURE_PGID64 |
CEPH_FEATURE_MON_SINGLE_PAXOS));
msgr->set_policy(entity_name_t::TYPE_OSD,
Messenger::Policy::stateless_server(
supported,
CEPH_FEATURE_PGID64 |
CEPH_FEATURE_OSDENC));
0,
CEPH_FEATURE_PGID64 |
CEPH_FEATURE_OSDENC));
msgr->set_policy(entity_name_t::TYPE_CLIENT,
Messenger::Policy::stateless_server(supported, 0));
Messenger::Policy::stateless_server(0, 0));
msgr->set_policy(entity_name_t::TYPE_MDS,
Messenger::Policy::stateless_server(supported, 0));
Messenger::Policy::stateless_server(0, 0));

// throttle client traffic
Throttle *client_throttler = new Throttle(g_ceph_context, "mon_client_bytes",
Expand Down
16 changes: 4 additions & 12 deletions src/ceph_osd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -491,30 +491,23 @@ int main(int argc, const char **argv)
new Throttle(g_ceph_context, "osd_client_messages",
g_conf->osd_client_message_cap));

uint64_t supported =
CEPH_FEATURE_UID |
CEPH_FEATURE_NOSRCADDR |
CEPH_FEATURE_PGID64 |
CEPH_FEATURE_MSG_AUTH |
CEPH_FEATURE_OSD_ERASURE_CODES;

// All feature bits 0 - 34 should be present from dumpling v0.67 forward
uint64_t osd_required =
CEPH_FEATURE_UID |
CEPH_FEATURE_PGID64 |
CEPH_FEATURE_OSDENC;

ms_public->set_default_policy(Messenger::Policy::stateless_server(supported, 0));
ms_public->set_default_policy(Messenger::Policy::stateless_server(0, 0));
ms_public->set_policy_throttlers(entity_name_t::TYPE_CLIENT,
client_byte_throttler.get(),
client_msg_throttler.get());
ms_public->set_policy(entity_name_t::TYPE_MON,
Messenger::Policy::lossy_client(supported,
Messenger::Policy::lossy_client(0,
CEPH_FEATURE_UID |
CEPH_FEATURE_PGID64 |
CEPH_FEATURE_OSDENC));
ms_public->set_policy(entity_name_t::TYPE_MGR,
Messenger::Policy::lossy_client(supported,
Messenger::Policy::lossy_client(0,
CEPH_FEATURE_UID |
CEPH_FEATURE_PGID64 |
CEPH_FEATURE_OSDENC));
Expand All @@ -526,8 +519,7 @@ int main(int argc, const char **argv)
ms_cluster->set_default_policy(Messenger::Policy::stateless_server(0, 0));
ms_cluster->set_policy(entity_name_t::TYPE_MON, Messenger::Policy::lossy_client(0,0));
ms_cluster->set_policy(entity_name_t::TYPE_OSD,
Messenger::Policy::lossless_peer(supported,
osd_required));
Messenger::Policy::lossless_peer(0, osd_required));
ms_cluster->set_policy(entity_name_t::TYPE_CLIENT,
Messenger::Policy::stateless_server(0, 0));

Expand Down
8 changes: 2 additions & 6 deletions src/test/mon/test_mon_workloadgen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -367,17 +367,13 @@ class OSDStub : public TestStub

Throttle throttler(g_ceph_context, "osd_client_bytes",
g_conf->osd_client_message_size_cap);
uint64_t supported =
CEPH_FEATURE_UID |
CEPH_FEATURE_NOSRCADDR |
CEPH_FEATURE_PGID64;

messenger->set_default_policy(
Messenger::Policy::stateless_server(supported, 0));
Messenger::Policy::stateless_server(0, 0));
messenger->set_policy_throttlers(entity_name_t::TYPE_CLIENT,
&throttler, NULL);
messenger->set_policy(entity_name_t::TYPE_MON,
Messenger::Policy::lossy_client(supported, CEPH_FEATURE_UID |
Messenger::Policy::lossy_client(0, CEPH_FEATURE_UID |
CEPH_FEATURE_PGID64 |
CEPH_FEATURE_OSDENC));
messenger->set_policy(entity_name_t::TYPE_OSD,
Expand Down

0 comments on commit 5fd15bd

Please sign in to comment.