Skip to content

Commit

Permalink
Merge PR ceph#43382 into master
Browse files Browse the repository at this point in the history
* refs/pull/43382/head:
	mds: skip journaling blocklisted clients when in `replay` state

Reviewed-by: Patrick Donnelly <[email protected]>
  • Loading branch information
batrick committed Oct 15, 2021
2 parents 9b7a208 + 6d6236d commit a584ffa
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
38 changes: 22 additions & 16 deletions src/mds/MDSRank.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,17 @@ void MDSRank::resolve_done()
snapclient->sync(new C_MDSInternalNoop);
}

void MDSRank::apply_blocklist(const std::set<entity_addr_t> &addrs, epoch_t epoch) {
auto victims = server->apply_blocklist(addrs);
dout(4) << __func__ << ": killed " << victims << " blocklisted sessions ("
<< addrs.size() << " blocklist entries, "
<< sessionmap.get_sessions().size() << ")" << dendl;
if (victims) {
set_osd_epoch_barrier(epoch);
}
}


void MDSRank::reconnect_start()
{
dout(1) << "reconnect_start" << dendl;
Expand All @@ -1947,13 +1958,8 @@ void MDSRank::reconnect_start()
o.get_blocklist(&blocklist);
epoch = o.get_epoch();
});
auto killed = server->apply_blocklist(blocklist);
dout(4) << "reconnect_start: killed " << killed << " blocklisted sessions ("
<< blocklist.size() << " blocklist entries, "
<< sessionmap.get_sessions().size() << ")" << dendl;
if (killed) {
set_osd_epoch_barrier(epoch);
}

apply_blocklist(blocklist, epoch);

server->reconnect_clients(new C_MDS_VoidFn(this, &MDSRank::reconnect_done));
finish_contexts(g_ceph_context, waiting_for_reconnect);
Expand Down Expand Up @@ -3455,17 +3461,17 @@ void MDSRankDispatcher::handle_osd_map()

purge_queue.update_op_limit(*mdsmap);

std::set<entity_addr_t> newly_blocklisted;
objecter->consume_blocklist_events(&newly_blocklisted);
auto epoch = objecter->with_osdmap([](const OSDMap &o){return o.get_epoch();});
dout(4) << "handle_osd_map epoch " << epoch << ", "
<< newly_blocklisted.size() << " new blocklist entries" << dendl;
auto victims = server->apply_blocklist(newly_blocklisted);
if (victims) {
set_osd_epoch_barrier(epoch);
// it's ok if replay state is reached via standby-replay, the
// reconnect state will journal blocklisted clients (journal
// is opened for writing in `replay_done` before moving to
// up:resolve).
if (!is_replay()) {
std::set<entity_addr_t> newly_blocklisted;
objecter->consume_blocklist_events(&newly_blocklisted);
auto epoch = objecter->with_osdmap([](const OSDMap &o){return o.get_epoch();});
apply_blocklist(newly_blocklisted, epoch);
}


// By default the objecter only requests OSDMap updates on use,
// we would like to always receive the latest maps in order to
// apply policy based on the FULL flag.
Expand Down
4 changes: 4 additions & 0 deletions src/mds/MDSRank.h
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,10 @@ class MDSRank {

Context *create_async_exec_context(C_ExecAndReply *ctx);

// blocklist the provided addrs and set OSD epoch barrier
// with the provided epoch.
void apply_blocklist(const std::set<entity_addr_t> &addrs, epoch_t epoch);

// Incarnation as seen in MDSMap at the point where a rank is
// assigned.
int incarnation = 0;
Expand Down

0 comments on commit a584ffa

Please sign in to comment.