OPTION(mds_use_tmap, 0, OPT_BOOL, true), // use trivialmap for dir updates
OPTION(mds_default_dir_hash, 0, OPT_INT, CEPH_STR_HASH_RJENKINS),
OPTION(mds_log, 0, OPT_BOOL, true),
- OPTION(mds_log_unsafe, 0, OPT_BOOL, false), // only wait for log sync, when it's mostly safe to do so
OPTION(mds_log_skip_corrupt_events, 0, OPT_BOOL, false),
OPTION(mds_log_max_events, 0, OPT_INT, -1),
OPTION(mds_log_max_segments, 0, OPT_INT, 30), // segment size defined by FileLayout, above
int mds_default_dir_hash;
bool mds_log;
- bool mds_log_unsafe;
bool mds_log_skip_corrupt_events;
int mds_log_max_events;
int mds_log_max_segments;
{
MDLog *mdlog = inode->mdcache->mds->mdlog;
version_t pv = pre_dirty();
- mdlog->wait_for_sync(new C_Dir_Dirty(this, pv, mdlog->get_current_segment()));
+ mdlog->wait_for_safe(new C_Dir_Dirty(this, pv, mdlog->get_current_segment()));
}
void CDir::mark_complete() {
mdcache->journal_dirty_inode(mut, &le->metablob, in, follows);
mds->mdlog->submit_entry(le);
- mds->mdlog->wait_for_sync(new C_Locker_FileUpdate_finish(this, in, mut, false,
+ mds->mdlog->wait_for_safe(new C_Locker_FileUpdate_finish(this, in, mut, false,
client, NULL, ack));
}
mdcache->journal_dirty_inode(mut, &le->metablob, in, follows);
mds->mdlog->submit_entry(le);
- mds->mdlog->wait_for_sync(new C_Locker_FileUpdate_finish(this, in, mut, change_max,
+ mds->mdlog->wait_for_safe(new C_Locker_FileUpdate_finish(this, in, mut, change_max,
client, cap, ack));
// only flush immediately if the lock is unstable, or unissued caps are wanted, or max_size is
// changing
in->finish_scatter_gather_update_accounted(lock->get_type(), mut, &le->metablob);
mds->mdlog->submit_entry(le);
- mds->mdlog->wait_for_sync(new C_Locker_ScatterWB(this, lock, mut));
+ mds->mdlog->wait_for_safe(new C_Locker_ScatterWB(this, lock, mut));
}
void Locker::scatter_writebehind_finish(ScatterLock *lock, Mutation *mut)
journal_dirty_inode(mut, &le->metablob, in);
mds->mdlog->submit_entry(le);
- mds->mdlog->wait_for_sync(new C_MDC_SubtreeMergeWB(this, in, mut));
+ mds->mdlog->wait_for_safe(new C_MDC_SubtreeMergeWB(this, in, mut));
mds->mdlog->flush();
}
}
if (uncommitted_slave_updates[from].empty())
uncommitted_slave_updates.erase(from);
- mds->mdlog->wait_for_sync(new C_MDC_SlaveCommit(this, from, *p));
+ mds->mdlog->wait_for_safe(new C_MDC_SlaveCommit(this, from, *p));
mds->mdlog->flush();
} else {
MDRequest *mdr = request_get(*p);
// -------------------------------------------------
-void MDLog::submit_entry( LogEvent *le, Context *c, bool wait_safe )
+void MDLog::submit_entry(LogEvent *le, Context *c)
{
assert(!mds->is_any_replay());
assert(le == cur_event);
unflushed++;
- if (c) {
-
- if (!g_conf.mds_log_unsafe)
- wait_safe = true;
-
- if (0) {
- unflushed = 0;
- journaler->flush();
- }
-
- if (wait_safe)
- journaler->wait_for_flush(0, c);
- else
- journaler->wait_for_flush(c, 0);
- }
+ if (c)
+ journaler->wait_for_flush(0, c);
// start a new segment?
// FIXME: should this go elsewhere?
}
}
-void MDLog::wait_for_sync( Context *c )
-{
- if (!g_conf.mds_log_unsafe)
- return wait_for_safe(c);
-
- if (g_conf.mds_log) {
- // wait
- journaler->wait_for_flush(c, 0);
- } else {
- // hack: bypass.
- c->finish(0);
- delete c;
- }
-}
-void MDLog::wait_for_safe( Context *c )
+void MDLog::wait_for_safe(Context *c)
{
if (g_conf.mds_log) {
// wait
ESubtreeMap *le = mds->mdcache->create_subtree_map();
submit_entry(le, new C_MDL_WroteSubtreeMap(this, mds->mdlog->get_write_pos()));
if (onsync) {
- wait_for_sync(onsync);
+ wait_for_safe(onsync);
flush();
}
assert(cur_event == NULL);
cur_event = e;
}
- void submit_entry( LogEvent *e, Context *c = 0, bool wait_for_safe=false );
- void start_submit_entry(LogEvent *e, Context *c = 0, bool wait_for_safe=false) {
+ void submit_entry(LogEvent *e, Context *c = 0);
+ void start_submit_entry(LogEvent *e, Context *c = 0) {
start_entry(e);
- submit_entry(e, c, wait_for_safe);
+ submit_entry(e, c);
}
bool entry_is_open() { return cur_event != NULL; }
- void wait_for_sync( Context *c );
void wait_for_safe( Context *c );
void flush();
bool is_flushed() {
_note_commit(tid);
mds->mdlog->start_submit_entry(new ETableServer(table, TABLESERVER_OP_COMMIT, 0, -1,
tid, version));
- mds->mdlog->wait_for_sync(new C_Commit(this, req));
+ mds->mdlog->wait_for_safe(new C_Commit(this, req));
}
else if (tid <= version) {
dout(0) << "got commit for tid " << tid << " <= " << version
dout(7) << "export_go " << *dir << " to " << dest << dendl;
// first sync log to flush out e.g. any cap imports
- mds->mdlog->wait_for_sync(new C_M_ExportGo(this, dir));
+ mds->mdlog->wait_for_safe(new C_M_ExportGo(this, dir));
mds->mdlog->flush();
}
early_reply(mdr, in, dn);
mdr->committing = true;
- mdlog->submit_entry(le, fin,
- mdr->did_ino_allocation());
+ mdlog->submit_entry(le, fin);
if (mdr->client_request && mdr->client_request->is_replay()) {
if (mds->queue_one_replay()) {