From af7614d848aba2565a62fa9ba4428c80e95f224d Mon Sep 17 00:00:00 2001 From: sageweil Date: Wed, 21 Mar 2007 22:46:25 +0000 Subject: [PATCH] * per-line locking on osd debug output (dstartl and dendl) git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1281 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/config.cc | 1 + trunk/ceph/config.h | 34 +++++ trunk/ceph/osd/OSD.cc | 330 +++++++++++++++++++++--------------------- trunk/ceph/osd/PG.cc | 206 +++++++++++++------------- 4 files changed, 303 insertions(+), 268 deletions(-) diff --git a/trunk/ceph/config.cc b/trunk/ceph/config.cc index 516a0e1c1ce29..dab88f47ea8ae 100644 --- a/trunk/ceph/config.cc +++ b/trunk/ceph/config.cc @@ -31,6 +31,7 @@ long buffer_total_alloc = 0; Mutex bufferlock; +Mutex _dout_lock; FileLayout g_OSD_FileLayout( 1<<20, 1, 1<<20, 2 ); // stripe over 1M objects, 2x replication diff --git a/trunk/ceph/config.h b/trunk/ceph/config.h index 3e59b09249d33..897258135ff06 100644 --- a/trunk/ceph/config.h +++ b/trunk/ceph/config.h @@ -21,6 +21,8 @@ extern class FileLayout g_OSD_MDLogLayout; #include #include +#include "common/Mutex.h" + extern std::map g_fake_osd_down; extern std::map g_fake_osd_out; @@ -308,9 +310,41 @@ struct md_config_t { extern md_config_t g_conf; extern md_config_t g_debug_after_conf; + +/** + * debug output framework + */ #define dout(x) if ((x) <= g_conf.debug) std::cout #define dout2(x) if ((x) <= g_conf.debug) std::cout +/** + * for cleaner output, bracket each line with + * dbeginl (in the dout macro) and dendl (in place of endl). + */ +extern Mutex _dout_lock; +struct _dbeginl_t { + _dbeginl_t(int) {} +}; +struct _dendl_t { + _dendl_t(int) {} +}; +static const _dbeginl_t dbeginl = 0; +static const _dendl_t dendl = 0; + +inline ostream& operator<<(ostream& out, _dbeginl_t) { + _dout_lock.Lock(); + return out; +} +inline ostream& operator<<(ostream& out, _dendl_t) { + out << endl; + _dout_lock.Unlock(); + return out; +} + + +/** + * command line / environment argument parsing + */ void env_to_vec(std::vector& args); void argv_to_vec(int argc, char **argv, std::vector& args); diff --git a/trunk/ceph/osd/OSD.cc b/trunk/ceph/osd/OSD.cc index 058692fab3fc0..d2355cb4d32ff 100644 --- a/trunk/ceph/osd/OSD.cc +++ b/trunk/ceph/osd/OSD.cc @@ -67,8 +67,8 @@ #include "config.h" #undef dout -#define dout(l) if (l<=g_conf.debug || l<=g_conf.debug_osd) cout << g_clock.now() << " osd" << whoami << " " << (osdmap ? osdmap->get_epoch():0) << " " -#define derr(l) if (l<=g_conf.debug || l<=g_conf.debug_osd) cerr << g_clock.now() << " osd" << whoami << " " << (osdmap ? osdmap->get_epoch():0) << " " +#define dout(l) if (l<=g_conf.debug || l<=g_conf.debug_osd) cout << dbeginl << g_clock.now() << " osd" << whoami << " " << (osdmap ? osdmap->get_epoch():0) << " " +#define derr(l) if (l<=g_conf.debug || l<=g_conf.debug_osd) cerr << dbeginl << g_clock.now() << " osd" << whoami << " " << (osdmap ? osdmap->get_epoch():0) << " " char *osd_base_path = "./osddata"; char *ebofs_base_path = "./dev"; @@ -89,14 +89,14 @@ public: void OSD::force_remount() { - dout(0) << "forcing remount" << endl; + dout(0) << "forcing remount" << dendl; osd_lock.Lock(); { store->umount(); store->mount(); } osd_lock.Unlock(); - dout(0) << "finished remount" << endl; + dout(0) << "finished remount" << dendl; } // @@ -189,7 +189,7 @@ int OSD::init() { // mkfs? if (g_conf.osd_mkfs) { - dout(2) << "mkfs" << endl; + dout(2) << "mkfs" << dendl; store->mkfs(); // make up a superblock @@ -198,14 +198,14 @@ int OSD::init() } // mount. - dout(2) << "mounting " << dev_path << endl; + dout(2) << "mounting " << dev_path << dendl; int r = store->mount(); assert(r>=0); if (g_conf.osd_mkfs) { // age? if (g_conf.osd_age_time != 0) { - dout(2) << "age" << endl; + dout(2) << "age" << dendl; Ager ager(store); if (g_conf.osd_age_time < 0) ager.load_freelist(); @@ -218,7 +218,7 @@ int OSD::init() } } else { - dout(2) << "boot" << endl; + dout(2) << "boot" << dendl; // read superblock read_superblock(); @@ -226,7 +226,7 @@ int OSD::init() // load up pgs (as they previously existed) load_pgs(); - dout(2) << "superblock: i am osd" << superblock.whoami << endl; + dout(2) << "superblock: i am osd" << superblock.whoami << dendl; assert(whoami == superblock.whoami); } @@ -281,14 +281,14 @@ int OSD::init() } osd_lock.Unlock(); - //dout(0) << "osd_rep " << g_conf.osd_rep << endl; + //dout(0) << "osd_rep " << g_conf.osd_rep << dendl; return 0; } int OSD::shutdown() { - dout(1) << "shutdown" << endl; + dout(1) << "shutdown" << dendl; state = STATE_STOPPING; @@ -325,7 +325,7 @@ int OSD::shutdown() void OSD::write_superblock(ObjectStore::Transaction& t) { - dout(10) << "write_superblock " << superblock << endl; + dout(10) << "write_superblock " << superblock << dendl; bufferlist bl; bl.append((char*)&superblock, sizeof(superblock)); @@ -337,13 +337,13 @@ int OSD::read_superblock() bufferlist bl; int r = store->read(SUPERBLOCK_OBJECT, 0, sizeof(superblock), bl); if (bl.length() != sizeof(superblock)) { - dout(10) << "read_superblock failed, r = " << r << ", i got " << bl.length() << " bytes, not " << sizeof(superblock) << endl; + dout(10) << "read_superblock failed, r = " << r << ", i got " << bl.length() << " bytes, not " << sizeof(superblock) << dendl; return -1; } bl.copy(0, sizeof(superblock), (char*)&superblock); - dout(10) << "read_superblock " << superblock << endl; + dout(10) << "read_superblock " << superblock << dendl; // load up "current" osdmap assert(!osdmap); @@ -373,8 +373,8 @@ PG *OSD::_lock_pg(pg_t pgid) if (pg_lock.count(pgid)) { Cond c; - dout(15) << "lock_pg " << pgid << " waiting as " << &c << endl; - //cerr << "lock_pg " << pgid << " waiting as " << &c << endl; + dout(15) << "lock_pg " << pgid << " waiting as " << &c << dendl; + //cerr << "lock_pg " << pgid << " waiting as " << &c << dendl; list& ls = pg_lock_waiters[pgid]; // this is commit, right? ls.push_back(&c); @@ -389,7 +389,7 @@ PG *OSD::_lock_pg(pg_t pgid) pg_lock_waiters.erase(pgid); } - dout(15) << "lock_pg " << pgid << endl; + dout(15) << "lock_pg " << pgid << dendl; pg_lock.insert(pgid); return pg_map[pgid]; @@ -412,17 +412,17 @@ void OSD::_unlock_pg(pg_t pgid) // someone is in line Cond *c = pg_lock_waiters[pgid].front(); assert(c); - dout(15) << "unlock_pg " << pgid << " waking up next guy " << c << endl; + dout(15) << "unlock_pg " << pgid << " waking up next guy " << c << dendl; c->Signal(); } else { // nobody waiting - dout(15) << "unlock_pg " << pgid << endl; + dout(15) << "unlock_pg " << pgid << dendl; } } void OSD::_remove_pg(pg_t pgid) { - dout(10) << "_remove_pg " << pgid << endl; + dout(10) << "_remove_pg " << pgid << dendl; // remove from store list olist; @@ -496,7 +496,7 @@ void OSD::heartbeat() dout(5) << "heartbeat " << now << ": ops " << hb_stat_ops << ", avg qlen " << avg_qlen - << endl; + << dendl; // reset until next time around hb_stat_ops = 0; @@ -566,7 +566,7 @@ bool OSD::_share_map_incoming(const entity_inst_t& inst, epoch_t epoch) // does client have old map? if (inst.name.is_client()) { if (epoch < osdmap->get_epoch()) { - dout(10) << inst.name << " has old map " << epoch << " < " << osdmap->get_epoch() << endl; + dout(10) << inst.name << " has old map " << epoch << " < " << osdmap->get_epoch() << dendl; send_incremental_map(epoch, inst, true); shared = true; } @@ -580,7 +580,7 @@ bool OSD::_share_map_incoming(const entity_inst_t& inst, epoch_t epoch) // older? if (peer_map_epoch[inst.name] < osdmap->get_epoch()) { - dout(10) << inst.name << " has old map " << epoch << " < " << osdmap->get_epoch() << endl; + dout(10) << inst.name << " has old map " << epoch << " < " << osdmap->get_epoch() << dendl; send_incremental_map(epoch, inst, true); peer_map_epoch[inst.name] = osdmap->get_epoch(); // so we don't send it again. shared = true; @@ -622,7 +622,7 @@ void OSD::dispatch(Message *m) // -- don't need lock -- case MSG_PING: - dout(10) << "ping from " << m->get_source() << endl; + dout(10) << "ping from " << m->get_source() << dendl; delete m; break; @@ -655,14 +655,14 @@ void OSD::dispatch(Message *m) { // no map? starting up? if (!osdmap) { - dout(7) << "no OSDMap, not booted" << endl; + dout(7) << "no OSDMap, not booted" << dendl; waiting_for_osdmap.push_back(m); break; } // down? if (osdmap->is_down(whoami)) { - dout(7) << "i am marked down, dropping " << *m << endl; + dout(7) << "i am marked down, dropping " << *m << dendl; delete m; break; } @@ -702,7 +702,7 @@ void OSD::dispatch(Message *m) default: - dout(1) << " got unknown message " << m->get_type() << endl; + dout(1) << " got unknown message " << m->get_type() << dendl; assert(0); } } @@ -732,7 +732,7 @@ void OSD::ms_handle_failure(Message *m, const entity_inst_t& inst) entity_name_t dest = inst.name; if (g_conf.ms_die_on_failure) { - dout(0) << "ms_handle_failure " << inst << " on " << *m << endl; + dout(0) << "ms_handle_failure " << inst << " on " << *m << dendl; exit(0); } @@ -742,7 +742,7 @@ void OSD::ms_handle_failure(Message *m, const entity_inst_t& inst) dout(0) << "ms_handle_failure " << inst << ", dropping and reporting to mon" << mon << " " << *m - << endl; + << dendl; messenger->send_message(new MOSDFailure(inst, osdmap->get_epoch()), monmap->get_inst(mon)); delete m; @@ -752,13 +752,13 @@ void OSD::ms_handle_failure(Message *m, const entity_inst_t& inst) dout(0) << "ms_handle_failure " << inst << ", resending to mon" << mon << " " << *m - << endl; + << dendl; messenger->send_message(m, monmap->get_inst(mon)); } else { // client? dout(0) << "ms_handle_failure " << inst - << ", dropping " << *m << endl; + << ", dropping " << *m << dendl; delete m; } } @@ -768,7 +768,7 @@ void OSD::ms_handle_failure(Message *m, const entity_inst_t& inst) void OSD::handle_osd_ping(MOSDPing *m) { - dout(20) << "osdping from " << m->get_source() << endl; + dout(20) << "osdping from " << m->get_source() << dendl; _share_map_incoming(m->get_source_inst(), ((MOSDPing*)m)->map_epoch); int from = m->get_source().num(); @@ -815,12 +815,12 @@ void OSD::handle_osd_map(MOSDMap *m) dout(3) << "handle_osd_map epochs [" << m->get_first() << "," << m->get_last() << "], i have " << osdmap->get_epoch() - << endl; + << dendl; } else { dout(3) << "handle_osd_map epochs [" << m->get_first() << "," << m->get_last() << "], i have none" - << endl; + << dendl; osdmap = new OSDMap; boot_epoch = m->get_last(); // hrm...? } @@ -833,15 +833,15 @@ void OSD::handle_osd_map(MOSDMap *m) p++) { object_t oid = get_osdmap_object_name(p->first); if (store->exists(oid)) { - dout(10) << "handle_osd_map already had full map epoch " << p->first << endl; + dout(10) << "handle_osd_map already had full map epoch " << p->first << dendl; logger->inc("mapfdup"); bufferlist bl; get_map_bl(p->first, bl); - dout(10) << " .. it is " << bl.length() << " bytes" << endl; + dout(10) << " .. it is " << bl.length() << " bytes" << dendl; continue; } - dout(10) << "handle_osd_map got full map epoch " << p->first << endl; + dout(10) << "handle_osd_map got full map epoch " << p->first << dendl; //t.write(oid, 0, p->second.length(), p->second); store->write(oid, 0, p->second.length(), p->second, 0); @@ -858,15 +858,15 @@ void OSD::handle_osd_map(MOSDMap *m) p++) { object_t oid = get_inc_osdmap_object_name(p->first); if (store->exists(oid)) { - dout(10) << "handle_osd_map already had incremental map epoch " << p->first << endl; + dout(10) << "handle_osd_map already had incremental map epoch " << p->first << dendl; logger->inc("mapidup"); bufferlist bl; get_inc_map_bl(p->first, bl); - dout(10) << " .. it is " << bl.length() << " bytes" << endl; + dout(10) << " .. it is " << bl.length() << " bytes" << dendl; continue; } - dout(10) << "handle_osd_map got incremental map epoch " << p->first << endl; + dout(10) << "handle_osd_map got incremental map epoch " << p->first << dendl; //t.write(oid, 0, p->second.length(), p->second); store->write(oid, 0, p->second.length(), p->second, 0); @@ -890,7 +890,7 @@ void OSD::handle_osd_map(MOSDMap *m) bufferlist bl; if (m->incremental_maps.count(cur+1) || store->exists(get_inc_osdmap_object_name(cur+1))) { - dout(10) << "handle_osd_map decoding inc map epoch " << cur+1 << endl; + dout(10) << "handle_osd_map decoding inc map epoch " << cur+1 << dendl; bufferlist bl; if (m->incremental_maps.count(cur+1)) @@ -930,7 +930,7 @@ void OSD::handle_osd_map(MOSDMap *m) for (map::iterator p = pg->repop_gather.begin(); p != pg->repop_gather.end(); p++) { - //dout(-1) << "checking repop tid " << p->first << endl; + //dout(-1) << "checking repop tid " << p->first << dendl; if (p->second->waitfor_ack.count(osd) || p->second->waitfor_commit.count(osd)) ls.push_back(p->second); @@ -952,7 +952,7 @@ void OSD::handle_osd_map(MOSDMap *m) } else if (m->maps.count(cur+1) || store->exists(get_osdmap_object_name(cur+1))) { - dout(10) << "handle_osd_map decoding full map epoch " << cur+1 << endl; + dout(10) << "handle_osd_map decoding full map epoch " << cur+1 << dendl; bufferlist bl; if (m->maps.count(cur+1)) bl = m->maps[cur+1]; @@ -963,7 +963,7 @@ void OSD::handle_osd_map(MOSDMap *m) // FIXME BUG: need to notify messenger of ups/downs!! } else { - dout(10) << "handle_osd_map missing epoch " << cur+1 << endl; + dout(10) << "handle_osd_map missing epoch " << cur+1 << dendl; int mon = monmap->pick_mon(); messenger->send_message(new MOSDGetMap(cur), monmap->get_inst(mon)); break; @@ -1011,15 +1011,15 @@ void OSD::advance_map(ObjectStore::Transaction& t) { dout(7) << "advance_map epoch " << osdmap->get_epoch() << " " << pg_map.size() << " pgs" - << endl; + << dendl; if (osdmap->is_mkfs()) { ps_t maxps = 1ULL << osdmap->get_pg_bits(); ps_t maxlps = 1ULL << osdmap->get_localized_pg_bits(); - dout(1) << "mkfs on " << osdmap->get_pg_bits() << " bits, " << maxps << " pgs" << endl; + dout(1) << "mkfs on " << osdmap->get_pg_bits() << " bits, " << maxps << " pgs" << dendl; assert(osdmap->get_epoch() == 1); - //cerr << "osdmap " << osdmap->get_ctime() << " logger start " << logger->get_start() << endl; + //cerr << "osdmap " << osdmap->get_ctime() << " logger start " << logger->get_start() << dendl; logger->set_start( osdmap->get_ctime() ); assert(g_conf.osd_mkfs); // make sure we did a mkfs! @@ -1045,7 +1045,7 @@ void OSD::advance_map(ObjectStore::Transaction& t) pg->info.history.same_acker_since = osdmap->get_epoch(); pg->activate(t); - dout(7) << "created " << *pg << endl; + dout(7) << "created " << *pg << dendl; } for (ps_t ps = 0; ps < maxlps; ++ps) { @@ -1065,11 +1065,11 @@ void OSD::advance_map(ObjectStore::Transaction& t) pg->info.history.same_since = osdmap->get_epoch(); pg->activate(t); - dout(7) << "created " << *pg << endl; + dout(7) << "created " << *pg << dendl; } } - dout(1) << "mkfs done, created " << pg_map.size() << " pgs" << endl; + dout(1) << "mkfs done, created " << pg_map.size() << " pgs" << dendl; } else { // scan existing pg's @@ -1181,13 +1181,13 @@ void OSD::advance_map(ObjectStore::Transaction& t) if (nrep == 0) { pg->state_set(PG::STATE_CRASHED); - dout(1) << *pg << " is crashed" << endl; + dout(1) << *pg << " is crashed" << dendl; } } // my role changed. dout(10) << *pg << " " << oldacting << " -> " << pg->acting - << ", role " << oldrole << " -> " << role << endl; + << ", role " << oldrole << " -> " << role << dendl; } else { // no role change. @@ -1199,7 +1199,7 @@ void OSD::advance_map(ObjectStore::Transaction& t) dout(10) << *pg << " " << oldacting << " -> " << pg->acting << ", acting primary " << oldprimary << " -> " << pg->get_primary() - << endl; + << dendl; } else { // primary is the same. if (role == 0) { @@ -1208,7 +1208,7 @@ void OSD::advance_map(ObjectStore::Transaction& t) pg->state_clear(PG::STATE_REPLAY); dout(10) << *pg << " " << oldacting << " -> " << pg->acting - << ", replicas changed" << endl; + << ", replicas changed" << dendl; } } } @@ -1221,7 +1221,7 @@ void OSD::advance_map(ObjectStore::Transaction& t) void OSD::activate_map(ObjectStore::Transaction& t) { - dout(7) << "activate_map version " << osdmap->get_epoch() << endl; + dout(7) << "activate_map version " << osdmap->get_epoch() << dendl; map< int, list > notify_list; // primary -> list map< int, map > query_map; // peer -> PG -> get_summary_since @@ -1266,7 +1266,7 @@ void OSD::activate_map(ObjectStore::Transaction& t) void OSD::send_incremental_map(epoch_t since, const entity_inst_t& inst, bool full) { dout(10) << "send_incremental_map " << since << " -> " << osdmap->get_epoch() - << " to " << inst << endl; + << " to " << inst << dendl; MOSDMap *m = new MOSDMap; @@ -1306,7 +1306,7 @@ void OSD::get_map(epoch_t epoch, OSDMap &m) for (e = epoch; e > 0; e--) { bufferlist bl; if (get_map_bl(e, bl)) { - //dout(10) << "get_map " << epoch << " full " << e << endl; + //dout(10) << "get_map " << epoch << " full " << e << dendl; m.decode(bl); break; } else { @@ -1320,7 +1320,7 @@ void OSD::get_map(epoch_t epoch, OSDMap &m) // apply incrementals for (e++; e <= epoch; e++) { - //dout(10) << "get_map " << epoch << " inc " << e << endl; + //dout(10) << "get_map " << epoch << " inc " << e << dendl; m.apply_incremental( incs.front() ); incs.pop_front(); } @@ -1345,14 +1345,14 @@ bool OSD::require_current_map(Message *m, epoch_t ep) { // older map? if (ep < osdmap->get_epoch()) { - dout(7) << "require_current_map epoch " << ep << " < " << osdmap->get_epoch() << endl; + dout(7) << "require_current_map epoch " << ep << " < " << osdmap->get_epoch() << dendl; delete m; // discard and ignore. return false; } // newer map? if (ep > osdmap->get_epoch()) { - dout(7) << "require_current_map epoch " << ep << " > " << osdmap->get_epoch() << endl; + dout(7) << "require_current_map epoch " << ep << " > " << osdmap->get_epoch() << dendl; wait_for_new_map(m); return false; } @@ -1368,17 +1368,17 @@ bool OSD::require_current_map(Message *m, epoch_t ep) */ bool OSD::require_same_or_newer_map(Message *m, epoch_t epoch) { - dout(10) << "require_same_or_newer_map " << epoch << " (i am " << osdmap->get_epoch() << ")" << endl; + dout(10) << "require_same_or_newer_map " << epoch << " (i am " << osdmap->get_epoch() << ")" << dendl; // newer map? if (epoch > osdmap->get_epoch()) { - dout(7) << " from newer map epoch " << epoch << " > " << osdmap->get_epoch() << endl; + dout(7) << " from newer map epoch " << epoch << " > " << osdmap->get_epoch() << dendl; wait_for_new_map(m); return false; } if (epoch < boot_epoch) { - dout(7) << " from pre-boot epoch " << epoch << " < " << boot_epoch << endl; + dout(7) << " from pre-boot epoch " << epoch << " < " << boot_epoch << dendl; delete m; return false; } @@ -1402,7 +1402,7 @@ bool OSD::pg_exists(pg_t pgid) PG *OSD::create_pg(pg_t pgid, ObjectStore::Transaction& t) { if (pg_map.count(pgid)) { - dout(0) << "create_pg on " << pgid << ", already have " << *pg_map[pgid] << endl; + dout(0) << "create_pg on " << pgid << ", already have " << *pg_map[pgid] << dendl; } assert(pg_map.count(pgid) == 0); assert(!pg_exists(pgid)); @@ -1427,7 +1427,7 @@ PG *OSD::get_pg(pg_t pgid) void OSD::load_pgs() { - dout(10) << "load_pgs" << endl; + dout(10) << "load_pgs" << dendl; assert(pg_map.empty()); list ls; @@ -1452,7 +1452,7 @@ void OSD::load_pgs() int role = osdmap->calc_pg_role(whoami, pg->acting, nrep); pg->set_role(role); - dout(10) << "load_pgs loaded " << *pg << " " << pg->log << endl; + dout(10) << "load_pgs loaded " << *pg << " " << pg->log << dendl; } } @@ -1465,7 +1465,7 @@ void OSD::project_pg_history(pg_t pgid, PG::Info::History& h, epoch_t from) dout(15) << "project_pg_history " << pgid << " from " << from << " to " << osdmap->get_epoch() << ", start " << h - << endl; + << dendl; vector last; osdmap->pg_to_acting_osds(pgid, last); @@ -1484,14 +1484,14 @@ void OSD::project_pg_history(pg_t pgid, PG::Info::History& h, epoch_t from) if (acting != last && e <= h.same_since) { dout(15) << "project_pg_history " << pgid << " changed in " << e+1 - << " from " << acting << " -> " << last << endl; + << " from " << acting << " -> " << last << dendl; h.same_since = e+1; } // primary change? if (!(!acting.empty() && !last.empty() && acting[0] == last[0]) && e <= h.same_primary_since) { - dout(15) << "project_pg_history " << pgid << " primary changed in " << e+1 << endl; + dout(15) << "project_pg_history " << pgid << " primary changed in " << e+1 << dendl; h.same_primary_since = e+1; if (g_conf.osd_rep == OSD_REP_PRIMARY) @@ -1502,7 +1502,7 @@ void OSD::project_pg_history(pg_t pgid, PG::Info::History& h, epoch_t from) if (g_conf.osd_rep != OSD_REP_PRIMARY) { if (!(!acting.empty() && !last.empty() && acting[acting.size()-1] == last[last.size()-1]) && e <= h.same_acker_since) { - dout(15) << "project_pg_history " << pgid << " acker changed in " << e+1 << endl; + dout(15) << "project_pg_history " << pgid << " acker changed in " << e+1 << dendl; h.same_acker_since = e+1; } } @@ -1512,7 +1512,7 @@ void OSD::project_pg_history(pg_t pgid, PG::Info::History& h, epoch_t from) h.same_acker_since > e) break; } - dout(15) << "project_pg_history end " << h << endl; + dout(15) << "project_pg_history end " << h << dendl; } @@ -1527,10 +1527,10 @@ void OSD::do_notifies(map< int, list >& notify_list) it != notify_list.end(); it++) { if (it->first == whoami) { - dout(7) << "do_notify osd" << it->first << " is self, skipping" << endl; + dout(7) << "do_notify osd" << it->first << " is self, skipping" << dendl; continue; } - dout(7) << "do_notify osd" << it->first << " on " << it->second.size() << " PGs" << endl; + dout(7) << "do_notify osd" << it->first << " on " << it->second.size() << " PGs" << dendl; MOSDPGNotify *m = new MOSDPGNotify(osdmap->get_epoch(), it->second); _share_map_outgoing(osdmap->get_inst(it->first)); messenger->send_message(m, osdmap->get_inst(it->first)); @@ -1548,7 +1548,7 @@ void OSD::do_queries(map< int, map >& query_map) pit++) { int who = pit->first; dout(7) << "do_queries querying osd" << who - << " on " << pit->second.size() << " PGs" << endl; + << " on " << pit->second.size() << " PGs" << dendl; MOSDPGQuery *m = new MOSDPGQuery(osdmap->get_epoch(), pit->second); @@ -1567,7 +1567,7 @@ void OSD::do_queries(map< int, map >& query_map) */ void OSD::handle_pg_notify(MOSDPGNotify *m) { - dout(7) << "handle_pg_notify from " << m->get_source() << endl; + dout(7) << "handle_pg_notify from " << m->get_source() << dendl; int from = m->get_source().num(); if (!require_same_or_newer_map(m, m->get_epoch())) return; @@ -1590,7 +1590,7 @@ void OSD::handle_pg_notify(MOSDPGNotify *m) if (m->get_epoch() < history.same_primary_since) { dout(10) << "handle_pg_notify pg " << pgid << " dne, and primary changed in " - << history.same_primary_since << " (msg from " << m->get_epoch() << ")" << endl; + << history.same_primary_since << " (msg from " << m->get_epoch() << ")" << dendl; continue; } @@ -1605,7 +1605,7 @@ void OSD::handle_pg_notify(MOSDPGNotify *m) t.collection_setattr(pgid, "info", (char*)&pg->info, sizeof(pg->info)); - dout(10) << *pg << " is new" << endl; + dout(10) << *pg << " is new" << dendl; // kick any waiters if (waiting_for_pg.count(pgid)) { @@ -1620,7 +1620,7 @@ void OSD::handle_pg_notify(MOSDPGNotify *m) if (m->get_epoch() < pg->info.history.same_primary_since) { dout(10) << *pg << " handle_pg_notify primary changed in " << pg->info.history.same_primary_since - << " (msg from " << m->get_epoch() << ")" << endl; + << " (msg from " << m->get_epoch() << ")" << dendl; _unlock_pg(pgid); continue; } @@ -1631,7 +1631,7 @@ void OSD::handle_pg_notify(MOSDPGNotify *m) // stray? bool acting = pg->is_acting(from); if (!acting && (*it).last_epoch_started > 0) { - dout(10) << *pg << " osd" << from << " has stray content: " << *it << endl; + dout(10) << *pg << " osd" << from << " has stray content: " << *it << dendl; pg->stray_set.insert(from); pg->state_clear(PG::STATE_CLEAN); } @@ -1645,15 +1645,15 @@ void OSD::handle_pg_notify(MOSDPGNotify *m) (*it).is_clean() && acting) { pg->clean_set.insert(from); dout(10) << *pg << " osd" << from << " now clean (" << pg->clean_set - << "): " << *it << endl; + << "): " << *it << dendl; if (pg->is_all_clean()) { - dout(-10) << *pg << " now clean on all replicas" << endl; + dout(-10) << *pg << " now clean on all replicas" << dendl; pg->state_set(PG::STATE_CLEAN); pg->clean_replicas(); } } else { // hmm, maybe keep an eye out for cases where we see this, but peer should happen. - dout(10) << *pg << " already had notify info from osd" << from << ": " << *it << endl; + dout(10) << *pg << " already had notify info from osd" << from << ": " << *it << dendl; } } else { // adjust prior? @@ -1692,7 +1692,7 @@ void OSD::handle_pg_log(MOSDPGLog *m) if (!require_same_or_newer_map(m, m->get_epoch())) return; if (pg_map.count(pgid) == 0) { - dout(10) << "handle_pg_log don't have pg " << pgid << ", dropping" << endl; + dout(10) << "handle_pg_log don't have pg " << pgid << ", dropping" << dendl; assert(m->get_epoch() < osdmap->get_epoch()); delete m; return; @@ -1705,14 +1705,14 @@ void OSD::handle_pg_log(MOSDPGLog *m) dout(10) << "handle_pg_log " << *pg << " from " << m->get_source() << " is old, discarding" - << endl; + << dendl; delete m; return; } dout(7) << "handle_pg_log " << *pg << " got " << m->log << " " << m->missing - << " from " << m->get_source() << endl; + << " from " << m->get_source() << dendl; //m->log.print(cout); @@ -1732,7 +1732,7 @@ void OSD::handle_pg_log(MOSDPGLog *m) } else { // i am REPLICA - dout(10) << *pg << " got " << m->log << " " << m->missing << endl; + dout(10) << *pg << " got " << m->log << " " << m->missing << dendl; // merge log pg->merge_log(m->log, m->missing, from); @@ -1758,7 +1758,7 @@ void OSD::handle_pg_log(MOSDPGLog *m) */ void OSD::handle_pg_query(MOSDPGQuery *m) { - dout(7) << "handle_pg_query from " << m->get_source() << " epoch " << m->get_epoch() << endl; + dout(7) << "handle_pg_query from " << m->get_source() << " epoch " << m->get_epoch() << dendl; int from = m->get_source().num(); if (!require_same_or_newer_map(m, m->get_epoch())) return; @@ -1778,7 +1778,7 @@ void OSD::handle_pg_query(MOSDPGQuery *m) if (m->get_epoch() < history.same_since) { dout(10) << " pg " << pgid << " dne, and pg has changed in " - << history.same_primary_since << " (msg from " << m->get_epoch() << ")" << endl; + << history.same_primary_since << " (msg from " << m->get_epoch() << ")" << dendl; continue; } @@ -1788,7 +1788,7 @@ void OSD::handle_pg_query(MOSDPGQuery *m) int role = osdmap->calc_pg_role(whoami, acting, nrep); if (role < 0) { - dout(10) << " pg " << pgid << " dne, and i am not an active replica" << endl; + dout(10) << " pg " << pgid << " dne, and i am not an active replica" << dendl; PG::Info empty(pgid); notify_list[from].push_back(empty); continue; @@ -1804,7 +1804,7 @@ void OSD::handle_pg_query(MOSDPGQuery *m) t.collection_setattr(pgid, "info", (char*)&pg->info, sizeof(pg->info)); store->apply_transaction(t); - dout(10) << *pg << " dne (before), but i am role " << role << endl; + dout(10) << *pg << " dne (before), but i am role " << role << dendl; _lock_pg(pgid); } else { pg = _lock_pg(pgid); @@ -1813,7 +1813,7 @@ void OSD::handle_pg_query(MOSDPGQuery *m) if (m->get_epoch() < pg->info.history.same_since) { dout(10) << *pg << " handle_pg_query primary changed in " << pg->info.history.same_since - << " (msg from " << m->get_epoch() << ")" << endl; + << " (msg from " << m->get_epoch() << ")" << dendl; _unlock_pg(pgid); continue; } @@ -1825,7 +1825,7 @@ void OSD::handle_pg_query(MOSDPGQuery *m) if (it->second.type == PG::Query::INFO) { // info - dout(10) << *pg << " sending info" << endl; + dout(10) << *pg << " sending info" << dendl; notify_list[from].push_back(pg->info); } else { MOSDPGLog *m = new MOSDPGLog(osdmap->get_epoch(), pg->get_pgid()); @@ -1835,15 +1835,15 @@ void OSD::handle_pg_query(MOSDPGQuery *m) if (it->second.type == PG::Query::LOG) { dout(10) << *pg << " sending info+missing+log since split " << it->second.split << " from floor " << it->second.floor - << endl; + << dendl; if (!m->log.copy_after_unless_divergent(pg->log, it->second.split, it->second.floor)) { - dout(10) << *pg << " divergent, sending backlog" << endl; + dout(10) << *pg << " divergent, sending backlog" << dendl; it->second.type = PG::Query::BACKLOG; } } if (it->second.type == PG::Query::BACKLOG) { - dout(10) << *pg << " sending info+missing+backlog" << endl; + dout(10) << *pg << " sending info+missing+backlog" << dendl; if (pg->log.backlog) { m->log = pg->log; } else { @@ -1853,11 +1853,11 @@ void OSD::handle_pg_query(MOSDPGQuery *m) } } else if (it->second.type == PG::Query::FULLLOG) { - dout(10) << *pg << " sending info+missing+full log" << endl; + dout(10) << *pg << " sending info+missing+full log" << dendl; m->log.copy_non_backlog(pg->log); } - dout(10) << *pg << " sending " << m->log << " " << m->missing << endl; + dout(10) << *pg << " sending " << m->log << " " << m->missing << dendl; //m->log.print(cout); _share_map_outgoing(osdmap->get_inst(from)); @@ -1875,7 +1875,7 @@ void OSD::handle_pg_query(MOSDPGQuery *m) void OSD::handle_pg_remove(MOSDPGRemove *m) { - dout(7) << "handle_pg_remove from " << m->get_source() << endl; + dout(7) << "handle_pg_remove from " << m->get_source() << dendl; if (!require_same_or_newer_map(m, m->get_epoch())) return; @@ -1886,13 +1886,13 @@ void OSD::handle_pg_remove(MOSDPGRemove *m) PG *pg; if (pg_map.count(pgid) == 0) { - dout(10) << " don't have pg " << pgid << endl; + dout(10) << " don't have pg " << pgid << dendl; continue; } pg = _lock_pg(pgid); - dout(10) << *pg << " removing." << endl; + dout(10) << *pg << " removing." << dendl; assert(pg->get_role() == -1); _remove_pg(pgid); @@ -1923,7 +1923,7 @@ void OSD::pull(PG *pg, object_t oid) dout(7) << *pg << " pull " << oid << " v " << v << " from osd" << osd - << endl; + << dendl; // send op tid_t tid = ++last_tid; @@ -1963,7 +1963,7 @@ void OSD::push(PG *pg, object_t oid, int dest) dout(7) << *pg << " push " << oid << " v " << v << " size " << bl.length() << " to osd" << dest - << endl; + << dendl; logger->inc("r_push"); logger->inc("r_pushb", bl.length()); @@ -1994,7 +1994,7 @@ void OSD::op_pull(MOSDOp *op, PG *pg) dout(7) << *pg << " op_pull " << oid << " v " << op->get_version() << " from " << op->get_source() - << endl; + << dendl; // is a replica asking? are they missing it? if (pg->is_primary()) { @@ -2002,7 +2002,7 @@ void OSD::op_pull(MOSDOp *op, PG *pg) assert(pg->peer_missing.count(from)); // we had better know this, from the peering process. if (!pg->peer_missing[from].is_missing(oid)) { - dout(7) << *pg << " op_pull replica isn't actually missing it, we must have already pushed to them" << endl; + dout(7) << *pg << " op_pull replica isn't actually missing it, we must have already pushed to them" << dendl; delete op; return; } @@ -2013,7 +2013,7 @@ void OSD::op_pull(MOSDOp *op, PG *pg) } else { // non-primary if (pg->missing.is_missing(oid)) { - dout(7) << *pg << " op_pull not primary, and missing " << oid << ", ignoring" << endl; + dout(7) << *pg << " op_pull not primary, and missing " << oid << ", ignoring" << dendl; delete op; return; } @@ -2033,7 +2033,7 @@ void OSD::op_push(MOSDOp *op, PG *pg) eversion_t v = op->get_version(); if (!pg->missing.is_missing(oid)) { - dout(7) << *pg << " op_push not missing " << oid << endl; + dout(7) << *pg << " op_push not missing " << oid << dendl; return; } @@ -2041,7 +2041,7 @@ void OSD::op_push(MOSDOp *op, PG *pg) << oid << " v " << v << " size " << op->get_length() << " " << op->get_data().length() - << endl; + << dendl; assert(op->get_data().length() == op->get_length()); @@ -2067,7 +2067,7 @@ void OSD::op_push(MOSDOp *op, PG *pg) pg->info.last_complete = pg->log.complete_to->version; pg->log.complete_to++; } - dout(10) << *pg << " last_complete now " << pg->info.last_complete << endl; + dout(10) << *pg << " last_complete now " << pg->info.last_complete << dendl; // apply to disk! @@ -2151,7 +2151,7 @@ void OSD::op_rep_modify_commit(MOSDOp *op, int ackerosd, eversion_t last_complet // send commit. dout(10) << "rep_modify_commit on op " << *op << ", sending commit to osd" << ackerosd - << endl; + << dendl; MOSDOpReply *commit = new MOSDOpReply(op, 0, osdmap->get_epoch(), true); commit->set_pg_complete_thru(last_complete); messenger->send_message(commit, osdmap->get_inst(ackerosd)); @@ -2193,7 +2193,7 @@ void OSD::op_rep_modify(MOSDOp *op, PG *pg) << " v " << nv << " " << op->get_offset() << "~" << op->get_length() << " in " << *pg - << endl; + << dendl; // we better not be missing this. assert(!pg->missing.is_missing(oid)); @@ -2265,7 +2265,7 @@ void OSD::op_rep_modify(MOSDOp *op, PG *pg) unsigned tr = store->apply_transaction(t, oncommit); if (tr != 0 && // no errors tr != 2) { // or error on collection_add - cerr << "error applying transaction: r = " << tr << endl; + cerr << "error applying transaction: r = " << tr << dendl; assert(tr == 0); } } @@ -2330,7 +2330,7 @@ void OSD::handle_op(MOSDOp *op) if (!pg) { dout(7) << "hit non-existent pg " << pgid - << ", waiting" << endl; + << ", waiting" << dendl; waiting_for_pg[pgid].push_back(op); return; } @@ -2341,7 +2341,7 @@ void OSD::handle_op(MOSDOp *op) op->get_map_epoch() < pg->info.history.same_acker_since) { dout(7) << "acting acker is osd" << pg->get_acker() << " since " << pg->info.history.same_acker_since - << ", dropping" << endl; + << ", dropping" << dendl; assert(op->get_map_epoch() < osdmap->get_epoch()); delete op; return; @@ -2352,7 +2352,7 @@ void OSD::handle_op(MOSDOp *op) op->get_map_epoch() < pg->info.history.same_primary_since) { dout(7) << "acting primary is osd" << pg->get_primary() << " since " << pg->info.history.same_primary_since - << ", dropping" << endl; + << ", dropping" << dendl; assert(op->get_map_epoch() < osdmap->get_epoch()); delete op; return; @@ -2365,17 +2365,17 @@ void OSD::handle_op(MOSDOp *op) if (op->get_version().version > 0) { if (op->get_version() > pg->info.last_update) { dout(7) << *pg << " queueing replay at " << op->get_version() - << " for " << *op << endl; + << " for " << *op << dendl; pg->replay_queue[op->get_version()] = op; return; } else { dout(7) << *pg << " replay at " << op->get_version() << " <= " << pg->info.last_update << " for " << *op - << ", will queue for WRNOOP" << endl; + << ", will queue for WRNOOP" << dendl; } } - dout(7) << *pg << " not active (yet)" << endl; + dout(7) << *pg << " not active (yet)" << dendl; pg->waiting_for_active.push_back(op); return; } @@ -2394,7 +2394,7 @@ void OSD::handle_op(MOSDOp *op) dout(10) << "handle_op read on " << op->get_oid() << ", have " << loid << ", but need missing " << moid - << ", pulling" << endl; + << ", pulling" << dendl; pull(pg, moid); pg->waiting_for_missing_object[moid].push_back(op); return; @@ -2403,7 +2403,7 @@ void OSD::handle_op(MOSDOp *op) dout(10) << "handle_op read on " << op->get_oid() << ", have " << loid << ", don't need missing " << moid - << endl; + << dendl; } } else { // live revision. easy. @@ -2411,7 +2411,7 @@ void OSD::handle_op(MOSDOp *op) waitfor_missing_object(op, pg)) return; } - dout(7) << "handle_op " << *op << " in " << *pg << endl; + dout(7) << "handle_op " << *op << " in " << *pg << dendl; // balance reads? @@ -2422,7 +2422,7 @@ void OSD::handle_op(MOSDOp *op) if (false) { if (pg->acting.size() > 1) { int peer = pg->acting[1]; - dout(-10) << "fwd client read op to osd" << peer << " for " << op->get_client() << " " << op->get_client_inst() << endl; + dout(-10) << "fwd client read op to osd" << peer << " for " << op->get_client() << " " << op->get_client_inst() << dendl; messenger->send_message(op, osdmap->get_inst(peer)); return; } @@ -2445,7 +2445,7 @@ void OSD::handle_op(MOSDOp *op) << ", p=" << p << ", fwd to peer w/ qlen " << peer_qlen[peer] << " osd" << peer - << endl; + << dendl; messenger->send_message(op, osdmap->get_inst(peer)); return; } @@ -2460,7 +2460,7 @@ void OSD::handle_op(MOSDOp *op) // have pg? if (!pg) { derr(-7) << "handle_rep_op " << *op - << " pgid " << pgid << " dne" << endl; + << " pgid " << pgid << " dne" << dendl; delete op; //assert(0); // wtf, shouldn't happen. return; @@ -2471,7 +2471,7 @@ void OSD::handle_op(MOSDOp *op) op->get_map_epoch() < pg->info.history.same_since) { dout(10) << "handle_rep_op pg changed " << pg->info.history << " after " << op->get_map_epoch() - << ", dropping" << endl; + << ", dropping" << dendl; delete op; return; } @@ -2480,13 +2480,13 @@ void OSD::handle_op(MOSDOp *op) op->get_map_epoch() < pg->info.history.same_acker_since)) { dout(10) << "handle_rep_op pg primary|acker changed " << pg->info.history << " after " << op->get_map_epoch() - << ", dropping" << endl; + << ", dropping" << dendl; delete op; return; } assert(pg->get_role() >= 0); - dout(7) << "handle_rep_op " << op << " in " << *pg << endl; + dout(7) << "handle_rep_op " << op << " in " << *pg << dendl; } if (g_conf.osd_maxthreads < 1) { @@ -2505,7 +2505,7 @@ void OSD::handle_op(MOSDOp *op) void OSD::handle_op_reply(MOSDOpReply *op) { if (op->get_map_epoch() < boot_epoch) { - dout(3) << "replica op reply from before boot" << endl; + dout(3) << "replica op reply from before boot" << dendl; delete op; return; } @@ -2544,7 +2544,7 @@ void OSD::handle_op_reply(MOSDOpReply *op) void OSD::enqueue_op(pg_t pgid, Message *op) { while (pending_ops > g_conf.osd_max_opq) { - dout(10) << "enqueue_op waiting for pending_ops " << pending_ops << " to drop to " << g_conf.osd_max_opq << endl; + dout(10) << "enqueue_op waiting for pending_ops " << pending_ops << " to drop to " << g_conf.osd_max_opq << dendl; op_queue_cond.Wait(osd_lock); } @@ -2578,10 +2578,10 @@ void OSD::dequeue_op(pg_t pgid) if (pgid) { dout(10) << "dequeue_op " << op << " write pg " << pgid - << ls.size() << " / " << (pending_ops-1) << " more pending" << endl; + << ls.size() << " / " << (pending_ops-1) << " more pending" << dendl; } else { dout(10) << "dequeue_op " << op << " read " - << ls.size() << " / " << (pending_ops-1) << " more pending" << endl; + << ls.size() << " / " << (pending_ops-1) << " more pending" << dendl; } if (ls.empty()) @@ -2600,7 +2600,7 @@ void OSD::dequeue_op(pg_t pgid) _unlock_pg(pgid); } - dout(10) << "dequeue_op " << op << " finish" << endl; + dout(10) << "dequeue_op " << op << " finish" << dendl; assert(pending_ops > 0); if (pending_ops > g_conf.osd_max_opq) @@ -2622,7 +2622,7 @@ void OSD::dequeue_op(pg_t pgid) */ void OSD::do_op(Message *m, PG *pg) { - //dout(15) << "do_op " << *m << endl; + //dout(15) << "do_op " << *m << dendl; if (m->get_type() == MSG_OSD_OP) { MOSDOp *op = (MOSDOp*)m; @@ -2696,14 +2696,14 @@ void OSD::do_op(Message *m, PG *pg) void OSD::wait_for_no_ops() { if (pending_ops > 0) { - dout(7) << "wait_for_no_ops - waiting for " << pending_ops << endl; + dout(7) << "wait_for_no_ops - waiting for " << pending_ops << dendl; waiting_for_no_ops = true; while (pending_ops > 0) no_pending_ops.Wait(osd_lock); waiting_for_no_ops = false; assert(pending_ops == 0); } - dout(7) << "wait_for_no_ops - none" << endl; + dout(7) << "wait_for_no_ops - none" << dendl; } @@ -2720,7 +2720,7 @@ bool OSD::block_if_wrlocked(MOSDOp* op) entity_name_t source; int len = store->getattr(oid, "wrlock", &source, sizeof(entity_name_t)); - //cout << "getattr returns " << len << " on " << oid << endl; + //cout << "getattr returns " << len << " on " << oid << dendl; if (len == sizeof(source) && source != op->get_client()) { @@ -2779,7 +2779,7 @@ bool OSD::pick_object_rev(object_t& oid) int r = store->getattr(t, "crev", &crev, sizeof(crev)); assert(r >= 0); if (crev <= oid.rev) { - dout(10) << "pick_object_rev choosing " << t << " crev " << crev << " for " << oid << endl; + dout(10) << "pick_object_rev choosing " << t << " crev " << crev << " for " << oid << dendl; oid = t; return true; } @@ -2801,14 +2801,14 @@ bool OSD::waitfor_missing_object(MOSDOp *op, PG *pg) << " v " << v << " in " << *pg << ", already pulling" - << endl; + << dendl; } else { dout(7) << "missing " << oid << " v " << v << " in " << *pg << ", pulling" - << endl; + << dendl; pull(pg, oid); } pg->waiting_for_missing_object[oid].push_back(op); @@ -2838,7 +2838,7 @@ void OSD::op_read(MOSDOp *op)//, PG *pg) dout(10) << "op_read " << oid << " " << op->get_offset() << "~" << op->get_length() //<< " in " << *pg - << endl; + << dendl; long r = 0; bufferlist bl; @@ -2868,7 +2868,7 @@ void OSD::op_read(MOSDOp *op)//, PG *pg) reply->set_length(0); } - dout(10) << " read got " << r << " / " << op->get_length() << " bytes from obj " << oid << endl; + dout(10) << " read got " << r << " / " << op->get_length() << " bytes from obj " << oid << dendl; logger->inc("rd"); if (r >= 0) logger->inc("rdb", r); @@ -2906,7 +2906,7 @@ void OSD::op_stat(MOSDOp *op)//, PG *pg) << " r = " << r << " size = " << st.st_size //<< " in " << *pg - << endl; + << dendl; MOSDOpReply *reply = new MOSDOpReply(op, r, osdmap->get_epoch(), true); reply->set_object_size(st.st_size); @@ -2926,18 +2926,18 @@ void OSD::op_stat(MOSDOp *op)//, PG *pg) void OSD::get_repop_gather(PG::RepOpGather *repop) { //repop->lock.Lock(); - dout(10) << "get_repop " << *repop << endl; + dout(10) << "get_repop " << *repop << dendl; } void OSD::apply_repop(PG *pg, PG::RepOpGather *repop) { - dout(10) << "apply_repop applying update on " << *repop << endl; + dout(10) << "apply_repop applying update on " << *repop << dendl; assert(!repop->applied); Context *oncommit = new C_OSD_WriteCommit(this, pg->info.pgid, repop->rep_tid, repop->pg_local_last_complete); unsigned r = store->apply_transaction(repop->t, oncommit); if (r) - dout(-10) << "apply_repop apply transaction return " << r << " on " << *repop << endl; + dout(-10) << "apply_repop apply transaction return " << r << " on " << *repop << dendl; // discard my reference to buffer repop->op->get_data().clear(); @@ -2947,14 +2947,14 @@ void OSD::apply_repop(PG *pg, PG::RepOpGather *repop) void OSD::put_repop_gather(PG *pg, PG::RepOpGather *repop) { - dout(10) << "put_repop " << *repop << endl; + dout(10) << "put_repop " << *repop << dendl; // commit? if (repop->can_send_commit() && repop->op->wants_commit()) { // send commit. MOSDOpReply *reply = new MOSDOpReply(repop->op, 0, osdmap->get_epoch(), true); - dout(10) << "put_repop sending commit on " << *repop << " " << reply << endl; + dout(10) << "put_repop sending commit on " << *repop << " " << reply << dendl; messenger->send_message(reply, repop->op->get_client_inst()); repop->sent_commit = true; } @@ -2967,7 +2967,7 @@ void OSD::put_repop_gather(PG *pg, PG::RepOpGather *repop) // send ack MOSDOpReply *reply = new MOSDOpReply(repop->op, 0, osdmap->get_epoch(), false); - dout(10) << "put_repop sending ack on " << *repop << " " << reply << endl; + dout(10) << "put_repop sending ack on " << *repop << " " << reply << dendl; messenger->send_message(reply, repop->op->get_client_inst()); repop->sent_ack = true; @@ -2988,12 +2988,12 @@ void OSD::put_repop_gather(PG *pg, PG::RepOpGather *repop) } if (min > pg->peers_complete_thru) { - dout(10) << "put_repop peers_complete_thru " << pg->peers_complete_thru << " -> " << min << " in " << *pg << endl; + dout(10) << "put_repop peers_complete_thru " << pg->peers_complete_thru << " -> " << min << " in " << *pg << dendl; pg->peers_complete_thru = min; } } - dout(10) << "put_repop deleting " << *repop << endl; + dout(10) << "put_repop deleting " << *repop << dendl; //repop->lock.Unlock(); assert(pg->repop_gather.count(repop->rep_tid)); @@ -3016,7 +3016,7 @@ void OSD::issue_repop(PG *pg, MOSDOp *op, int osd) << " in " << *pg << " o " << oid << " to osd" << osd - << endl; + << dendl; // forward the write/update/whatever MOSDOp *wr = new MOSDOp(op->get_client_inst(), op->get_client_inc(), op->get_reqid().tid, @@ -3038,7 +3038,7 @@ void OSD::issue_repop(PG *pg, MOSDOp *op, int osd) PG::RepOpGather *OSD::new_repop_gather(PG *pg, MOSDOp *op) { - dout(10) << "new_repop_gather rep_tid " << op->get_rep_tid() << " on " << *op << " in " << *pg << endl; + dout(10) << "new_repop_gather rep_tid " << op->get_rep_tid() << " on " << *op << " in " << *pg << dendl; PG::RepOpGather *repop = new PG::RepOpGather(op, op->get_rep_tid(), op->get_version(), @@ -3098,7 +3098,7 @@ void OSD::repop_ack(PG *pg, PG::RepOpGather *repop, dout(7) << "repop_ack rep_tid " << repop->rep_tid << " op " << *op << " result " << result << " commit " << commit << " from osd" << fromosd << " in " << *pg - << endl; + << dendl; get_repop_gather(repop); { @@ -3130,7 +3130,7 @@ void OSD::op_modify_commit(pg_t pgid, tid_t rep_tid, eversion_t pg_complete_thru if (pg->repop_gather.count(rep_tid)) { PG::RepOpGather *repop = pg->repop_gather[rep_tid]; - dout(10) << "op_modify_commit " << *repop->op << endl; + dout(10) << "op_modify_commit " << *repop->op << dendl; get_repop_gather(repop); { assert(repop->waitfor_commit.count(whoami)); @@ -3138,14 +3138,14 @@ void OSD::op_modify_commit(pg_t pgid, tid_t rep_tid, eversion_t pg_complete_thru repop->pg_complete_thru[whoami] = pg_complete_thru; } put_repop_gather(pg, repop); - dout(10) << "op_modify_commit done on " << repop << endl; + dout(10) << "op_modify_commit done on " << repop << dendl; } else { - dout(10) << "op_modify_commit pg " << pgid << " rep_tid " << rep_tid << " dne" << endl; + dout(10) << "op_modify_commit pg " << pgid << " rep_tid " << rep_tid << " dne" << dendl; } unlock_pg(pgid); } else { - dout(10) << "op_modify_commit pg " << pgid << " dne" << endl; + dout(10) << "op_modify_commit pg " << pgid << " dne" << dendl; } } @@ -3175,7 +3175,7 @@ void OSD::op_modify(MOSDOp *op, PG *pg) // dup op? if (pg->log.logged_req(op->get_reqid())) { dout(-3) << "op_modify " << opname << " dup op " << op->get_reqid() - << ", doing WRNOOP" << endl; + << ", doing WRNOOP" << dendl; op->set_op(OSD_OP_WRNOOP); opname = MOSDOp::get_opname(op->get_op()); } @@ -3230,7 +3230,7 @@ void OSD::op_modify(MOSDOp *op, PG *pg) << " crev " << crev << " rev " << op->get_rev() << " " << op->get_offset() << "~" << op->get_length() - << endl; + << dendl; if (op->get_op() == OSD_OP_WRITE) { logger->inc("c_wr"); @@ -3303,7 +3303,7 @@ void OSD::op_modify(MOSDOp *op, PG *pg) unsigned r = store->apply_transaction(t, oncommit); if (r != 0 && // no errors r != 2) { // or error on collection_add - cerr << "error applying transaction: r = " << r << endl; + cerr << "error applying transaction: r = " << r << dendl; assert(r == 0); } @@ -3330,7 +3330,7 @@ void OSD::prepare_log_transaction(ObjectStore::Transaction& t, dout(10) << "prepare_log_transaction " << op->get_op() << " " << cloneentry - << " in " << *pg << endl; + << " in " << *pg << dendl; } // actual op @@ -3340,13 +3340,13 @@ void OSD::prepare_log_transaction(ObjectStore::Transaction& t, dout(10) << "prepare_log_transaction " << op->get_op() << " " << logentry - << " in " << *pg << endl; + << " in " << *pg << dendl; // append to log assert(version > pg->log.top); pg->log.add(logentry); assert(pg->log.top == version); - dout(10) << "prepare_log_transaction appended to " << *pg << endl; + dout(10) << "prepare_log_transaction appended to " << *pg << dendl; // write to pg log on disk pg->append_log(t, logentry, trim_to); @@ -3371,7 +3371,7 @@ void OSD::prepare_op_transaction(ObjectStore::Transaction& t, << " v " << version << " crev " << crev << " rev " << rev - << " in " << *pg << endl; + << " in " << *pg << dendl; // WRNOOP does nothing. if (op->get_op() == OSD_OP_WRNOOP) @@ -3392,7 +3392,7 @@ void OSD::prepare_op_transaction(ObjectStore::Transaction& t, if (crev && rev && rev > crev) { object_t noid = oid; noid.rev = rev; - dout(10) << "prepare_op_transaction cloning " << oid << " crev " << crev << " to " << noid << endl; + dout(10) << "prepare_op_transaction cloning " << oid << " crev " << crev << " to " << noid << dendl; t.clone(oid, noid); did_clone = true; } @@ -3452,7 +3452,7 @@ void OSD::prepare_op_transaction(ObjectStore::Transaction& t, } } else { // noop? - dout(10) << "apply_transaction zero on " << oid << ", but dne? stat returns " << r << endl; + dout(10) << "apply_transaction zero on " << oid << ", but dne? stat returns " << r << dendl; } } break; diff --git a/trunk/ceph/osd/PG.cc b/trunk/ceph/osd/PG.cc index 218f9eac36aae..a3402ec0d8fac 100644 --- a/trunk/ceph/osd/PG.cc +++ b/trunk/ceph/osd/PG.cc @@ -24,7 +24,7 @@ #include "messages/MOSDPGRemove.h" #undef dout -#define dout(l) if (l<=g_conf.debug || l<=g_conf.debug_osd) cout << g_clock.now() << " osd" << osd->whoami << " " << (osd->osdmap ? osd->osdmap->get_epoch():0) << " " << *this << " " +#define dout(l) if (l<=g_conf.debug || l<=g_conf.debug_osd) cout << dbeginl << g_clock.now() << " osd" << osd->whoami << " " << (osd->osdmap ? osd->osdmap->get_epoch():0) << " " << *this << " " /******* PGLog ********/ @@ -144,18 +144,18 @@ void PG::IndexedLog::trim_write_ahead(eversion_t last_update) void PG::trim_write_ahead() { if (info.last_update < log.top) { - dout(10) << "trim_write_ahead (" << info.last_update << "," << log.top << "]" << endl; + dout(10) << "trim_write_ahead (" << info.last_update << "," << log.top << "]" << dendl; log.trim_write_ahead(info.last_update); } else { assert(info.last_update == log.top); - dout(10) << "trim_write_ahead last_update=top=" << info.last_update << endl; + dout(10) << "trim_write_ahead last_update=top=" << info.last_update << dendl; } } void PG::proc_replica_log(Log &olog, Missing& omissing, int from) { - dout(10) << "proc_replica_log for osd" << from << ": " << olog << " " << omissing << endl; + dout(10) << "proc_replica_log for osd" << from << ": " << olog << " " << omissing << dendl; assert(!is_active()); if (!have_master_log) { @@ -175,12 +175,12 @@ void PG::proc_replica_log(Log &olog, Missing& omissing, int from) eversion_t lu = peer_info[from].last_update; while (pp != olog.log.rend()) { if (!log.objects.count(pp->oid)) { - dout(10) << " divergent " << *pp << " not in our log, generating backlog" << endl; + dout(10) << " divergent " << *pp << " not in our log, generating backlog" << dendl; generate_backlog(); } if (!log.objects.count(pp->oid)) { - dout(10) << " divergent " << *pp << " dne, must have been new, ignoring" << endl; + dout(10) << " divergent " << *pp << " dne, must have been new, ignoring" << dendl; ++pp; continue; } @@ -194,9 +194,9 @@ void PG::proc_replica_log(Log &olog, Missing& omissing, int from) if (log.objects[pp->oid]->version > pp->version) { dout(10) << " divergent " << *pp << " superceded by " << log.objects[pp->oid] - << ", ignoring" << endl; + << ", ignoring" << dendl; } else { - dout(10) << " divergent " << *pp << ", adding to missing" << endl; + dout(10) << " divergent " << *pp << ", adding to missing" << dendl; peer_missing[from].add(pp->oid, pp->version); } @@ -208,10 +208,10 @@ void PG::proc_replica_log(Log &olog, Missing& omissing, int from) } if (lu < peer_info[from].last_update) { - dout(10) << " peer osd" << from << " last_update now " << lu << endl; + dout(10) << " peer osd" << from << " last_update now " << lu << dendl; peer_info[from].last_update = lu; if (lu < oldest_update) { - dout(10) << " oldest_update now " << lu << endl; + dout(10) << " oldest_update now " << lu << dendl; oldest_update = lu; } } @@ -223,11 +223,11 @@ void PG::proc_replica_log(Log &olog, Missing& omissing, int from) void PG::merge_log(Log &olog, Missing &omissing, int fromosd) { dout(10) << "merge_log " << olog << " from osd" << fromosd - << " into " << log << endl; + << " into " << log << dendl; - //cout << "log" << endl; + //cout << "log" << dendl; //log.print(cout); - //cout << "olog" << endl; + //cout << "olog" << dendl; //olog.print(cout); if (log.empty() || @@ -247,7 +247,7 @@ void PG::merge_log(Log &olog, Missing &omissing, int fromosd) // was our old log divergent? if (log.top > p->version) { - dout(10) << "merge_log i was (possibly) divergent for (" << p->version << "," << log.top << "]" << endl; + dout(10) << "merge_log i was (possibly) divergent for (" << p->version << "," << log.top << "]" << dendl; if (p->version < oldest_update) oldest_update = p->version; @@ -258,15 +258,15 @@ void PG::merge_log(Log &olog, Missing &omissing, int fromosd) if (log.objects[oe.oid]->version < oe.version) { dout(10) << "merge_log divergent entry " << oe << " not superceded by " << *log.objects[oe.oid] - << ", adding to missing" << endl; + << ", adding to missing" << dendl; missing.add(oe.oid, oe.version); } else { dout(10) << "merge_log divergent entry " << oe << " superceded by " << *log.objects[oe.oid] - << ", ignoring" << endl; + << ", ignoring" << dendl; } } else { - dout(10) << "merge_log divergent entry " << oe << ", adding to missing" << endl; + dout(10) << "merge_log divergent entry " << oe << ", adding to missing" << dendl; missing.add(oe.oid, oe.version); } olog.log.pop_back(); // discard divergent entry @@ -276,10 +276,10 @@ void PG::merge_log(Log &olog, Missing &omissing, int fromosd) } if (p->is_delete()) { - dout(10) << "merge_log merging " << *p << ", not missing" << endl; + dout(10) << "merge_log merging " << *p << ", not missing" << dendl; missing.rm(p->oid, p->version); } else { - dout(10) << "merge_log merging " << *p << ", now missing" << endl; + dout(10) << "merge_log merging " << *p << ", now missing" << dendl; missing.add(p->oid, p->version); } } @@ -297,7 +297,7 @@ void PG::merge_log(Log &olog, Missing &omissing, int fromosd) if (olog.bottom < log.bottom && olog.top >= log.bottom && !log.backlog) { dout(10) << "merge_log extending bottom to " << olog.bottom << (olog.backlog ? " +backlog":"") - << endl; + << dendl; // ok list::iterator from = olog.log.begin(); @@ -310,7 +310,7 @@ void PG::merge_log(Log &olog, Missing &omissing, int fromosd) // update our index while we're here log.index(*to); - dout(15) << *to << endl; + dout(15) << *to << dendl; // new missing object? if (to->version > info.last_complete) { @@ -333,21 +333,21 @@ void PG::merge_log(Log &olog, Missing &omissing, int fromosd) // extend on top? if (olog.top > log.top && olog.bottom <= log.top) { - dout(10) << "merge_log extending top to " << olog.top << endl; + dout(10) << "merge_log extending top to " << olog.top << dendl; list::iterator to = olog.log.end(); list::iterator from = olog.log.end(); while (1) { if (from == olog.log.begin()) break; from--; - //dout(0) << "? " << *from << endl; + //dout(0) << "? " << *from << dendl; if (from->version < log.top) { from++; break; } log.index(*from); - dout(10) << "merge_log " << *from << endl; + dout(10) << "merge_log " << *from << dendl; // add to missing if (from->is_update()) { @@ -366,11 +366,11 @@ void PG::merge_log(Log &olog, Missing &omissing, int fromosd) if (log.objects[oldtail->oid]->version == oldtail->version) { // and significant. - dout(10) << "merge_log had divergent " << *oldtail << ", adding to missing" << endl; + dout(10) << "merge_log had divergent " << *oldtail << ", adding to missing" << dendl; //missing.add(oldtail->oid); assert(0); } else { - dout(10) << "merge_log had divergent " << *oldtail << ", already missing" << endl; + dout(10) << "merge_log had divergent " << *oldtail << ", already missing" << dendl; assert(missing.is_missing(oldtail->oid)); } log.log.pop_back(); @@ -384,7 +384,7 @@ void PG::merge_log(Log &olog, Missing &omissing, int fromosd) } } - dout(10) << "merge_log result " << log << " " << missing << endl; + dout(10) << "merge_log result " << log << " " << missing << dendl; //log.print(cout); } @@ -399,32 +399,32 @@ void PG::proc_missing(Log &olog, Missing &omissing, int fromosd) assert(omissing.is_missing(p->first, p->second)); if (omissing.loc.count(p->first)) { dout(10) << "proc_missing missing " << p->first << " " << p->second - << " on osd" << omissing.loc[p->first] << endl; + << " on osd" << omissing.loc[p->first] << dendl; missing.loc[p->first] = omissing.loc[p->first]; } else { dout(10) << "proc_missing missing " << p->first << " " << p->second - << " also LOST on source, osd" << fromosd << endl; + << " also LOST on source, osd" << fromosd << dendl; } } else if (p->second <= olog.top) { dout(10) << "proc_missing missing " << p->first << " " << p->second - << " on source, osd" << fromosd << endl; + << " on source, osd" << fromosd << dendl; missing.loc[p->first] = fromosd; } else { dout(10) << "proc_missing " << p->first << " " << p->second << " > olog.top " << olog.top << ", not found...." - << endl; + << dendl; } } - dout(10) << "proc_missing missing " << missing.missing << endl; + dout(10) << "proc_missing missing " << missing.missing << dendl; } void PG::generate_backlog() { - dout(10) << "generate_backlog to " << log << endl; + dout(10) << "generate_backlog to " << log << dendl; assert(!log.backlog); log.backlog = true; @@ -448,7 +448,7 @@ void PG::generate_backlog() "version", &e.version, sizeof(e.version)); add[e.version] = e; - dout(10) << "generate_backlog found " << e << endl; + dout(10) << "generate_backlog found " << e << dendl; } for (map::reverse_iterator i = add.rbegin(); @@ -460,14 +460,14 @@ void PG::generate_backlog() dout(10) << local << " local objects, " << add.size() << " objects added to backlog, " - << log.objects.size() << " in pg" << endl; + << log.objects.size() << " in pg" << dendl; //log.print(cout); } void PG::drop_backlog() { - dout(10) << "drop_backlog for " << log << endl; + dout(10) << "drop_backlog for " << log << dendl; //log.print(cout); assert(log.backlog); @@ -477,7 +477,7 @@ void PG::drop_backlog() Log::Entry &e = *log.log.begin(); if (e.version > log.bottom) break; - dout(15) << "drop_backlog trimming " << e.version << endl; + dout(15) << "drop_backlog trimming " << e.version << dendl; log.unindex(e); log.log.pop_front(); } @@ -489,11 +489,11 @@ void PG::drop_backlog() ostream& PG::Log::print(ostream& out) const { - out << *this << endl; + out << *this << dendl; for (list::const_iterator p = log.begin(); p != log.end(); p++) - out << *p << endl; + out << *p << dendl; return out; } @@ -522,14 +522,14 @@ void PG::build_prior() omap.pg_to_acting_osds(get_pgid(), acting); for (unsigned i=0; iosdmap->is_up(acting[i]) && // is up now acting[i] != osd->whoami) // and is not me prior_set.insert(acting[i]); } } - dout(10) << "build_prior built " << prior_set << endl; + dout(10) << "build_prior built " << prior_set << dendl; } void PG::adjust_prior() @@ -546,7 +546,7 @@ void PG::adjust_prior() } dout(10) << "adjust_prior last_epoch_started_any " - << last_epoch_started_any << " -> " << max << endl; + << last_epoch_started_any << " -> " << max << dendl; assert(max > last_epoch_started_any); last_epoch_started_any = max; @@ -557,7 +557,7 @@ void PG::adjust_prior() void PG::clear_primary_state() { - dout(10) << "clear_primary_state" << endl; + dout(10) << "clear_primary_state" << dendl; // clear peering state have_master_log = false; @@ -576,7 +576,7 @@ void PG::peer(ObjectStore::Transaction& t, map< int, map >& query_map) { dout(10) << "peer. acting is " << acting - << ", prior_set is " << prior_set << endl; + << ", prior_set is " << prior_set << dendl; /** GET ALL PG::Info *********/ @@ -589,17 +589,17 @@ void PG::peer(ObjectStore::Transaction& t, if (peer_info.count(*it)) { dout(10) << " have info from osd" << *it << ": " << peer_info[*it] - << endl; + << dendl; continue; } missing_info = true; if (peer_info_requested.count(*it)) { - dout(10) << " waiting for osd" << *it << endl; + dout(10) << " waiting for osd" << *it << dendl; continue; } - dout(10) << " querying info from osd" << *it << endl; + dout(10) << " querying info from osd" << *it << dendl; query_map[*it][info.pgid] = Query(Query::INFO, info.history); peer_info_requested.insert(*it); } @@ -609,7 +609,7 @@ void PG::peer(ObjectStore::Transaction& t, // -- ok, we have all (prior_set) info. (and maybe others.) // did we crash? - dout(10) << " last_epoch_started_any " << last_epoch_started_any << endl; + dout(10) << " last_epoch_started_any " << last_epoch_started_any << dendl; if (last_epoch_started_any) { OSDMap omap; osd->get_map(last_epoch_started_any, omap); @@ -633,27 +633,27 @@ void PG::peer(ObjectStore::Transaction& t, for (set::iterator i = last_started.begin(); i != last_started.end(); i++) { - //dout(10) << " down in epoch " << e << " is " << omap.get_down_osds() << endl; + //dout(10) << " down in epoch " << e << " is " << omap.get_down_osds() << dendl; if (omap.is_up(*i)) still_up.insert(*i); } last_started.swap(still_up); - //dout(10) << " still active as of epoch " << e << ": " << last_started << endl; + //dout(10) << " still active as of epoch " << e << ": " << last_started << dendl; } if (last_started.empty()) { - dout(10) << " crashed since epoch " << last_epoch_started_any << endl; + dout(10) << " crashed since epoch " << last_epoch_started_any << dendl; state_set(STATE_CRASHED); } else { - dout(10) << " still active from last started: " << last_started << endl; + dout(10) << " still active from last started: " << last_started << dendl; } } else if (osd->osdmap->get_epoch() > 1) { - dout(10) << " crashed since epoch " << last_epoch_started_any << endl; + dout(10) << " crashed since epoch " << last_epoch_started_any << dendl; state_set(STATE_CRASHED); } - dout(10) << " peers_complete_thru " << peers_complete_thru << endl; + dout(10) << " peers_complete_thru " << peers_complete_thru << dendl; @@ -689,7 +689,7 @@ void PG::peer(ObjectStore::Transaction& t, dout(10) << " newest update on osd" << newest_update_osd << " v " << newest_update << ", already queried" - << endl; + << dendl; } else { // we'd like it back to oldest_update, but will settle for log_bottom eversion_t since = MAX(peer_info[newest_update_osd].log_bottom, @@ -698,14 +698,14 @@ void PG::peer(ObjectStore::Transaction& t, dout(10) << " newest update on osd" << newest_update_osd << " v " << newest_update << ", querying since " << since - << endl; + << dendl; query_map[newest_update_osd][info.pgid] = Query(Query::LOG, log.top, since, info.history); peer_log_requested.insert(newest_update_osd); } else { dout(10) << " newest update on osd" << newest_update_osd << " v " << newest_update << ", querying entire summary/backlog" - << endl; + << dendl; assert((peer_info[newest_update_osd].last_complete >= peer_info[newest_update_osd].log_bottom) || peer_info[newest_update_osd].log_backlog); // or else we're in trouble. @@ -715,10 +715,10 @@ void PG::peer(ObjectStore::Transaction& t, } return; } else { - dout(10) << " newest_update " << info.last_update << " (me)" << endl; + dout(10) << " newest_update " << info.last_update << " (me)" << dendl; } - dout(10) << " oldest_update " << oldest_update << endl; + dout(10) << " oldest_update " << oldest_update << dendl; have_master_log = true; @@ -727,7 +727,7 @@ void PG::peer(ObjectStore::Transaction& t, if (oldest_update < log.bottom && !log.backlog) { dout(10) << "generating backlog for some peers, bottom " << log.bottom << " > " << oldest_update - << endl; + << dendl; generate_backlog(); } @@ -746,7 +746,7 @@ void PG::peer(ObjectStore::Transaction& t, peer_summary_requested.count(peer)) continue; dout(10) << " pulling log+missing from osd" << peer - << endl; + << dendl; query_map[peer][info.pgid] = Query(Query::FULLLOG, info.history); peer_log_requested.insert(peer); } @@ -758,17 +758,17 @@ void PG::peer(ObjectStore::Transaction& t, if (peer_info[peer].is_empty()) continue; if (peer_missing.count(peer)) continue; - dout(10) << " waiting for log+missing from osd" << peer << endl; + dout(10) << " waiting for log+missing from osd" << peer << dendl; have_missing = false; } if (!have_missing) return; - dout(10) << " peers_complete_thru " << peers_complete_thru << endl; + dout(10) << " peers_complete_thru " << peers_complete_thru << dendl; // -- ok. and have i located all pg contents? if (missing.num_lost() > 0) { - dout(10) << "there are still " << missing.num_lost() << " lost objects" << endl; + dout(10) << "there are still " << missing.num_lost() << " lost objects" << dendl; // ***** // FIXME: i don't think this actually accomplishes anything! @@ -782,19 +782,19 @@ void PG::peer(ObjectStore::Transaction& t, int peer = it->first; if (peer_summary_requested.count(peer)) { - dout(10) << " already requested summary/backlog from osd" << peer << endl; + dout(10) << " already requested summary/backlog from osd" << peer << dendl; waiting = true; continue; } - dout(10) << " requesting summary/backlog from osd" << peer << endl; + dout(10) << " requesting summary/backlog from osd" << peer << dendl; query_map[peer][info.pgid] = Query(Query::BACKLOG, info.history); peer_summary_requested.insert(peer); waiting = true; } if (!waiting) { - dout(10) << missing.num_lost() << " objects are still lost, waiting+hoping for a notify from someone else!" << endl; + dout(10) << missing.num_lost() << " objects are still lost, waiting+hoping for a notify from someone else!" << dendl; } return; } @@ -806,7 +806,7 @@ void PG::peer(ObjectStore::Transaction& t, // -- crash recovery? if (is_crashed()) { - dout(10) << "crashed, allowing op replay for " << g_conf.osd_replay_window << endl; + dout(10) << "crashed, allowing op replay for " << g_conf.osd_replay_window << dendl; state_set(STATE_REPLAY); osd->timer.add_event_after(g_conf.osd_replay_window, new OSD::C_Activate(osd, info.pgid, osd->osdmap->get_epoch())); @@ -849,13 +849,13 @@ void PG::activate(ObjectStore::Transaction& t) // init complete pointer if (info.last_complete == info.last_update) { - dout(10) << "activate - complete" << endl; + dout(10) << "activate - complete" << dendl; log.complete_to == log.log.end(); log.requested_to = log.log.end(); } //else if (is_primary()) { else if (true) { - dout(10) << "activate - not complete, " << missing << ", starting recovery" << endl; + dout(10) << "activate - not complete, " << missing << ", starting recovery" << dendl; // init complete_to log.complete_to = log.log.begin(); @@ -868,7 +868,7 @@ void PG::activate(ObjectStore::Transaction& t) log.requested_to = log.complete_to; do_recovery(); } else { - dout(10) << "activate - not complete, " << missing << endl; + dout(10) << "activate - not complete, " << missing << dendl; } @@ -915,18 +915,18 @@ void PG::activate(ObjectStore::Transaction& t) } dout(10) << "activate sending " << m->log << " " << m->missing - << " to osd" << peer << endl; + << " to osd" << peer << dendl; //m->log.print(cout); osd->messenger->send_message(m, osd->osdmap->get_inst(peer)); // update our missing if (peer_missing[peer].num_missing() == 0) { - dout(10) << "activate peer osd" << peer << " already clean, " << peer_info[peer] << endl; + dout(10) << "activate peer osd" << peer << " already clean, " << peer_info[peer] << dendl; assert(peer_info[peer].last_complete == info.last_update); clean_set.insert(peer); } else { dout(10) << "activate peer osd" << peer << " " << peer_info[peer] - << " missing " << peer_missing[peer] << endl; + << " missing " << peer_missing[peer] << dendl; } } @@ -937,7 +937,7 @@ void PG::activate(ObjectStore::Transaction& t) // all clean? if (is_all_clean()) { state_set(STATE_CLEAN); - dout(10) << "activate all replicas clean" << endl; + dout(10) << "activate all replicas clean" << dendl; clean_replicas(); } } @@ -951,7 +951,7 @@ void PG::activate(ObjectStore::Transaction& t) p != replay_queue.end(); p++) { if (p->first <= info.last_update) { - dout(10) << "activate will WRNOOP " << p->first << " " << *p->second << endl; + dout(10) << "activate will WRNOOP " << p->first << " " << *p->second << dendl; replay.push_back(p->second); continue; } @@ -959,9 +959,9 @@ void PG::activate(ObjectStore::Transaction& t) dout(10) << "activate replay " << p->first << " skipping " << c.version+1 - p->first.version << " ops" - << endl; + << dendl; } - dout(10) << "activate replay " << p->first << " " << *p->second << endl; + dout(10) << "activate replay " << p->first << " " << *p->second << dendl; replay.push_back(p->second); c = p->first; } @@ -979,7 +979,7 @@ void PG::activate(ObjectStore::Transaction& t) */ void PG::clean_up_local(ObjectStore::Transaction& t) { - dout(10) << "clean_up_local" << endl; + dout(10) << "clean_up_local" << dendl; assert(info.last_update >= log.bottom); // otherwise we need some help! @@ -1004,7 +1004,7 @@ void PG::clean_up_local(ObjectStore::Transaction& t) if (p->is_delete()) { if (s.count(p->oid)) { dout(10) << " deleting " << p->oid - << " when " << p->version << endl; + << " when " << p->version << dendl; t.remove(p->oid); } s.erase(p->oid); @@ -1017,7 +1017,7 @@ void PG::clean_up_local(ObjectStore::Transaction& t) for (set::iterator i = s.begin(); i != s.end(); i++) { - dout(10) << " deleting stray " << *i << endl; + dout(10) << " deleting stray " << *i << dendl; t.remove(*i); } @@ -1032,7 +1032,7 @@ void PG::clean_up_local(ObjectStore::Transaction& t) if (p->is_delete()) { dout(10) << " deleting " << p->oid - << " when " << p->version << endl; + << " when " << p->version << dendl; t.remove(p->oid); } else { // keep old(+missing) objects, just for kicks. @@ -1059,12 +1059,12 @@ bool PG::do_recovery() { dout(-10) << "do_recovery pulling " << objects_pulling.size() << " in pg, " << osd->num_pulling << "/" << g_conf.osd_max_pull << " total" - << endl; - dout(10) << "do_recovery " << missing << endl; + << dendl; + dout(10) << "do_recovery " << missing << dendl; // can we slow down on this PG? if (osd->num_pulling >= g_conf.osd_max_pull && !objects_pulling.empty()) { - dout(-10) << "do_recovery already pulling max, waiting" << endl; + dout(-10) << "do_recovery already pulling max, waiting" << dendl; return true; } @@ -1079,7 +1079,7 @@ bool PG::do_recovery() dout(10) << "do_recovery " << *log.requested_to << (objects_pulling.count(latest->oid) ? " (pulling)":"") - << endl; + << dendl; if (latest->is_update() && !objects_pulling.count(latest->oid) && @@ -1092,7 +1092,7 @@ bool PG::do_recovery() } if (!objects_pulling.empty()) { - dout(7) << "do_recovery requested everything, still waiting" << endl; + dout(7) << "do_recovery requested everything, still waiting" << dendl; return false; } @@ -1102,7 +1102,7 @@ bool PG::do_recovery() if (is_primary()) { // i am primary - dout(7) << "do_recovery complete, cleaning strays" << endl; + dout(7) << "do_recovery complete, cleaning strays" << dendl; clean_set.insert(osd->whoami); if (is_all_clean()) { state_set(PG::STATE_CLEAN); @@ -1110,7 +1110,7 @@ bool PG::do_recovery() } } else { // tell primary - dout(7) << "do_recovery complete, telling primary" << endl; + dout(7) << "do_recovery complete, telling primary" << dendl; list ls; ls.push_back(info); osd->messenger->send_message(new MOSDPGNotify(osd->osdmap->get_epoch(), @@ -1123,7 +1123,7 @@ bool PG::do_recovery() void PG::do_peer_recovery() { - dout(10) << "do_peer_recovery" << endl; + dout(10) << "do_peer_recovery" << dendl; for (unsigned i=0; i::iterator p = stray_set.begin(); p != stray_set.end(); p++) { - dout(10) << "sending PGRemove to osd" << *p << endl; + dout(10) << "sending PGRemove to osd" << *p << dendl; set ls; ls.insert(info.pgid); MOSDPGRemove *m = new MOSDPGRemove(osd->osdmap->get_epoch(), ls); @@ -1174,7 +1174,7 @@ void PG::clean_replicas() void PG::write_log(ObjectStore::Transaction& t) { - dout(10) << "write_log" << endl; + dout(10) << "write_log" << dendl; // assemble buffer bufferlist bl; @@ -1206,11 +1206,11 @@ void PG::write_log(ObjectStore::Transaction& t) void PG::trim_ondisklog_to(ObjectStore::Transaction& t, eversion_t v) { - dout(15) << " trim_ondisk_log_to v " << v << endl; + dout(15) << " trim_ondisk_log_to v " << v << dendl; map::iterator p = ondisklog.block_map.begin(); while (p != ondisklog.block_map.end()) { - dout(15) << " " << p->first << " -> " << p->second << endl; + dout(15) << " " << p->first << " -> " << p->second << dendl; p++; if (p == ondisklog.block_map.end() || p->second > v) { // too far! @@ -1218,13 +1218,13 @@ void PG::trim_ondisklog_to(ObjectStore::Transaction& t, eversion_t v) break; } } - dout(15) << " * " << p->first << " -> " << p->second << endl; + dout(15) << " * " << p->first << " -> " << p->second << dendl; if (p == ondisklog.block_map.begin()) return; // can't trim anything! // we can trim! off_t trim = p->first; - dout(10) << " trimming ondisklog to [" << ondisklog.bottom << "," << ondisklog.top << ")" << endl; + dout(10) << " trimming ondisklog to [" << ondisklog.bottom << "," << ondisklog.top << ")" << dendl; ondisklog.bottom = trim; @@ -1240,7 +1240,7 @@ void PG::trim_ondisklog_to(ObjectStore::Transaction& t, eversion_t v) void PG::append_log(ObjectStore::Transaction& t, PG::Log::Entry& logentry, eversion_t trim_to) { - dout(10) << "append_log " << ondisklog.top << " " << logentry << endl; + dout(10) << "append_log " << ondisklog.top << " " << logentry << dendl; // write entry on disk bufferlist bl; @@ -1260,13 +1260,13 @@ void PG::append_log(ObjectStore::Transaction& t, PG::Log::Entry& logentry, // trim? if (trim_to > log.bottom) { - dout(10) << " trimming " << log << " to " << trim_to << endl; + dout(10) << " trimming " << log << " to " << trim_to << dendl; log.trim(t, trim_to); info.log_bottom = log.bottom; info.log_backlog = log.backlog; trim_ondisklog_to(t, trim_to); } - dout(10) << " ondisklog [" << ondisklog.bottom << "," << ondisklog.top << ")" << endl; + dout(10) << " ondisklog [" << ondisklog.bottom << "," << ondisklog.top << ")" << dendl; } void PG::read_log(ObjectStore *store) @@ -1279,7 +1279,7 @@ void PG::read_log(ObjectStore *store) r = store->collection_getattr(info.pgid, "ondisklog_top", &ondisklog.top, sizeof(ondisklog.top)); assert(r == sizeof(ondisklog.top)); - dout(10) << "read_log [" << ondisklog.bottom << "," << ondisklog.top << ")" << endl; + dout(10) << "read_log [" << ondisklog.bottom << "," << ondisklog.top << ")" << dendl; log.backlog = info.log_backlog; log.bottom = info.log_bottom; @@ -1294,14 +1294,14 @@ void PG::read_log(ObjectStore *store) assert(log.log.empty()); while (pos < ondisklog.top) { bl.copy(pos-ondisklog.bottom, sizeof(e), (char*)&e); - dout(10) << "read_log " << pos << " " << e << endl; + dout(10) << "read_log " << pos << " " << e << dendl; if (e.version > log.bottom || log.backlog) { // ignore items below log.bottom if (pos % 4096 == 0) ondisklog.block_map[pos] = e.version; log.log.push_back(e); } else { - dout(10) << "read_log ignoring entry at " << pos << endl; + dout(10) << "read_log ignoring entry at " << pos << dendl; } if (g_conf.osd_pad_pg_log) // pad to 4k, until i fix ebofs reallocation crap. FIXME. -- 2.39.5