<< " follows " << follows
<< " op " << ceph_cap_op_name(m->get_op()) << dendl;
+ if (!mds->is_active() && !mds->is_stopping() && !mds->is_clientreplay()) {
+ mds->wait_for_replay(new C_MDS_RetryMessage(mds, m));
+ return;
+ }
+
CInode *head_in = mdcache->get_inode(m->get_ino());
if (!head_in) {
dout(7) << "handle_client_caps on unknown ino " << m->get_ino() << ", dropping" << dendl;
mdcache->show_subtrees();
mdcache->show_cache();
- if (waiting_for_replay.empty())
+ if (replay_queue.empty())
request_state(MDSMap::STATE_ACTIVE);
else
request_state(MDSMap::STATE_CLIENTREPLAY);
void MDS::clientreplay_start()
{
dout(1) << "clientreplay_start" << dendl;
+ finish_contexts(waiting_for_replay); // kick waiters
queue_one_replay();
}
{
dout(1) << "active_start" << dendl;
mdcache->clean_open_file_lists();
+ finish_contexts(waiting_for_replay); // kick waiters
finish_contexts(waiting_for_active); // kick waiters
}
// done with all client replayed requests?
if (is_clientreplay() &&
mdcache->is_open() &&
- waiting_for_replay.empty() &&
+ replay_queue.empty() &&
want_state == MDSMap::STATE_CLIENTREPLAY) {
dout(10) << " still have " << mdcache->get_num_active_requests()
<< " active replay requests" << dendl;
int want_state; // the state i want
list<Context*> waiting_for_active, waiting_for_replay;
+ list<Context*> replay_queue;
map<int, list<Context*> > waiting_for_active_peer;
list<Context*> waiting_for_nolaggy;
void wait_for_replay(Context *c) {
waiting_for_replay.push_back(c);
}
+ void enqueue_replay(Context *c) {
+ replay_queue.push_back(c);
+ }
int get_state() { return state; }
bool is_creating() { return state == MDSMap::STATE_CREATING; }
finished_queue.splice( finished_queue.end(), ls );
}
bool queue_one_replay() {
- if (waiting_for_replay.empty())
+ if (replay_queue.empty())
return false;
- queue_waiter(waiting_for_replay.front());
- waiting_for_replay.pop_front();
+ queue_waiter(replay_queue.front());
+ replay_queue.pop_front();
return true;
}
m->get_type() == CEPH_MSG_CLIENT_REQUEST &&
((MClientRequest*)m)->is_replay()) {
dout(3) << "queuing replayed op" << dendl;
- mds->wait_for_replay(new C_MDS_RetryMessage(mds, m));
+ mds->enqueue_replay(new C_MDS_RetryMessage(mds, m));
return;
} else if (mds->is_clientreplay() &&
m->get_type() == CEPH_MSG_CLIENT_REQUEST &&