mds_bal_interval: 30, // seconds
mds_bal_idle_threshold: .1,
mds_bal_max: -1,
+ mds_bal_max_until: -1,
mds_commit_on_shutdown: true,
g_conf.mds_bal_interval = atoi(argv[++i]);
else if (strcmp(argv[i], "--mds_bal_max") == 0)
g_conf.mds_bal_max = atoi(argv[++i]);
+ else if (strcmp(argv[i], "--mds_bal_max_until") == 0)
+ g_conf.mds_bal_max_until = atoi(argv[++i]);
else if (strcmp(argv[i], "--client_cache_size") == 0)
g_conf.client_cache_size = atoi(argv[++i]);
// balance?
static int num_bal_times = g_conf.mds_bal_max;
+ static timepair_t first = g_clock.gettimepair();
timepair_t now = g_clock.gettimepair();
- if (true && num_bal_times && whoami == 0 &&
+ timepair_t elapsed = now - first;
+ if (true &&
+ whoami == 0 &&
+ (num_bal_times || (g_conf.mds_bal_max_until >= 0 && elapsed.first > g_conf.mds_bal_max_until)) &&
!shutting_down && !shut_down &&
now.first - last_balancer_heartbeat.first >= g_conf.mds_bal_interval) {
last_balancer_heartbeat = now;
// dentry
if (committed_version > dn->get_parent_dir_version()) {
- dout(5) << " dir " << committed_version << " > dn " << dn->get_parent_dir_version() << " still clean " << *dn << endl;
+ dout(15) << " dir " << committed_version << " > dn " << dn->get_parent_dir_version() << " still clean " << *dn << endl;
assert(!dn->is_dirty());
}
else if (dn->get_parent_dir_version() == committed_version) {
- dout(5) << " dir " << committed_version << " == dn " << dn->get_parent_dir_version() << " now clean " << *dn << endl;
+ dout(15) << " dir " << committed_version << " == dn " << dn->get_parent_dir_version() << " now clean " << *dn << endl;
dn->mark_clean(); // might not but could be dirty
// remove, if it's null and unlocked
if (dn->is_null() && dn->is_sync()) {
- dout(5) << " removing clean and null " << *dn << endl;
+ dout(15) << " removing clean and null " << *dn << endl;
null_clean.push_back(dn);
continue;
}
} else {
- dout(5) << " dir " << committed_version << " < dn " << dn->get_parent_dir_version() << " still dirty " << *dn << endl;
+ dout(15) << " dir " << committed_version << " < dn " << dn->get_parent_dir_version() << " still dirty " << *dn << endl;
assert(committed_version < dn->get_parent_dir_version());
assert(dn->is_dirty() || !dn->is_sync());
}
assert(in->is_auth());
if (committed_version > in->get_parent_dir_version()) {
- dout(5) << " dir " << committed_version << " > inode " << in->get_parent_dir_version() << " still clean " << *(in) << endl;
+ dout(15) << " dir " << committed_version << " > inode " << in->get_parent_dir_version() << " still clean " << *(in) << endl;
assert(!in->is_dirty());
}
else if (in->get_parent_dir_version() == committed_version) {
- dout(5) << " dir " << committed_version << " == inode " << in->get_parent_dir_version() << " now clean " << *(in) << endl;
+ dout(15) << " dir " << committed_version << " == inode " << in->get_parent_dir_version() << " now clean " << *(in) << endl;
in->mark_clean(); // might not but could be dirty
} else {
- dout(5) << " dir " << committed_version << " < inode " << in->get_parent_dir_version() << " still dirty " << *(in) << endl;
+ dout(15) << " dir " << committed_version << " < inode " << in->get_parent_dir_version() << " still dirty " << *(in) << endl;
assert(committed_version < in->get_parent_dir_version());
assert(in->is_dirty());
}