#ifdef PG_DEBUG_REFS
_ref_id_lock("PG::_ref_id_lock"), _ref_id(0),
#endif
- deleting(false), dirty_info(false), dirty_big_info(false), dirty_log(false),
+ deleting(false), dirty_info(false), dirty_big_info(false),
info(p),
info_struct_v(0),
coll(p), log_oid(loid), biginfo_oid(ioid),
// if we have unrecorded dirty state with the lock dropped, there is a bug
assert(!dirty_info);
assert(!dirty_big_info);
- assert(!dirty_log);
dout(30) << "lock" << dendl;
}
void PG::merge_log(ObjectStore::Transaction& t, pg_info_t &oinfo, pg_log_t &olog, int from)
{
list<hobject_t> to_remove;
- pg_log.merge_log(t, oinfo, olog, from, info, to_remove, dirty_log, dirty_info, dirty_big_info);
+ pg_log.merge_log(t, oinfo, olog, from, info, to_remove, dirty_info, dirty_big_info);
for(list<hobject_t>::iterator i = to_remove.begin();
i != to_remove.end();
++i)
void PG::rewind_divergent_log(ObjectStore::Transaction& t, eversion_t newhead)
{
list<hobject_t> to_remove;
- pg_log.rewind_divergent_log(t, newhead, info, to_remove, dirty_log, dirty_info, dirty_big_info);
+ pg_log.rewind_divergent_log(t, newhead, info, to_remove, dirty_info, dirty_big_info);
for(list<hobject_t>::iterator i = to_remove.begin();
i != to_remove.end();
++i)
return cur_epoch;
}
-void PG::write_log(ObjectStore::Transaction& t)
-{
- pg_log.write_log(t, log_oid);
-}
-
void PG::write_if_dirty(ObjectStore::Transaction& t)
{
if (dirty_big_info || dirty_info)
write_info(t);
- if (dirty_log)
- write_log(t);
+ pg_log.write_log(t, log_oid);
}
void PG::trim_peers()
//generic_dout(0) << this << " " << info.pgid << " unlock" << dendl;
assert(!dirty_info);
assert(!dirty_big_info);
- assert(!dirty_log);
_lock.Unlock();
}
void get(const string &tag);
void put(const string &tag);
- bool dirty_info, dirty_big_info, dirty_log;
+ bool dirty_info, dirty_big_info;
public:
// pg state
private:
void write_info(ObjectStore::Transaction& t);
- void write_log(ObjectStore::Transaction& t);
public:
static int _write_info(ObjectStore::Transaction& t, epoch_t epoch,
*
* return true if entry is not divergent.
*/
-bool PGLog::merge_old_entry(ObjectStore::Transaction& t, const pg_log_entry_t& oe, const pg_info_t& info, list<hobject_t>& remove_snap, bool &dirty_log)
+bool PGLog::merge_old_entry(ObjectStore::Transaction& t, const pg_log_entry_t& oe, const pg_info_t& info, list<hobject_t>& remove_snap)
{
if (oe.soid > info.last_backfill) {
dout(20) << "merge_old_entry had " << oe << " : beyond last_backfill" << dendl;
*/
void PGLog::rewind_divergent_log(ObjectStore::Transaction& t, eversion_t newhead,
pg_info_t &info, list<hobject_t>& remove_snap,
- bool &dirty_log, bool &dirty_info, bool &dirty_big_info)
+ bool &dirty_info, bool &dirty_big_info)
{
dout(10) << "rewind_divergent_log truncate divergent future " << newhead << dendl;
assert(newhead > log.tail);
info.last_complete = newhead;
for (list<pg_log_entry_t>::iterator d = divergent.begin(); d != divergent.end(); ++d)
- merge_old_entry(t, *d, info, remove_snap, dirty_log);
+ merge_old_entry(t, *d, info, remove_snap);
dirty_info = true;
dirty_big_info = true;
void PGLog::merge_log(ObjectStore::Transaction& t,
pg_info_t &oinfo, pg_log_t &olog, int fromosd,
pg_info_t &info, list<hobject_t>& remove_snap,
- bool &dirty_log, bool &dirty_info, bool &dirty_big_info)
+ bool &dirty_info, bool &dirty_big_info)
{
dout(10) << "merge_log " << olog << " from osd." << fromosd
<< " into " << log << dendl;
// do we have divergent entries to throw out?
if (olog.head < log.head) {
- rewind_divergent_log(t, olog.head, info, remove_snap, dirty_log, dirty_info, dirty_big_info);
+ rewind_divergent_log(t, olog.head, info, remove_snap, dirty_info, dirty_big_info);
changed = true;
}
// process divergent items
if (!divergent.empty()) {
for (list<pg_log_entry_t>::iterator d = divergent.begin(); d != divergent.end(); ++d)
- merge_old_entry(t, *d, info, remove_snap, dirty_log);
+ merge_old_entry(t, *d, info, remove_snap);
}
changed = true;
protected:
bool merge_old_entry(ObjectStore::Transaction& t, const pg_log_entry_t& oe,
- const pg_info_t& info, list<hobject_t>& remove_snap, bool &dirty_log);
+ const pg_info_t& info, list<hobject_t>& remove_snap);
public:
void rewind_divergent_log(ObjectStore::Transaction& t, eversion_t newhead,
pg_info_t &info, list<hobject_t>& remove_snap,
- bool &dirty_log, bool &dirty_info, bool &dirty_big_info);
+ bool &dirty_info, bool &dirty_big_info);
void merge_log(ObjectStore::Transaction& t, pg_info_t &oinfo, pg_log_t &olog, int from,
pg_info_t &info, list<hobject_t>& remove_snap,
- bool &dirty_log, bool &dirty_info, bool &dirty_big_info);
+ bool &dirty_info, bool &dirty_big_info);
void write_log(ObjectStore::Transaction& t, const hobject_t &log_oid);