pg_missing_t missing;
pg_interval_map_t past_intervals;
- epoch_t get_epoch() { return epoch; }
- spg_t get_pgid() { return spg_t(info.pgid.pgid, to); }
- epoch_t get_query_epoch() { return query_epoch; }
+ epoch_t get_epoch() const { return epoch; }
+ spg_t get_pgid() const { return spg_t(info.pgid.pgid, to); }
+ epoch_t get_query_epoch() const { return query_epoch; }
MOSDPGLog() : Message(MSG_OSD_PG_LOG, HEAD_VERSION, COMPAT_VERSION) {
set_priority(CEPH_MSG_PRIO_HIGH);
public:
const char *get_type_name() const { return "PGlog"; }
void print(ostream& out) const {
+ // NOTE: log is not const, but operator<< doesn't touch fields
+ // swapped out by OSD code.
out << "pg_log(" << info.pgid << " epoch " << epoch
<< " log " << log
<< " query_epoch " << query_epoch << ")";
void OSD::handle_pg_log(OpRequestRef op)
{
- MOSDPGLog *m = (MOSDPGLog*) op->get_req();
+ MOSDPGLog *m = static_cast<MOSDPGLog*>(op->get_nonconst_req());
assert(m->get_type() == MSG_OSD_PG_LOG);
dout(7) << "handle_pg_log " << *m << " from " << m->get_source() << dendl;
void PG::proc_replica_log(
ObjectStore::Transaction& t,
- pg_info_t &oinfo, pg_log_t &olog, pg_missing_t& omissing,
+ pg_info_t &oinfo,
+ const pg_log_t &olog,
+ pg_missing_t& omissing,
pg_shard_t from)
{
dout(10) << "proc_replica_log for osd." << from << ": "
PG *pg = context< RecoveryMachine >().pg;
ldout(pg->cct, 10) << "received log from " << logevt.from << dendl;
ObjectStore::Transaction* t = context<RecoveryMachine>().get_cur_transaction();
- pg->merge_log(*t,logevt.msg->info, logevt.msg->log, logevt.from);
+ pg->merge_log(*t, logevt.msg->info, logevt.msg->log, logevt.from);
assert(pg->pg_log.get_head() == pg->info.last_update);
return discard_event();
virtual void calc_trim_to() = 0;
- void proc_replica_log(ObjectStore::Transaction& t, pg_info_t &oinfo, pg_log_t &olog,
+ void proc_replica_log(ObjectStore::Transaction& t,
+ pg_info_t &oinfo, const pg_log_t &olog,
pg_missing_t& omissing, pg_shard_t from);
void proc_master_log(ObjectStore::Transaction& t, pg_info_t &oinfo, pg_log_t &olog,
pg_missing_t& omissing, pg_shard_t from);
void PGLog::proc_replica_log(
ObjectStore::Transaction& t,
- pg_info_t &oinfo, const pg_log_t &olog, pg_missing_t& omissing,
+ pg_info_t &oinfo,
+ const pg_log_t &olog,
+ pg_missing_t& omissing,
pg_shard_t from) const
{
dout(10) << "proc_replica_log for osd." << from << ": "
log.last_requested = 0;
}
- void proc_replica_log(ObjectStore::Transaction& t, pg_info_t &oinfo, const pg_log_t &olog,
+ void proc_replica_log(ObjectStore::Transaction& t,
+ pg_info_t &oinfo,
+ const pg_log_t &olog,
pg_missing_t& omissing, pg_shard_t from) const;
protected:
pg_info_t &info, LogEntryHandler *rollbacker,
bool &dirty_info, bool &dirty_big_info);
- void merge_log(ObjectStore::Transaction& t, pg_info_t &oinfo, pg_log_t &olog,
+ void merge_log(ObjectStore::Transaction& t,
+ pg_info_t &oinfo,
+ pg_log_t &olog,
pg_shard_t from,
pg_info_t &info, LogEntryHandler *rollbacker,
bool &dirty_info, bool &dirty_big_info);