Instead, add the lock to the update_scatterlock list, as usual.
OPTION(mds_reconnect_timeout, 0, OPT_FLOAT, 45), // seconds to wait for clients during mds restart
// make it (mds_session_timeout - mds_beacon_grace)
OPTION(mds_tick_interval, 0, OPT_FLOAT, 5),
+ OPTION(mds_dirstat_min_interval, 0, OPT_FLOAT, 1), // try to avoid propagating more often than this
OPTION(mds_scatter_nudge_interval, 0, OPT_FLOAT, 5), // how quickly dirstat changes propagate up the hierarchy
OPTION(mds_client_prealloc_inos, 0, OPT_INT, 1000),
OPTION(mds_early_reply, 0, OPT_BOOL, true),
float mds_reconnect_timeout;
float mds_tick_interval;
+ float mds_dirstat_min_interval;
float mds_scatter_nudge_interval;
int mds_client_prealloc_inos;
gather++;
}
+ if (!gather && lock->is_updated()) {
+ lock->get_parent()->auth_pin(lock);
+ scatter_writebehind((ScatterLock*)lock);
+ return false;
+ }
+
if (gather) {
lock->get_parent()->auth_pin(lock);
return false;
}
if (!gather && lock->is_updated()) {
+ lock->get_parent()->auth_pin(lock);
scatter_writebehind((ScatterLock*)lock);
- gather++;
+ return;
}
if (gather) {
list<CInode*> lsi;
CInode *cur = in;
CDentry *parentdn = cur->get_projected_parent_dn();
+ bool first = true;
while (parent) {
//assert(cur->is_auth() || !primary_dn); // this breaks the rename auth twiddle hack
assert(parent->is_auth());
dout(10) << "predirty_journal_parents !auth or ambig on " << *pin << dendl;
stop = true;
}
+
+ // delay propagating until later?
+ if (!stop && !first &&
+ g_conf.mds_dirstat_min_interval > 0) {
+ if (pin->last_dirstat_prop.sec() > 0) {
+ double since_last_prop = mut->now - pin->last_dirstat_prop;
+ if (since_last_prop < g_conf.mds_dirstat_min_interval) {
+ dout(10) << "predirty_journal_parents last prop " << since_last_prop
+ << " < " << g_conf.mds_dirstat_min_interval
+ << ", stopping" << dendl;
+ stop = true;
+ } else {
+ dout(10) << "predirty_journal_parents last prop " << since_last_prop << " ago, continuing" << dendl;
+ }
+ } else {
+ dout(10) << "predirty_journal_parents last prop never, stopping" << dendl;
+ stop = true;
+ }
+ }
+
if (!stop &&
mut->wrlocks.count(&pin->nestlock) == 0 &&
(!pin->can_auth_pin() ||
assert(mut->wrlocks.count(&pin->nestlock) ||
mut->is_slave());
+
+ pin->last_dirstat_prop = mut->now;
// dirfrag -> diri
mut->auth_pin(pin);
linkunlink = 0;
do_parent_mtime = false;
primary_dn = true;
+ first = false;
}
// now, stick it in the blob
void clear_scatter_wanted() { scatter_wanted = false; }
bool get_scatter_wanted() { return scatter_wanted; }
+ bool is_updated() {
+ return dirty;
+ }
void mark_dirty() {
if (!dirty) {
if (!flushing)