Skip to content

Commit

Permalink
osd: MOSDScrub cleanup
Browse files Browse the repository at this point in the history
MOSDScrub message is not in use since Nautilus.

Signed-off-by: Matan Breizman <[email protected]>
  • Loading branch information
Matan-B committed Jun 27, 2022
1 parent 4bd6eb6 commit 241393d
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 170 deletions.
80 changes: 0 additions & 80 deletions src/messages/MOSDScrub.h

This file was deleted.

43 changes: 13 additions & 30 deletions src/mgr/DaemonServer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include "messages/MMgrCommand.h"
#include "messages/MMgrCommandReply.h"
#include "messages/MPGStats.h"
#include "messages/MOSDScrub.h"
#include "messages/MOSDScrub2.h"
#include "messages/MOSDForceRecovery.h"
#include "common/errno.h"
Expand Down Expand Up @@ -1360,20 +1359,14 @@ bool DaemonServer::_handle_command(
if (p == osd_cons.end()) {
failed_osds.insert(osd);
} else {
sent_osds.insert(osd);
for (auto& con : p->second) {
if (HAVE_FEATURE(con->get_features(), SERVER_MIMIC)) {
con->send_message(new MOSDScrub2(monc->get_fsid(),
epoch,
spgs,
pvec.back() == "repair",
pvec.back() == "deep-scrub"));
} else {
con->send_message(new MOSDScrub(monc->get_fsid(),
pvec.back() == "repair",
pvec.back() == "deep-scrub"));
}
}
sent_osds.insert(osd);
for (auto& con : p->second) {
con->send_message(new MOSDScrub2(monc->get_fsid(),
epoch,
spgs,
pvec.back() == "repair",
pvec.back() == "deep-scrub"));
}
}
}
if (failed_osds.size() == osds.size()) {
Expand Down Expand Up @@ -1437,21 +1430,11 @@ bool DaemonServer::_handle_command(
return true;
}
for (auto& con : p->second) {
if (HAVE_FEATURE(con->get_features(), SERVER_MIMIC)) {
con->send_message(new MOSDScrub2(monc->get_fsid(),
epoch,
it.second,
prefix == "osd pool repair",
prefix == "osd pool deep-scrub"));
} else {
// legacy
auto q = pgs_by_primary.find(primary);
ceph_assert(q != pgs_by_primary.end());
con->send_message(new MOSDScrub(monc->get_fsid(),
q->second,
prefix == "osd pool repair",
prefix == "osd pool deep-scrub"));
}
con->send_message(new MOSDScrub2(monc->get_fsid(),
epoch,
it.second,
prefix == "osd pool repair",
prefix == "osd pool deep-scrub"));
}
}
cmdctx->reply(0, "");
Expand Down
1 change: 0 additions & 1 deletion src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
#include "messages/MOSDPGReadyToMerge.h"
#include "messages/MMonCommand.h"
#include "messages/MRemoveSnaps.h"
#include "messages/MOSDScrub.h"
#include "messages/MRoute.h"
#include "messages/MMonGetPurgedSnaps.h"
#include "messages/MMonGetPurgedSnapsReply.h"
Expand Down
4 changes: 0 additions & 4 deletions src/msg/Message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
#include "messages/MOSDPGTrim.h"
#include "messages/MOSDPGLease.h"
#include "messages/MOSDPGLeaseAck.h"
#include "messages/MOSDScrub.h"
#include "messages/MOSDScrub2.h"
#include "messages/MOSDScrubReserve.h"
#include "messages/MOSDRepScrub.h"
Expand Down Expand Up @@ -580,9 +579,6 @@ Message *decode_message(CephContext *cct,
m = make_message<MOSDPGLeaseAck>();
break;

case MSG_OSD_SCRUB:
m = make_message<MOSDScrub>();
break;
case MSG_OSD_SCRUB2:
m = make_message<MOSDScrub2>();
break;
Expand Down
1 change: 0 additions & 1 deletion src/msg/MessageRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ class MOSDRepOpReply;
class MOSDRepScrub;
class MOSDRepScrubMap;
class MOSDScrub2;
class MOSDScrub;
class MOSDScrubReserve;
class MPGStatsAck;
class MPGStats;
Expand Down
48 changes: 0 additions & 48 deletions src/osd/OSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@

#include "messages/MOSDAlive.h"

#include "messages/MOSDScrub.h"
#include "messages/MOSDScrub2.h"

#include "messages/MCommand.h"
Expand Down Expand Up @@ -7348,59 +7347,12 @@ void OSD::_dispatch(Message *m)
break;

// osd
case MSG_OSD_SCRUB:
handle_scrub(static_cast<MOSDScrub*>(m));
break;

case MSG_COMMAND:
handle_command(static_cast<MCommand*>(m));
return;
}
}

