summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/osd/PG.cc2
-rw-r--r--src/osd/PGLog.h7
2 files changed, 9 insertions, 0 deletions
diff --git a/src/osd/PG.cc b/src/osd/PG.cc
index 00c0c15d557..e06ddbb0e34 100644
--- a/src/osd/PG.cc
+++ b/src/osd/PG.cc
@@ -2438,7 +2438,9 @@ void PG::read_state(ObjectStore *store, bufferlist &bl)
/* We don't want to leave the old format around in case the next log
* write happens to be an append_log()
*/
+ pg_log.mark_log_for_rewrite();
ObjectStore::Transaction t;
+ t.remove(coll_t(), log_oid); // remove old version
pg_log.write_log(t, log_oid);
int r = osd->store->apply_transaction(t);
assert(!r);
diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h
index 955b9c18937..552f9b0cee9 100644
--- a/src/osd/PGLog.h
+++ b/src/osd/PGLog.h
@@ -180,6 +180,13 @@ protected:
divergent_priors.insert(make_pair(version, obj));
dirty_divergent_priors = true;
}
+public:
+ void mark_log_for_rewrite() {
+ mark_dirty_to(eversion_t::max());
+ mark_dirty_from(eversion_t());
+ touched_log = false;
+ }
+protected:
/// DEBUG
set<string> log_keys_debug;