double dir_pop = dir->popularity[MDS_POP_CURDOM].meta_load();
double dir_sum = 0;
- dout(7) << " find_exports in " << dir_pop << " " << *dir << " need " << need << " (" << needmin << " - " << needmax << ")" << endl;
+ dout(-7) << " find_exports in " << dir_pop << " " << *dir << " need " << need << " (" << needmin << " - " << needmax << ")" << endl;
for (CDir_map_t::iterator it = dir->begin();
it != dir->end();
// hit modify counter, if this was a modify
if (g_conf.num_mds > 2 && // FIXME >2 thing
- dir->is_auth() &&
- !dir->inode->is_root()) { // not root (for now at least)
+ !dir->inode->is_root() && // not root (for now at least)
+ dir->is_auth()) {
+ //dout(-20) << "hit_dir " << type << " pop is " << v << " " << *dir << endl;
+
// hash this dir? (later?)
if (((v > g_conf.mds_bal_hash_rd && type == META_POP_IRD) ||
- (v > g_conf.mds_bal_hash_wr && type == META_POP_IWR)) &&
+ //(v > g_conf.mds_bal_hash_wr && type == META_POP_IWR) ||
+ (v > g_conf.mds_bal_hash_wr && type == META_POP_DWR)) &&
!(dir->is_hashed() || dir->is_hashing()) &&
hash_queue.count(dir->ino()) == 0) {
dout(0) << "hit_dir " << type << " pop is " << v << ", putting in hash_queue: " << *dir << endl;
hash_queue.insert(dir->ino());
}
+
}
hit_recursive(dir, type);
void MDBalancer::show_imports(bool external)
{
int db = 20; //debug level
-
+ return;
if (mds->mdcache->imports.empty() &&
mds->mdcache->hashdirs.empty()) {
if (((MClientRequest*)req)->get_mds_wants_replica_in_dirino() == cur->dir->ino() &&
cur->dir->is_auth() &&
cur->dir->is_rep() &&
- cur->dir->is_open_by(req->get_source().num())) {
+ cur->dir->is_open_by(req->get_source().num()) &&
+ dn->get_inode()->is_auth()
+ ) {
assert(req->get_source().is_mds());
int from = req->get_source().num();
finish_contexts(ls);
}
+ // hash root?
+ if (false &&
+ mdcache->get_root() &&
+ mdcache->get_root()->dir &&
+ !(mdcache->get_root()->dir->is_hashed() ||
+ mdcache->get_root()->dir->is_hashing())) {
+ dout(0) << "hashing root" << endl;
+ mdcache->hash_dir(mdcache->get_root()->dir);
+ }
+
+
// periodic crap (1-second resolution)
static utime_t last_log = g_clock.recent_now();
utime_t now = g_clock.recent_now();
balancer->hit_dir(newdir, META_POP_DWR);
+ if (diri->dir->is_auth() &&
+ diri->dir->is_rep() &&
+ newdir->is_auth() &&
+ !newdir->is_hashing()) {
+ int dest = rand() % mdcluster->get_num_mds();
+ if (dest != whoami) {
+ dout(-10) << "exporting new dir " << *newdir << " in replicated parent " << *diri->dir << endl;
+ mdcache->export_dir(newdir, dest);
+ }
+ }
+
// commit
commit_request(req, new MClientReply(req, 0), diri,
new EInodeUpdate(newi),