// remove me post-nautilus
void OSD::handle_scrub(MOSDScrub *m)
{
dout(10) << "handle_scrub " << *m << dendl;
if (!require_mon_or_mgr_peer(m)) {
m->put();
return;
}
if (m->fsid != monc->get_fsid()) {
dout(0) << "handle_scrub fsid " << m->fsid << " != " << monc->get_fsid()
<< dendl;
m->put();
return;
}

vector<spg_t> spgs;
_get_pgids(&spgs);

if (!m->scrub_pgs.empty()) {
vector<spg_t> v;
for (auto pgid : m->scrub_pgs) {
spg_t pcand;
if (get_osdmap()->get_primary_shard(pgid, &pcand) &&
std::find(spgs.begin(), spgs.end(), pcand) != spgs.end()) {
v.push_back(pcand);
}
}
spgs.swap(v);
}

for (auto pgid : spgs) {
enqueue_peering_evt(
pgid,
PGPeeringEventRef(
std::make_shared<PGPeeringEvent>(
get_osdmap_epoch(),
get_osdmap_epoch(),
PeeringState::RequestScrub(m->deep, m->repair))));
}

m->put();
}

void OSD::handle_fast_scrub(MOSDScrub2 *m)
{
dout(10) << __func__ << " " << *m << dendl;
Expand Down
1 change: 0 additions & 1 deletion src/osd/OSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,6 @@ class OSD : public Dispatcher,
ObjectStore *store,
uuid_d& cluster_fsid, uuid_d& osd_fsid, int whoami, std::string& osdspec_affinity);

void handle_scrub(class MOSDScrub *m);
void handle_fast_scrub(class MOSDScrub2 *m);
void handle_osd_ping(class MOSDPing *m);

Expand Down
1 change: 0 additions & 1 deletion src/osd/scrubber/PrimaryLogScrub.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "messages/MOSDOp.h"
#include "messages/MOSDRepScrub.h"
#include "messages/MOSDRepScrubMap.h"
#include "messages/MOSDScrub.h"
#include "messages/MOSDScrubReserve.h"
#include "osd/OSD.h"

Expand Down
1 change: 0 additions & 1 deletion src/osd/scrubber/pg_scrubber.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "messages/MOSDOp.h"
#include "messages/MOSDRepScrub.h"
#include "messages/MOSDRepScrubMap.h"
#include "messages/MOSDScrub.h"
#include "messages/MOSDScrubReserve.h"
#include "osd/OSD.h"
#include "osd/PG.h"
Expand Down
3 changes: 0 additions & 3 deletions src/tools/ceph-dencoder/common_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,6 @@ MESSAGE(MOSDPing)
#include "messages/MOSDRepScrub.h"
MESSAGE(MOSDRepScrub)

#include "messages/MOSDScrub.h"
MESSAGE(MOSDScrub)

#include "messages/MOSDScrub2.h"
MESSAGE(MOSDScrub2)

Expand Down

0 comments on commit 241393d

Please sign in to comment.