Merge pull request #4066 from dachary/wip-11144-erasure-code-profile-rm

osd: erasure-code-profile incremental rm before set

Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Samuel Just 2015-03-19 08:52:45 -07:00
commit 3d22b88e49

View File

@ -1325,6 +1325,11 @@ int OSDMap::apply_incremental(const Incremental &inc)
}
// erasure_code_profiles
for (vector<string>::const_iterator i = inc.old_erasure_code_profiles.begin();
i != inc.old_erasure_code_profiles.end();
++i)
erasure_code_profiles.erase(*i);
for (map<string,map<string,string> >::const_iterator i =
inc.new_erasure_code_profiles.begin();
i != inc.new_erasure_code_profiles.end();
@ -1332,11 +1337,6 @@ int OSDMap::apply_incremental(const Incremental &inc)
set_erasure_code_profile(i->first, i->second);
}
for (vector<string>::const_iterator i = inc.old_erasure_code_profiles.begin();
i != inc.old_erasure_code_profiles.end();
++i)
erasure_code_profiles.erase(*i);
// up/down
for (map<int32_t,uint8_t>::const_iterator i = inc.new_state.begin();
i != inc.new_state.end();