Skip to content

Commit

Permalink
Merge 6754: hammer: mds: fix out-of-order messages
Browse files Browse the repository at this point in the history
Reviewed-by: Xiaoxi Chen <xiaoxchen@ebay.com>
  • Loading branch information
Chen committed Feb 26, 2016
2 parents c5ff025 + bbd859c commit 830c05d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/mds/MDS.cc
Expand Up @@ -2445,7 +2445,7 @@ bool MDS::ms_dispatch(Message *m)
ret = true;
} else {
inc_dispatch_depth();
ret = _dispatch(m);
ret = _dispatch(m, true);
dec_dispatch_depth();
}
mds_lock.Unlock();
Expand Down Expand Up @@ -2674,7 +2674,7 @@ void MDS::_advance_queues()

/* If this function returns true, it has put the message. If it returns false,
* it has not put the message. */
bool MDS::_dispatch(Message *m)
bool MDS::_dispatch(Message *m, bool new_msg)
{
if (is_stale_message(m)) {
m->put();
Expand All @@ -2686,6 +2686,9 @@ bool MDS::_dispatch(Message *m)
if (beacon.is_laggy()) {
dout(10) << " laggy, deferring " << *m << dendl;
waiting_for_nolaggy.push_back(m);
} else if (new_msg && !waiting_for_nolaggy.empty()) {
dout(10) << " there are deferred messages, deferring " << *m << dendl;
waiting_for_nolaggy.push_back(m);
} else {
if (!handle_deferrable_message(m)) {
dout(0) << "unrecognized message " << *m << dendl;
Expand Down
4 changes: 2 additions & 2 deletions src/mds/MDS.h
Expand Up @@ -454,7 +454,7 @@ class MDS : public Dispatcher, public md_config_obs_t {
void dec_dispatch_depth() { --dispatch_depth; }

// messages
bool _dispatch(Message *m);
bool _dispatch(Message *m, bool new_msg);

protected:
bool is_stale_message(Message *m);
Expand Down Expand Up @@ -488,7 +488,7 @@ class C_MDS_RetryMessage : public MDSInternalContext {
}
virtual void finish(int r) {
mds->inc_dispatch_depth();
mds->_dispatch(m);
mds->_dispatch(m, false);
mds->dec_dispatch_depth();
}
};
Expand Down

0 comments on commit 830c05d

Please sign in to comment.