dout(10) << "pgid " << pgid << " coll " << coll_t(pgid) << dendl;
bufferlist bl;
- epoch_t map_epoch = PG::peek_map_epoch(store, pgid, &bl);
+ epoch_t map_epoch = 0;
+ int r = PG::peek_map_epoch(store, pgid, &map_epoch, &bl);
+ if (r < 0) {
+ derr << __func__ << " unable to peek at " << pgid << " metadata, skipping"
+ << dendl;
+ continue;
+ }
PG *pg = NULL;
if (map_epoch > 0) {
return false;
}
-epoch_t PG::peek_map_epoch(ObjectStore *store,
- spg_t pgid,
- bufferlist *bl)
+int PG::peek_map_epoch(ObjectStore *store,
+ spg_t pgid,
+ epoch_t *pepoch,
+ bufferlist *bl)
{
coll_t coll(pgid);
ghobject_t legacy_infos_oid(OSD::make_infos_oid());
bp = values[epoch_key].begin();
::decode(cur_epoch, bp);
- return cur_epoch;
+ *pepoch = cur_epoch;
+ return 0;
}
void PG::write_if_dirty(ObjectStore::Transaction& t)
__u8 &);
void read_state(ObjectStore *store, bufferlist &bl);
static bool _has_removal_flag(ObjectStore *store, spg_t pgid);
- static epoch_t peek_map_epoch(ObjectStore *store, spg_t pgid, bufferlist *bl);
+ static int peek_map_epoch(ObjectStore *store, spg_t pgid,
+ epoch_t *pepoch, bufferlist *bl);
void update_snap_map(
const vector<pg_log_entry_t> &log_entries,
ObjectStore::Transaction& t);
ghobject_t pgmeta_oid(info.pgid.make_pgmeta_oid());
bufferlist bl;
- PG::peek_map_epoch(fs, pgid, &bl);
+ epoch_t map_epoch = 0;
+ int r = PG::peek_map_epoch(fs, pgid, &map_epoch, &bl);
+ if (r < 0)
+ cerr << __func__ << " warning: peek_map_epoch reported error" << std::endl;
map<epoch_t,pg_interval_t> past_intervals;
__u8 struct_v;
- int r = PG::read_info(fs, pgid, coll, bl, info, past_intervals, struct_v);
+ r = PG::read_info(fs, pgid, coll, bl, info, past_intervals, struct_v);
if (r < 0) {
cerr << __func__ << " error on read_info " << cpp_strerror(r) << std::endl;
return r;
}
bufferlist bl;
- map_epoch = PG::peek_map_epoch(fs, pgid, &bl);
+ map_epoch = 0;
+ ret = PG::peek_map_epoch(fs, pgid, &map_epoch, &bl);
+ if (ret < 0)
+ cerr << "peek_map_epoch reports error" << std::endl;
if (debug)
cerr << "map_epoch " << map_epoch << std::endl;