Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mds: don't access mdsmap from log submit thread #12208

Merged
merged 1 commit into from Dec 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/mds/MDLog.cc
Expand Up @@ -297,6 +297,7 @@ void MDLog::_submit_entry(LogEvent *le, MDSLogContextBase *c)
le->update_segment();
le->set_stamp(ceph_clock_now(g_ceph_context));

mdsmap_up_features = mds->mdsmap->get_up_features();
pending_events[ls->seq].push_back(PendingEvent(le, c));
num_events++;

Expand Down Expand Up @@ -376,6 +377,7 @@ void MDLog::_submit_thread()
continue;
}

int64_t features = mdsmap_up_features;
PendingEvent data = it->second.front();
it->second.pop_front();

Expand All @@ -386,7 +388,7 @@ void MDLog::_submit_thread()
LogSegment *ls = le->_segment;
// encode it, with event type
bufferlist bl;
le->encode_with_header(bl, mds->mdsmap->get_up_features());
le->encode_with_header(bl, features);

uint64_t write_pos = journaler->get_write_pos();

Expand Down
2 changes: 2 additions & 0 deletions src/mds/MDLog.h
Expand Up @@ -134,6 +134,7 @@ class MDLog {
PendingEvent(LogEvent *e, MDSContext *c, bool f=false) : le(e), fin(c), flush(f) {}
};

int64_t mdsmap_up_features;
map<uint64_t,list<PendingEvent> > pending_events; // log segment -> event list
Mutex submit_mutex;
Cond submit_cond;
Expand Down Expand Up @@ -202,6 +203,7 @@ class MDLog {
already_replayed(false),
recovery_thread(this),
event_seq(0), expiring_events(0), expired_events(0),
mdsmap_up_features(0),
submit_mutex("MDLog::submit_mutex"),
submit_thread(this),
cur_event(NULL) { }
Expand Down