From b2746c94d0e0d5a87e0098d1836297768b527595 Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Thu, 16 Dec 2010 23:55:08 -0800 Subject: [PATCH] logging: eliminate out-of-range dout calls Eliminate calls to dout that use non-existent log levels, like negative levels less than -1. Also trigger a compiler error in the future if they get re-added. -1 is the highest priority dout level; putting lower priorities into the output buffer will just cause errors. Signed-off-by: Colin McCabe --- src/client/SyntheticClient.cc | 4 +- src/common/debug.h | 5 + src/ebofs/BlockDevice.cc | 2 +- src/ebofs/BufferCache.cc | 4 +- src/ebofs/Ebofs.cc | 2 +- src/ebofs/nodes.h | 4 +- src/mds/CDir.cc | 6 +- src/mds/MDBalancer.cc | 268 +++++++++++++++++----------------- src/mds/MDCache.cc | 6 +- src/mds/Migrator.cc | 2 +- src/mds/Server.cc | 8 +- src/mds/journal.cc | 2 +- src/mon/MDSMonitor.cc | 2 +- src/msg/SimpleMessenger.cc | 20 +-- src/osd/OSD.cc | 2 +- src/osd/ReplicatedPG.cc | 8 +- 16 files changed, 175 insertions(+), 170 deletions(-) diff --git a/src/client/SyntheticClient.cc b/src/client/SyntheticClient.cc index e19faaf5ff18c..2522e4613db56 100644 --- a/src/client/SyntheticClient.cc +++ b/src/client/SyntheticClient.cc @@ -770,7 +770,7 @@ int SyntheticClient::run() snprintf(realtfile, sizeof(realtfile), tfile.c_str(), (int)client->get_nodeid().v); if (run_me()) { - dout(-2) << "trace " << tfile << " prefix=" << prefix << " count=" << iarg1 << " data=" << playdata << dendl; + dout(0) << "trace " << tfile << " prefix=" << prefix << " count=" << iarg1 << " data=" << playdata << dendl; Trace t(realtfile); @@ -1884,7 +1884,7 @@ int SyntheticClient::overload_osd_0(int n, int size, int wrsize) { // pull open a file - dout(-1) << "in OSD overload" << dendl; + dout(0) << "in OSD overload" << dendl; string filename = get_sarg(tried); dout(1) << "OSD Overload workload: trying file " << filename << dendl; int fd = client->open(filename.c_str(), O_RDWR|O_CREAT); diff --git a/src/common/debug.h b/src/common/debug.h index 2b4e539b65310..f199b70539c0f 100644 --- a/src/common/debug.h +++ b/src/common/debug.h @@ -69,7 +69,12 @@ inline std::ostream& operator<<(std::ostream& out, _bad_endl_use_dendl_t) { #define XDOUT_CONDVAR(x) DOUT_CONDVAR(x) #define DOUT_COND(l) l <= XDOUT_CONDVAR(DOUT_SUBSYS) +// Declare dout(). +// The array declaration will trigger a compiler error if 'l' is out of range #define dout(l) do { if (DOUT_COND(l)) {\ + if (0) {\ + char __array[((l >= -1) && (l <= 200)) ? 0 : -1] __attribute__((unused)); \ + }\ Mutex::Locker _dout_locker(_dout_lock);\ _dout_begin_line(l); \ dout_prefix diff --git a/src/ebofs/BlockDevice.cc b/src/ebofs/BlockDevice.cc index 830d97be4aa05..974e891ed0083 100644 --- a/src/ebofs/BlockDevice.cc +++ b/src/ebofs/BlockDevice.cc @@ -723,7 +723,7 @@ int BlockDevice::_write(int fd, unsigned bno, unsigned num, bufferlist& bl) assert(0); } else if (r < (int)len) { // hrm, we didn't write _all_ of our data. WTF kind of FS is this? - dout(-1) << "bloody hell, writev only wrote " << r << " of " << len << " bytes, looping" << dendl; + dout(0) << "bloody hell, writev only wrote " << r << " of " << len << " bytes, looping" << dendl; assert(r % 4096 == 0); int wrote = r / 4096; bno += wrote; diff --git a/src/ebofs/BufferCache.cc b/src/ebofs/BufferCache.cc index efdf03235d729..c6f276e33630a 100644 --- a/src/ebofs/BufferCache.cc +++ b/src/ebofs/BufferCache.cc @@ -421,7 +421,7 @@ int ObjectCache::try_map_read(block_t start, block_t len) num_missing++; } else if (e->is_partial()) { - dout(-20) << "try_map_read partial " << *e << dendl; + dout(0) << "try_map_read partial " << *e << dendl; num_missing++; } else { @@ -890,7 +890,7 @@ BufferHead *ObjectCache::merge_bh_left(BufferHead *left, BufferHead *right) /* wait until this has a user void ObjectCache::try_merge_bh(BufferHead *bh) { - dout(-10) << "try_merge_bh " << *bh << dendl; + dout(0) << "try_merge_bh " << *bh << dendl; map::iterator p = data.lower_bound(bh->start()); assert(p->second == bh); diff --git a/src/ebofs/Ebofs.cc b/src/ebofs/Ebofs.cc index 40cf0c48fb777..58a6e11e19b7e 100644 --- a/src/ebofs/Ebofs.cc +++ b/src/ebofs/Ebofs.cc @@ -1015,7 +1015,7 @@ void Ebofs::trim_inodes(int max) assert(on->oc == 0); // an open oc pins the onode! delete on; } else { - dout(-20) << "trim_inodes still active: " << *on << dendl; + dout(0) << "trim_inodes still active: " << *on << dendl; assert(0); // huh? } } diff --git a/src/ebofs/nodes.h b/src/ebofs/nodes.h index 4a42f7776418d..25bd7841c582f 100644 --- a/src/ebofs/nodes.h +++ b/src/ebofs/nodes.h @@ -169,11 +169,11 @@ class NodePool { for (region = 0; (block_t)nid < region_loc[region].start || (block_t)nid > region_loc[region].end(); region++) { - //generic_dout(-20) << "node " << nid << " not in " << region << " " << region_loc[region] << dendl; + //generic_dout(0) << "node " << nid << " not in " << region << " " << region_loc[region] << dendl; num += region_loc[region].length; } num += nid - region_loc[region].start; - //generic_dout(-20) << "node " << nid << " is in " << region << ", overall bitmap pos is " << num << dendl; + //generic_dout(0) << "node " << nid << " is in " << region << ", overall bitmap pos is " << num << dendl; return num; } diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index a1511833a819b..30e65f9fd796d 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -1387,9 +1387,9 @@ void CDir::_fetched(bufferlist &bl, const string& want_dn) CInode *in = 0; if (cache->have_inode(inode.ino, last)) { in = cache->get_inode(inode.ino, last); - dout(-12) << "_fetched badness: got (but i already had) " << *in - << " mode " << in->inode.mode - << " mtime " << in->inode.mtime << dendl; + dout(0) << "_fetched badness: got (but i already had) " << *in + << " mode " << in->inode.mode + << " mtime " << in->inode.mtime << dendl; string dirpath, inopath; this->inode->make_path_string(dirpath); in->make_path_string(inopath); diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index 95d6bdf68ba60..47e2d4958124f 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -1,4 +1,4 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system @@ -7,9 +7,9 @@ * * 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 + * License version 2.1, as published by the Free Software * Foundation. See file COPYING. - * + * */ #include "mdstypes.h" @@ -54,7 +54,7 @@ int MDBalancer::proc_message(Message *m) case MSG_MDS_HEARTBEAT: handle_heartbeat((MHeartbeat*)m); break; - + default: dout(1) << " balancer unknown message " << m->get_type() << dendl; assert(0); @@ -84,19 +84,19 @@ void MDBalancer::tick() // balance? if (last_heartbeat == utime_t()) last_heartbeat = now; - if (true && + if (true && mds->get_nodeid() == 0 && g_conf.mds_bal_interval > 0 && - (num_bal_times || - (g_conf.mds_bal_max_until >= 0 && - elapsed.sec() > g_conf.mds_bal_max_until)) && + (num_bal_times || + (g_conf.mds_bal_max_until >= 0 && + elapsed.sec() > g_conf.mds_bal_max_until)) && mds->is_active() && now.sec() - last_heartbeat.sec() >= g_conf.mds_bal_interval) { last_heartbeat = now; send_heartbeat(); num_bal_times--; } - + // hash? if (g_conf.mds_bal_frag && g_conf.mds_bal_fragment_interval > 0 && now.sec() - last_fragment.sec() > g_conf.mds_bal_fragment_interval) { @@ -120,19 +120,19 @@ public: }; -double mds_load_t::mds_load() +double mds_load_t::mds_load() { switch(g_conf.mds_bal_mode) { - case 0: - return + case 0: + return .8 * auth.meta_load() + .2 * all.meta_load() + req_rate + 10.0 * queue_len; - + case 1: return req_rate + 10.0*queue_len; - + case 2: return cpu_load_avg; @@ -162,7 +162,7 @@ mds_load_t MDBalancer::get_load(utime_t now) load.queue_len = mds->messenger->get_dispatch_queue_len(); ifstream cpu("/proc/loadavg"); - if (cpu.is_open()) + if (cpu.is_open()) cpu >> load.cpu_load_avg; dout(15) << "get_load " << load << dendl; @@ -200,8 +200,8 @@ void MDBalancer::send_heartbeat() import_map[from] += im->pop_auth_subtree.meta_load(now, mds->mdcache->decayrate); } mds_import_map[ mds->get_nodeid() ] = import_map; - - + + dout(5) << "mds" << mds->get_nodeid() << " epoch " << beat_epoch << " load " << load << dendl; for (map::iterator it = import_map.begin(); it != import_map.end(); @@ -209,7 +209,7 @@ void MDBalancer::send_heartbeat() dout(5) << " import_map from " << it->first << " -> " << it->second << dendl; } - + set up; mds->get_mds_map()->get_mds_set(up); for (set::iterator p = up.begin(); p != up.end(); ++p) { @@ -225,7 +225,7 @@ void MDBalancer::send_heartbeat() void MDBalancer::handle_heartbeat(MHeartbeat *m) { dout(25) << "=== got heartbeat " << m->get_beat() << " from " << m->get_source().num() << " " << m->get_load() << dendl; - + if (!mds->is_active()) { m->put(); return; @@ -238,7 +238,7 @@ void MDBalancer::handle_heartbeat(MHeartbeat *m) } int who = m->get_source().num(); - + if (who == 0) { dout(20) << " from mds0, new epoch" << dendl; beat_epoch = m->get_beat(); @@ -246,25 +246,25 @@ void MDBalancer::handle_heartbeat(MHeartbeat *m) show_imports(); } - + mds_load[ who ] = m->get_load(); mds_import_map[ who ] = m->get_import_map(); //dout(0) << " load is " << load << " have " << mds_load.size() << dendl; - + unsigned cluster_size = mds->get_mds_map()->get_num_mds(); if (mds_load.size() == cluster_size) { // let's go! //export_empties(); // no! prep_rebalance(m->get_beat()); } - + // done m->put(); } -void MDBalancer::export_empties() +void MDBalancer::export_empties() { dout(5) << "export_empties checking for empty imports" << dendl; @@ -275,31 +275,31 @@ void MDBalancer::export_empties() if (!dir->is_auth() || dir->is_ambiguous_auth() || dir->is_freezing() || - dir->is_frozen()) + dir->is_frozen()) continue; - + if (!dir->inode->is_base() && !dir->inode->is_stray() && - dir->get_num_head_items() == 0) + dir->get_num_head_items() == 0) mds->mdcache->migrator->export_empty_import(dir); } } -double MDBalancer::try_match(int ex, double& maxex, +double MDBalancer::try_match(int ex, double& maxex, int im, double& maxim) { if (maxex <= 0 || maxim <= 0) return 0.0; - + double howmuch = MIN(maxex, maxim); if (howmuch <= 0) return 0.0; - + dout(5) << " - mds" << ex << " exports " << howmuch << " to mds" << im << dendl; - + if (ex == mds->get_nodeid()) my_targets[im] += howmuch; - + exported[ex] += howmuch; imported[im] += howmuch; @@ -328,7 +328,7 @@ void MDBalancer::do_fragmenting() if (!split_queue.empty()) { dout(0) << "do_fragmenting " << split_queue.size() << " dirs marked for possible splitting" << dendl; - + set q; q.swap(split_queue); @@ -339,7 +339,7 @@ void MDBalancer::do_fragmenting() if (!dir || !dir->is_auth()) continue; - + dout(0) << "do_fragmenting splitting " << *dir << dendl; mds->mdcache->split_dir(dir, g_conf.mds_bal_split_bits); } @@ -347,7 +347,7 @@ void MDBalancer::do_fragmenting() if (!merge_queue.empty()) { dout(0) << "do_fragmenting " << merge_queue.size() << " dirs marked for possible merging" << dendl; - + set q; q.swap(merge_queue); @@ -359,7 +359,7 @@ void MDBalancer::do_fragmenting() !dir->is_auth() || dir->get_frag() == frag_t()) // ok who's the joker? continue; - + dout(0) << "do_fragmenting merging " << *dir << dendl; CInode *diri = dir->get_inode(); @@ -412,30 +412,30 @@ void MDBalancer::prep_rebalance(int beat) int cluster_size = mds->get_mds_map()->get_num_mds(); int whoami = mds->get_nodeid(); rebalance_time = g_clock.now(); - + dump_pop_map(); - + // reset my_targets.clear(); imported.clear(); exported.clear(); - + dout(5) << " prep_rebalance: cluster loads are" << dendl; - + mds->mdcache->migrator->clear_export_queue(); - + // rescale! turn my mds_load back into meta_load units double load_fac = 1.0; if (mds_load[whoami].mds_load() > 0) { double metald = mds_load[whoami].auth.meta_load(rebalance_time, mds->mdcache->decayrate); double mdsld = mds_load[whoami].mds_load(); load_fac = metald / mdsld; - dout(7) << " load_fac is " << load_fac + dout(7) << " load_fac is " << load_fac << " <- " << mds_load[whoami].auth << " " << metald << " / " << mdsld << dendl; } - + double total_load = 0; multimap load_map; for (int i=0; i exporters; set importer_set; set exporter_set; - + for (multimap::iterator it = load_map.begin(); it != load_map.end(); it++) { @@ -514,7 +514,7 @@ void MDBalancer::prep_rebalance(int beat) ex++) { double maxex = get_maxex(ex->second); if (maxex <= .001) continue; - + // check importers. for now, just in arbitrary order (no intelligent matching). for (map::iterator im = mds_import_map[ex->second].begin(); im != mds_import_map[ex->second].end(); @@ -579,8 +579,8 @@ void MDBalancer::try_rebalance() dout(5) << "mds_thrash is on; not performing standard rebalance operation!" << dendl; return; - } - + } + // make a sorted list of my imports map import_pop_map; multimap import_from_map; @@ -592,25 +592,25 @@ void MDBalancer::try_rebalance() it++) { CDir *im = *it; if (im->get_inode()->is_stray()) continue; - + double pop = im->pop_auth_subtree.meta_load(rebalance_time, mds->mdcache->decayrate); if (g_conf.mds_bal_idle_threshold > 0 && pop < g_conf.mds_bal_idle_threshold && im->inode != mds->mdcache->get_root() && im->inode->authority().first != mds->get_nodeid()) { - dout(-5) << " exporting idle (" << pop << ") import " << *im - << " back to mds" << im->inode->authority().first - << dendl; + dout(0) << " exporting idle (" << pop << ") import " << *im + << " back to mds" << im->inode->authority().first + << dendl; mds->mdcache->migrator->export_dir_nicely(im, im->inode->authority().first); continue; } - + import_pop_map[ pop ] = im; int from = im->inode->authority().first; dout(15) << " map: i imported " << *im << " from " << from << dendl; import_from_map.insert(pair(from, im)); } - + // do my exports! @@ -621,17 +621,17 @@ void MDBalancer::try_rebalance() for (map::iterator it = my_targets.begin(); it != my_targets.end(); it++) { - + /* double fac = 1.0; if (false && total_goal > 0 && total_sent > 0) { fac = total_goal / total_sent; - dout(-5) << " total sent is " << total_sent << " / " << total_goal << " -> fac 1/ " << fac << dendl; + dout(0) << " total sent is " << total_sent << " / " << total_goal << " -> fac 1/ " << fac << dendl; if (fac > 1.0) fac = 1.0; } fac = .9 - .4 * ((float)g_conf.num_mds / 128.0); // hack magic fixme */ - + int target = (*it).first; double amount = (*it).second; total_goal += amount; @@ -639,13 +639,13 @@ void MDBalancer::try_rebalance() if (amount < MIN_OFFLOAD) continue; if (amount / target_load < .2) continue; - dout(5) << "want to send " << amount << " to mds" << target - //<< " .. " << (*it).second << " * " << load_fac + dout(5) << "want to send " << amount << " to mds" << target + //<< " .. " << (*it).second << " * " << load_fac << " -> " << amount << dendl;//" .. fudge is " << fudge << dendl; double have = 0; - + show_imports(); // search imports from target @@ -657,18 +657,18 @@ void MDBalancer::try_rebalance() CDir *dir = (*p.first).second; dout(5) << "considering " << *dir << " from " << (*p.first).first << dendl; multimap::iterator plast = p.first++; - + if (dir->inode->is_base() || dir->inode->is_stray()) continue; if (dir->is_freezing() || dir->is_frozen()) continue; // export pbly already in progress double pop = dir->pop_auth_subtree.meta_load(rebalance_time, mds->mdcache->decayrate); assert(dir->inode->authority().first == target); // cuz that's how i put it in the map, dummy - + if (pop <= amount-have) { - dout(-5) << "reexporting " << *dir - << " pop " << pop - << " back to mds" << target << dendl; + dout(0) << "reexporting " << *dir + << " pop " << pop + << " back to mds" << target << dendl; mds->mdcache->migrator->export_dir_nicely(dir, target); have += pop; import_from_map.erase(plast); @@ -683,7 +683,7 @@ void MDBalancer::try_rebalance() total_sent += have; continue; } - + // any other imports if (false) for (map::iterator import = import_pop_map.begin(); @@ -693,13 +693,13 @@ void MDBalancer::try_rebalance() if (imp->inode->is_base() || imp->inode->is_stray()) continue; - + double pop = (*import).first; if (pop < amount-have || pop < MIN_REEXPORT) { - dout(-5) << "reexporting " << *imp - << " pop " << pop - << " back to mds" << imp->inode->authority() - << dendl; + dout(0) << "reexporting " << *imp + << " pop " << pop + << " back to mds" << imp->inode->authority() + << dendl; have += pop; mds->mdcache->migrator->export_dir_nicely(imp, imp->inode->authority().first); } @@ -714,32 +714,32 @@ void MDBalancer::try_rebalance() // okay, search for fragments of my workload set candidates; mds->mdcache->get_fullauth_subtrees(candidates); - + list exports; - + for (set::iterator pot = candidates.begin(); pot != candidates.end(); pot++) { if ((*pot)->get_inode()->is_stray()) continue; find_exports(*pot, amount, exports, have, already_exporting); - if (have > amount-MIN_OFFLOAD) + if (have > amount-MIN_OFFLOAD) break; } //fudge = amount - have; total_sent += have; - + for (list::iterator it = exports.begin(); it != exports.end(); it++) { - dout(-5) << " - exporting " + dout(0) << " - exporting " << (*it)->pop_auth_subtree << " " - << (*it)->pop_auth_subtree.meta_load(rebalance_time, mds->mdcache->decayrate) - << " to mds" << target - << " " << **it + << (*it)->pop_auth_subtree.meta_load(rebalance_time, mds->mdcache->decayrate) + << " to mds" << target + << " " << **it << dendl; mds->mdcache->migrator->export_dir_nicely(*it, target); } } - + dout(5) << "rebalance done" << dendl; show_imports(); } @@ -803,9 +803,9 @@ bool MDBalancer::check_targets() return ok; } -void MDBalancer::find_exports(CDir *dir, - double amount, - list& exports, +void MDBalancer::find_exports(CDir *dir, + double amount, + list& exports, double& have, set& already_exporting) { @@ -830,7 +830,7 @@ void MDBalancer::find_exports(CDir *dir, CInode *in = it->second->get_linkage()->get_inode(); if (!in) continue; if (!in->is_dir()) continue; - + list dfls; in->get_dirfrags(dfls); for (list::iterator p = dfls.begin(); @@ -841,14 +841,14 @@ void MDBalancer::find_exports(CDir *dir, if (already_exporting.count(subdir)) continue; if (subdir->is_frozen()) continue; // can't export this right now! - + // how popular? double pop = subdir->pop_auth_subtree.meta_load(rebalance_time, mds->mdcache->decayrate); subdir_sum += pop; dout(15) << " subdir pop " << pop << " " << *subdir << dendl; if (pop < minchunk) continue; - + // lucky find? if (pop > needmin && pop < needmax) { exports.push_back(subdir); @@ -856,7 +856,7 @@ void MDBalancer::find_exports(CDir *dir, have += pop; return; } - + if (pop > need) { if (subdir->is_rep()) bigger_rep.push_back(subdir); @@ -876,16 +876,16 @@ void MDBalancer::find_exports(CDir *dir, if ((*it).first < midchunk) break; // try later - + dout(7) << " taking smaller " << *(*it).second << dendl; - + exports.push_back((*it).second); already_exporting.insert((*it).second); have += (*it).first; if (have > needmin) return; } - + // apprently not enough; drill deeper into the hierarchy (if non-replicated) for (list::iterator it = bigger_unrep.begin(); it != bigger_unrep.end(); @@ -940,8 +940,8 @@ void MDBalancer::hit_inode(utime_t now, CInode *in, int type, int who) dout(20) << "hit_inode " << type << " pop " << in->popularity[MDS_POP_JUSTME].pop[type].get(now) << " me, " << in->popularity[MDS_POP_NESTED].pop[type].get(now) << " nested, " - << in->popularity[MDS_POP_CURDOM].pop[type].get(now) << " curdom, " - << in->popularity[MDS_POP_CURDOM].pop[type].get(now) << " anydom" + << in->popularity[MDS_POP_CURDOM].pop[type].get(now) << " curdom, " + << in->popularity[MDS_POP_CURDOM].pop[type].get(now) << " anydom" << " on " << *in << dendl; } else { @@ -958,11 +958,11 @@ void MDBalancer::hit_inode(utime_t now, CInode *in, int type, int who) */ -void MDBalancer::hit_dir(utime_t now, CDir *dir, int type, int who, double amount) +void MDBalancer::hit_dir(utime_t now, CDir *dir, int type, int who, double amount) { // hit me double v = dir->pop_me.get(type).hit(now, amount); - + //if (dir->ino() == inodeno_t(0x10000000000)) //dout(0) << "hit_dir " << type << " pop " << v << " in " << *dir << dendl; @@ -991,8 +991,8 @@ void MDBalancer::hit_dir(utime_t now, CDir *dir, int type, int who, double amoun dout(1) << "hit_dir " << type << " pop is " << v << ", putting in merge_queue: " << *dir << dendl; merge_queue.insert(dir->dirfrag()); } - } - + } + // replicate? if (type == META_POP_IRD && who >= 0) { dir->pop_spread.hit(now, mds->mdcache->decayrate, who); @@ -1008,38 +1008,38 @@ void MDBalancer::hit_dir(utime_t now, CDir *dir, int type, int who, double amoun //if (dir->ino() == inodeno_t(0x10000000002)) if (pop_sp > 0) { - dout(20) << "hit_dir " << type << " pop " << dir_pop << " spread " << pop_sp + dout(20) << "hit_dir " << type << " pop " << dir_pop << " spread " << pop_sp << " " << dir->pop_spread.last[0] << " " << dir->pop_spread.last[1] << " " << dir->pop_spread.last[2] << " " << dir->pop_spread.last[3] << " in " << *dir << dendl; } - + if (dir->is_auth() && !dir->is_ambiguous_auth()) { if (!dir->is_rep() && dir_pop >= g_conf.mds_bal_replicate_threshold) { // replicate float rdp = dir->pop_me.get(META_POP_IRD).get(now, mds->mdcache->decayrate); - rd_adj = rdp / mds->get_mds_map()->get_num_mds() - rdp; + rd_adj = rdp / mds->get_mds_map()->get_num_mds() - rdp; rd_adj /= 2.0; // temper somewhat - + dout(0) << "replicating dir " << *dir << " pop " << dir_pop << " .. rdp " << rdp << " adj " << rd_adj << dendl; - + dir->dir_rep = CDir::REP_ALL; mds->mdcache->send_dir_updates(dir, true); - + // fixme this should adjust the whole pop hierarchy dir->pop_me.get(META_POP_IRD).adjust(rd_adj); dir->pop_auth_subtree.get(META_POP_IRD).adjust(rd_adj); } - + if (dir->ino() != 1 && dir->is_rep() && dir_pop < g_conf.mds_bal_unreplicate_threshold) { // unreplicate dout(0) << "unreplicating dir " << *dir << " pop " << dir_pop << dendl; - + dir->dir_rep = CDir::REP_NONE; mds->mdcache->send_dir_updates(dir); } @@ -1052,22 +1052,22 @@ void MDBalancer::hit_dir(utime_t now, CDir *dir, int type, int who, double amoun while (1) { dir->pop_nested.get(type).hit(now, amount); - if (rd_adj != 0.0) + if (rd_adj != 0.0) dir->pop_nested.get(META_POP_IRD).adjust(now, mds->mdcache->decayrate, rd_adj); - + if (hit_subtree) { dir->pop_auth_subtree.get(type).hit(now, amount); - if (rd_adj != 0.0) + if (rd_adj != 0.0) dir->pop_auth_subtree.get(META_POP_IRD).adjust(now, mds->mdcache->decayrate, rd_adj); } if (hit_subtree_nested) { dir->pop_auth_subtree_nested.get(type).hit(now, mds->mdcache->decayrate, amount); - if (rd_adj != 0.0) + if (rd_adj != 0.0) dir->pop_auth_subtree_nested.get(META_POP_IRD).adjust(now, mds->mdcache->decayrate, rd_adj); - } - - if (dir->is_subtree_root()) + } + + if (dir->is_subtree_root()) hit_subtree = false; // end of auth domain, stop hitting auth counters. if (dir->inode->get_parent_dn() == 0) break; @@ -1091,24 +1091,24 @@ void MDBalancer::subtract_export(CDir *dir, utime_t now) while (true) { dir = dir->inode->get_parent_dir(); if (!dir) break; - + dir->pop_nested.sub(now, mds->mdcache->decayrate, subload); dir->pop_auth_subtree_nested.sub(now, mds->mdcache->decayrate, subload); } } - + void MDBalancer::add_import(CDir *dir, utime_t now) { dirfrag_load_vec_t subload = dir->pop_auth_subtree; - + while (true) { dir = dir->inode->get_parent_dir(); if (!dir) break; - + dir->pop_nested.add(now, mds->mdcache->decayrate, subload); dir->pop_auth_subtree_nested.add(now, mds->mdcache->decayrate, subload); - } + } } @@ -1143,9 +1143,9 @@ void MDBalancer::dump_pop_map() while (!iq.empty()) { CInode *in = iq.front(); iq.pop_front(); - + // pop stats - /*for (int a=0; apopularity[a].pop[b].get(now) << "\t"; */ @@ -1169,19 +1169,19 @@ void MDBalancer::dump_pop_map() string p; in->make_path_string(p); myfile << "." << p; - if (dir->get_frag() != frag_t()) + if (dir->get_frag() != frag_t()) myfile << "___" << (unsigned)dir->get_frag(); myfile << std::endl; //"/" << dir->get_frag() << dendl; - + // add contents for (CDir::map_t::iterator q = dir->items.begin(); q != dir->items.end(); - q++) + q++) if (q->second->get_linkage()->is_primary()) iq.push_front(q->second->get_linkage()->get_inode()); } } - + } myfile.close(); @@ -1192,22 +1192,22 @@ void MDBalancer::dump_pop_map() /* replicate? float dir_pop = dir->get_popularity(); - + if (dir->is_auth()) { if (!dir->is_rep() && dir_pop >= g_conf.mds_bal_replicate_threshold) { // replicate dout(5) << "replicating dir " << *in << " pop " << dir_pop << dendl; - + dir->dir_rep = CDIR_REP_ALL; mds->mdcache->send_dir_updates(dir); } - + if (dir->is_rep() && dir_pop < g_conf.mds_bal_unreplicate_threshold) { // unreplicate dout(5) << "unreplicating dir " << *in << " pop " << dir_pop << dendl; - + dir->dir_rep = CDIR_REP_NONE; mds->mdcache->send_dir_updates(dir); } diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 6192744317a3c..b10a636c7f6f3 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -3839,7 +3839,7 @@ void MDCache::handle_cache_rejoin_ack(MMDSCacheRejoin *ack) } else if (!dnl->is_null() && q->second.is_null()) { - dout(-10) << " had bad linkage for " << *dn << dendl; + dout(0) << " had bad linkage for " << *dn << dendl; /* * this should happen: * if we're a survivor, any unlink should commit or rollback during @@ -7786,7 +7786,7 @@ void MDCache::handle_discover(MDiscover *dis) int from = dis->get_source().num(); if (mds->get_state() < MDSMap::STATE_REJOIN || rejoin_ack_gather.count(from)) { - dout(-7) << "discover_reply not yet active(|still rejoining), delaying" << dendl; + dout(0) << "discover_reply not yet active(|still rejoining), delaying" << dendl; mds->wait_for_active(new C_MDS_RetryMessage(mds, dis)); return; } @@ -8061,7 +8061,7 @@ void MDCache::handle_discover_reply(MDiscoverReply *m) { /* if (mds->get_state() < MDSMap::STATE_ACTIVE) { - dout(-7) << "discover_reply NOT ACTIVE YET" << dendl; + dout(0) << "discover_reply NOT ACTIVE YET" << dendl; m->put(); return; } diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index 8b17df46ab566..f438b1ac3aa98 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -521,7 +521,7 @@ void Migrator::maybe_do_queued_export() if (!dir) continue; if (!dir->is_auth()) continue; - dout(-7) << "nicely exporting to mds" << dest << " " << *dir << dendl; + dout(0) << "nicely exporting to mds" << dest << " " << *dir << dendl; export_dir(dir, dest); } diff --git a/src/mds/Server.cc b/src/mds/Server.cc index ec52ea2802702..a30c8edbd6554 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -5599,10 +5599,10 @@ void Server::do_rename_rollback(bufferlist &rbl, int master, MDRequest *mdr) _rollback_repair_dir(mut, straydir, rollback.stray, rollback.ctime, target->is_dir(), -1, true, ti->dirstat, ti->rstat); - dout(-10) << " srcdn back to " << *srcdn << dendl; - dout(-10) << " srci back to " << *srcdnl->get_inode() << dendl; - dout(-10) << " destdn back to " << *destdn << dendl; - if (destdnl->get_inode()) dout(-10) << " desti back to " << *destdnl->get_inode() << dendl; + dout(0) << " srcdn back to " << *srcdn << dendl; + dout(0) << " srci back to " << *srcdnl->get_inode() << dendl; + dout(0) << " destdn back to " << *destdn << dendl; + if (destdnl->get_inode()) dout(0) << " desti back to " << *destdnl->get_inode() << dendl; // new subtree? if (srcdnl->is_primary() && srcdnl->get_inode()->is_dir()) { diff --git a/src/mds/journal.cc b/src/mds/journal.cc index 62afa550e1edd..3cb188bd1c4ae 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -463,7 +463,7 @@ void EMetaBlob::replay(MDS *mds, LogSegment *logseg) ss << "EMetaBlob.replay FIXME had dentry linked to wrong inode " << *dn << " " << *old_in << " should be " << p->inode.ino; - dout(-10) << ss.str() << dendl; + dout(0) << ss.str() << dendl; mds->clog.warn(ss); dir->unlink_inode(dn); mds->mdcache->remove_inode_recursive(old_in); diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index c59104fa1f18e..4398551f60804 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -973,7 +973,7 @@ void MDSMonitor::do_stop() // hrm... if (!mon->is_leader() || !paxos->is_active()) { - dout(-10) << "do_stop can't stop right now, mdsmap not writeable" << dendl; + dout(0) << "do_stop can't stop right now, mdsmap not writeable" << dendl; return; } diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc index cc8916bb051e3..f85ded836b437 100644 --- a/src/msg/SimpleMessenger.cc +++ b/src/msg/SimpleMessenger.cc @@ -748,32 +748,32 @@ int SimpleMessenger::Pipe::accept() } if (existing->policy.lossy) { - dout(-10) << "accept replacing existing (lossy) channel (new one lossy=" - << policy.lossy << ")" << dendl; + dout(0) << "accept replacing existing (lossy) channel (new one lossy=" + << policy.lossy << ")" << dendl; existing->was_session_reset(); goto replace; } /*if (lossy_rx) { if (existing->state == STATE_STANDBY) { - dout(-10) << "accept incoming lossy connection, kicking outgoing lossless " + dout(0) << "accept incoming lossy connection, kicking outgoing lossless " << existing << dendl; existing->state = STATE_CONNECTING; existing->cond.Signal(); } else { - dout(-10) << "accept incoming lossy connection, our lossless " << existing + dout(0) << "accept incoming lossy connection, our lossless " << existing << " has state " << existing->state << ", doing nothing" << dendl; } existing->lock.Unlock(); goto fail; }*/ - dout(-10) << "accept connect_seq " << connect.connect_seq + dout(0) << "accept connect_seq " << connect.connect_seq << " vs existing " << existing->connect_seq << " state " << existing->state << dendl; if (connect.connect_seq < existing->connect_seq) { if (connect.connect_seq == 0) { - dout(-10) << "accept peer reset, then tried to connect to us, replacing" << dendl; + dout(0) << "accept peer reset, then tried to connect to us, replacing" << dendl; existing->was_session_reset(); // this resets out_queue, msg_ and connect_seq #'s goto replace; } else { @@ -994,7 +994,7 @@ int SimpleMessenger::Pipe::connect() sd = ::socket(peer_addr.get_family(), SOCK_STREAM, 0); if (sd < 0) { char buf[80]; - dout(-1) << "connect couldn't created socket " << strerror_r(errno, buf, sizeof(buf)) << dendl; + derr << "connect couldn't created socket " << strerror_r(errno, buf, sizeof(buf)) << dendl; assert(0); goto fail; } @@ -1582,9 +1582,9 @@ void SimpleMessenger::Pipe::reader() // occasionally pull a message out of the sent queue to send elsewhere. in that case // it doesn't matter if we "got" it or not. if (m->get_seq() <= in_seq) { - dout(-10) << "reader got old message " - << m->get_seq() << " <= " << in_seq << " " << m << " " << *m - << ", discarding" << dendl; + dout(0) << "reader got old message " + << m->get_seq() << " <= " << in_seq << " " << m << " " << *m + << ", discarding" << dendl; messenger->dispatch_throttle_release(m->get_dispatch_throttle_size()); m->put(); continue; diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index c48fc9e10b43e..6aae9703daec7 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -5003,7 +5003,7 @@ void OSD::handle_op(MOSDOp *op) if (!op->may_write()) { stat_rd_ops++; if (op->get_source().is_osd()) { - //dout(-10) << "shed in " << stat_rd_ops_shed_in << " / " << stat_rd_ops << dendl; + //dout(0) << "shed in " << stat_rd_ops_shed_in << " / " << stat_rd_ops << dendl; stat_rd_ops_shed_in++; } } diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 966c1a60c4e7b..d0a6e09a621e4 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -2190,7 +2190,7 @@ void ReplicatedPG::apply_repop(RepGather *repop) repop->ctx->clone_obc); int r = osd->store->queue_transactions(&osr, repop->tls, onapplied, oncommit, onapplied_sync); if (r) { - dout(-10) << "apply_repop queue_transactions returned " << r << " on " << *repop << dendl; + derr << "apply_repop queue_transactions returned " << r << " on " << *repop << dendl; assert(0); } } @@ -2245,7 +2245,7 @@ void ReplicatedPG::op_applied(RepGather *repop) switch (first.op.op) { case CEPH_OSD_OP_UNBALANCEREADS: - dout(-10) << "op_applied completed unbalance-reads on " << oid << dendl; + dout(0) << "op_applied completed unbalance-reads on " << oid << dendl; unbalancing_reads.erase(oid); if (waiting_for_unbalanced_reads.count(oid)) { osd->take_waiters(waiting_for_unbalanced_reads[oid]); @@ -2254,7 +2254,7 @@ void ReplicatedPG::op_applied(RepGather *repop) break; case CEPH_OSD_OP_BALANCEREADS: - dout(-10) << "op_applied completed balance-reads on " << oid << dendl; + dout(0) << "op_applied completed balance-reads on " << oid << dendl; /* if (waiting_for_balanced_reads.count(oid)) { osd->take_waiters(waiting_for_balanced_reads[oid]); @@ -2264,7 +2264,7 @@ void ReplicatedPG::op_applied(RepGather *repop) break; case CEPH_OSD_OP_WRUNLOCK: - dout(-10) << "op_applied completed wrunlock on " << soid << dendl; + dout(0) << "op_applied completed wrunlock on " << soid << dendl; if (waiting_for_wr_unlock.count(soid)) { osd->take_waiters(waiting_for_wr_unlock[soid]); waiting_for_wr_unlock.erase(soid); -- 2.39.5