Merge pull request #29755 from xiexingguo/wip-inc-recovery-4

osd: do not invalidate clear_regions of missing item at boot

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
Xie Xingguo 2019-08-22 13:48:15 +08:00 committed by GitHub
commit ea216e52f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -1402,7 +1402,7 @@ public:
if (item.is_delete()) {
ceph_assert(missing.may_include_deletes);
}
missing.add(oid, item.need, item.have, item.is_delete());
missing.add(oid, std::move(item));
} else if (p->key().substr(0, 4) == string("dup_")) {
pg_log_dup_t dup;
decode(dup, bp);
@ -1650,7 +1650,7 @@ public:
if (item.is_delete()) {
ceph_assert(missing.may_include_deletes);
}
missing.add(oid, item.need, item.have, item.is_delete());
missing.add(oid, std::move(item));
} else if (p.first.substr(0, 4) == string("dup_")) {
pg_log_dup_t dup;
decode(dup, bp);

View File

@ -4525,6 +4525,12 @@ public:
tracker.changed(oid);
}
void add(const hobject_t& oid, pg_missing_item&& item) {
rmissing[item.need.version] = oid;
missing.insert({oid, std::move(item)});
tracker.changed(oid);
}
void rm(const hobject_t& oid, eversion_t v) {
std::map<hobject_t, item>::iterator p = missing.find(oid);
if (p != missing.end() && p->second.need <= v)