Do not assume the log_oid is ine the 'meta' collection.
Signed-off-by: Sage Weil <sage@redhat.com>
ostringstream oss;
if (pg_log.read_log(
- store, coll, log_oid, info,
+ store, coll, META_COLL, log_oid, info,
oss)) {
/* We don't want to leave the old format around in case the next log
* write happens to be an append_log()
t.omap_setkeys(META_COLL, log_oid, keys);
}
-bool PGLog::read_log(ObjectStore *store, coll_t coll, ghobject_t log_oid,
+bool PGLog::read_log(ObjectStore *store, coll_t pg_coll,
+ coll_t log_coll, ghobject_t log_oid,
const pg_info_t &info, map<eversion_t, hobject_t> &divergent_priors,
IndexedLog &log,
pg_missing_t &missing,
// legacy?
struct stat st;
- int r = store->stat(META_COLL, log_oid, &st);
+ int r = store->stat(log_coll, log_oid, &st);
assert(r == 0);
if (st.st_size > 0) {
- read_log_old(store, coll, log_oid, info, divergent_priors, log, missing, oss, log_keys_debug);
+ read_log_old(store, pg_coll, log_oid, info, divergent_priors, log, missing, oss, log_keys_debug);
rewrite_log = true;
} else {
log.tail = info.log_tail;
log.can_rollback_to = info.last_update;
log.rollback_info_trimmed_to = eversion_t();
- ObjectMap::ObjectMapIterator p = store->get_omap_iterator(META_COLL, log_oid);
+ ObjectMap::ObjectMapIterator p = store->get_omap_iterator(log_coll, log_oid);
if (p) for (p->seek_to_first(); p->valid() ; p->next()) {
bufferlist bl = p->value();//Copy bufferlist before creating iterator
bufferlist::iterator bp = bl.begin();
bufferlist bv;
int r = store->getattr(
- coll,
+ pg_coll,
ghobject_t(i->soid, ghobject_t::NO_GEN, info.pgid.shard),
OI_ATTR,
bv);
did.insert(i->second);
bufferlist bv;
int r = store->getattr(
- coll,
+ pg_coll,
ghobject_t(i->second, ghobject_t::NO_GEN, info.pgid.shard),
OI_ATTR,
bv);
set<string> *log_keys_debug
);
- bool read_log(ObjectStore *store, coll_t coll, ghobject_t log_oid,
+ bool read_log(ObjectStore *store, coll_t pg_coll,
+ coll_t log_coll, ghobject_t log_oid,
const pg_info_t &info, ostringstream &oss) {
return read_log(
- store, coll, log_oid, info, divergent_priors,
+ store, pg_coll, log_coll, log_oid, info, divergent_priors,
log, missing, oss,
(pg_log_debug ? &log_keys_debug : 0));
}
/// return true if the log should be rewritten
- static bool read_log(ObjectStore *store, coll_t coll, ghobject_t log_oid,
+ static bool read_log(ObjectStore *store, coll_t pg_coll,
+ coll_t log_coll, ghobject_t log_oid,
const pg_info_t &info, map<eversion_t, hobject_t> &divergent_priors,
IndexedLog &log,
pg_missing_t &missing, ostringstream &oss,
map<eversion_t, hobject_t> divergent_priors;
try {
ostringstream oss;
- PGLog::read_log(fs, coll, log_oid, info, divergent_priors, log, missing, oss);
+ PGLog::read_log(fs, coll, META_COLL, log_oid, info, divergent_priors, log, missing, oss);
if (debug && oss.str().size())
cerr << oss.str() << std::endl;
}