Check on ifile and inest gather that stats match single-frag dirs.
Signed-off-by: Sage Weil <sage@newdream.net>
OPTION(mds_dump_cache_on_map, 0, OPT_BOOL, false),
OPTION(mds_dump_cache_after_rejoin, 0, OPT_BOOL, false),
OPTION(mds_hack_log_expire_for_better_stats, 0, OPT_BOOL, false),
+ OPTION(mds_verify_scatter, 0, OPT_BOOL, false),
OPTION(mds_kill_mdstable_at, 0, OPT_INT, 0),
OPTION(mds_kill_export_at, 0, OPT_INT, 0),
OPTION(mds_kill_import_at, 0, OPT_INT, 0),
bool mds_hack_log_expire_for_better_stats;
// set these to non-zero to specify kill points
+ bool mds_verify_scatter;
int mds_kill_mdstable_at;
int mds_kill_export_at;
int mds_kill_import_at;
dout(20) << fg << " skipping OLD accounted_fragstat " << pf->accounted_fragstat << dendl;
}
pf->fragstat.version = pf->accounted_fragstat.version = pi->dirstat.version + 1;
+
+ if (fg == frag_t()) { // i.e., we are the only frag
+ if (pi->dirstat.size() != pf->fragstat.size()) {
+ stringstream ss;
+ ss << "unmatched fragstat size on single dirfrag " << dir->dirfrag()
+ << ", inode has " << pi->dirstat << ", dirfrag has " << pf->fragstat;
+ mdcache->mds->logclient.log(LOG_ERROR, ss);
+
+ // trust the dirfrag for now
+ pi->dirstat = pf->fragstat;
+ pi->dirstat.version--; // (about to re-increment it below!)
+
+ assert(!!"unmatched fragstat size" == g_conf.mds_verify_scatter);
+ }
+ }
}
}
if (touched_mtime)
// trust the dirfrag for now
pi->rstat = pf->rstat;
pi->rstat.version--; // (about to re-increment it below!)
- //assert("unmatched rstat rbytes" == 0);
+
+ assert(!!"unmatched rstat rbytes" == g_conf.mds_verify_scatter);
}
}
}