mirror of
https://github.com/ceph/ceph
synced 2025-01-18 17:12:29 +00:00
PG: remove old log when we upgrade log version
Otherwise the log_oid will be non-empty and the next boot will cause us to try to upgrade again. Fixes: #6057 Signed-off-by: Samuel Just <sam.just@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
00080d785f
commit
1f851cb248
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user