- osdmon needs to lower-bound old osdmap versions it keeps around?
mds mustfix
-- fix rejoin vs updated dirfrag nested/dirlocks
- - not inode_full, now.. send the fnode. but for auth dirfrags, _to_ inode auth... which is sorta outside the subtree..?
/- locks (esp scatter) vs rejoin, scatter_writebehind
- make sure locker avoids frozen inodes
// nested ---------------------------------------------------------------
+void Locker::mark_updated_scatterlock(ScatterLock *lock)
+{
+ lock->set_updated();
+ if (lock->xlistitem_updated.get_xlist()) {
+ dout(10) << "mark_updated_scatterlock " << *lock
+ << " -- already on list since " << lock->update_stamp << dendl;
+ } else {
+ updated_scatterlocks.push_back(&lock->xlistitem_updated);
+ lock->update_stamp = g_clock.now();
+ dout(10) << "mark_updated_scatterlock " << *lock
+ << " -- added at " << lock->update_stamp << dendl;
+ }
+}
+
/*
* NOTE: we _have_ to delay the scatter if we are called during a
* rejoin, because we can't twiddle locks between when the
}
if (stop) {
dout(10) << "predirty_nested stop. marking dirlock on " << *pin << dendl;
- pin->dirlock.set_updated();
+ mark_updated_scatterlock(&pin->dirlock);
mut->add_updated_scatterlock(&pin->dirlock);
mut->ls->dirty_dirfrag_dir.push_back(&pin->xlist_dirty_dirfrag_dir);
break;
}
if (--n == 0) break;
}
+
+
+ // updated
+ while (!updated_scatterlocks.empty()) {
+ ScatterLock *lock = updated_scatterlocks.front();
+
+ if (!lock->is_updated() ||
+ !lock->get_parent()->is_auth() ||
+ !lock->is_stable()) {
+ updated_scatterlocks.pop_front();
+ dout(10) << " removed from updated_scatterlocks " << *lock << " " << *lock->get_parent() << dendl;
+ continue;
+ }
+
+ if (now - lock->update_stamp < 10.0)
+ break;
+
+ updated_scatterlocks.pop_front();
+
+ dout(10) << " scattering updated_scatterlocks item " << *lock << " " << *lock->get_parent() << dendl;
+ scatter_scatter(lock);
+ }
}
};
void scatter_writebehind_finish(ScatterLock *lock, Mutation *mut);
+ xlist<ScatterLock*> updated_scatterlocks;
public:
+ void mark_updated_scatterlock(ScatterLock *lock);
void predirty_nested(Mutation *mut, EMetaBlob *blob, CInode *in, CDir *dir,
int flags, int linkunlink=0);
public:
xlist<ScatterLock*>::item xlistitem_autoscattered;
+ xlist<ScatterLock*>::item xlistitem_updated;
+ utime_t update_stamp;
ScatterLock(MDSCacheObject *o, int t, int wo) :
SimpleLock(o, t, wo),
num_wrlock(0),
updated(false),
- xlistitem_autoscattered(this) {}
+ xlistitem_autoscattered(this),
+ xlistitem_updated(this) {}
int get_replica_state() {
switch (state) {
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation. See file COPYING.
+ *
+ */
+
+#ifndef __MDS_ECOMMITTED_H
+#define __MDS_ECOMMITTED_H
+
+#include "../LogEvent.h"
+#include "EMetaBlob.h"
+
+class ECommitted : public LogEvent {
+public:
+ metareqid_t reqid;
+
+ ECommitted() : LogEvent(EVENT_COMMITTED) { }
+ ECommitted(metareqid_t r) :
+ LogEvent(EVENT_COMMITTED), reqid(r) { }
+
+ void print(ostream& out) {
+ out << "ECommitted " << reqid;
+ }
+
+ void encode(bufferlist &bl) const {
+ ::encode(reqid, bl);
+ }
+ void decode(bufferlist::iterator &bl) {
+ ::decode(reqid, bl);
+ }
+
+ void update_segment() {}
+ void replay(MDS *mds);
+};
+
+#endif