#define dout_subsys ceph_subsys_osd
-//////////////////// PGLog ////////////////////
+//////////////////// PGLog::IndexedLog ////////////////////
void PGLog::IndexedLog::split_into(
pg_t child_pgid,
//////////////////// PGLog ////////////////////
+void PGLog::clear() {
+ ondisklog.zero();
+ ondisklog.has_checksums = true;
+ ondisklog.divergent_priors.clear();
+ missing.clear();
+ log.zero();
+}
+
void PGLog::clear_info_log(
pg_t pgid,
const hobject_t &infos_oid,
*
* return true if entry is not divergent.
*/
-bool PGLog::merge_old_entry(ObjectStore::Transaction& t, pg_log_entry_t& oe, 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, bool &dirty_log)
{
if (oe.soid > info.last_backfill) {
dout(20) << "merge_old_entry had " << oe << " : beyond last_backfill" << dendl;
IndexedLog log;
public:
+
+ void clear();
+
//////////////////// get or set missing ////////////////////
const pg_missing_t& get_missing() const { return missing; }
pg_missing_t& omissing, int from);
protected:
- bool merge_old_entry(ObjectStore::Transaction& t, pg_log_entry_t& oe,
- pg_info_t& info, list<hobject_t>& remove_snap, bool &dirty_log);
+ 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);
public:
void rewind_divergent_log(ObjectStore::Transaction& t, eversion_t newhead,
pg_info_t &info, list<hobject_t>& remove_snap,