Merge pull request #10405 from athanatos/wip-ec-pg-log

osd: fixups to explicitly persistenting missing sets

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
Josh Durgin 2016-07-22 15:11:08 -07:00 committed by GitHub
commit f84be8f6a6
3 changed files with 8 additions and 12 deletions

View File

@ -320,7 +320,7 @@ void PG::proc_master_log(
assert(cct->_conf->osd_find_best_info_ignore_history_les ||
info.last_epoch_started >= info.history.last_epoch_started);
peer_missing[from].swap(omissing);
peer_missing[from].claim(omissing);
}
void PG::proc_replica_log(
@ -344,7 +344,7 @@ void PG::proc_replica_log(
dout(20) << " after missing " << i->first << " need " << i->second.need
<< " have " << i->second.have << dendl;
}
peer_missing[from].swap(omissing);
peer_missing[from].claim(omissing);
}
bool PG::proc_replica_info(
@ -7709,7 +7709,7 @@ boost::statechart::result PG::RecoveryState::WaitUpThru::react(const MLogRec& lo
{
dout(10) << "Noting missing from osd." << logevt.from << dendl;
PG *pg = context< RecoveryMachine >().pg;
pg->peer_missing[logevt.from].swap(logevt.msg->missing);
pg->peer_missing[logevt.from].claim(logevt.msg->missing);
pg->peer_info[logevt.from] = logevt.msg->info;
return discard_event();
}

View File

@ -2800,7 +2800,7 @@ public:
template <typename F>
void get_changed(F &&f) const {}
void flush() {}
void clean() {
bool is_clean() const {
return true;
}
};
@ -2884,13 +2884,10 @@ public:
return item.have;
}
void swap(pg_missing_set& o) {
for (auto &&i: missing)
tracker.changed(i.first);
void claim(pg_missing_set& o) {
static_assert(!TrackChanges, "Can't use claim with TrackChanges");
missing.swap(o.missing);
rmissing.swap(o.rmissing);
for (auto &&i: missing)
tracker.changed(i.first);
}
/*

View File

@ -749,7 +749,7 @@ TEST(pg_missing_t, have_missing)
EXPECT_TRUE(missing.have_missing());
}
TEST(pg_missing_t, swap)
TEST(pg_missing_t, claim)
{
hobject_t oid(object_t("objname"), "key", 123, 456, 0, "");
pg_missing_t missing;
@ -760,8 +760,7 @@ TEST(pg_missing_t, swap)
pg_missing_t other;
EXPECT_FALSE(other.have_missing());
other.swap(missing);
EXPECT_FALSE(missing.have_missing());
other.claim(missing);
EXPECT_TRUE(other.have_missing());
}