return 0
}
+function TEST_ec_profile_deprecated_plugin_warning() {
+ local dir=$1
+
+ setup $dir || return 1
+ run_mon $dir a || return 1
+ run_mgr $dir x || return 1
+ for id in $(seq 0 2) ; do
+ run_osd $dir $id || return 1
+ done
+ create_rbd_pool || return 1
+ wait_for_clean || return 1
+
+ echo "Starting test for deprecated EC plugin health warning"
+
+ # Create a clay profile (deprecated)
+ ceph osd erasure-code-profile set clay plugin=clay k=3 m=2 || return 1
+
+ # Create a shec profile (deprecated)
+ ceph osd erasure-code-profile set shec plugin=shec k=4 m=2 c=2 || return 1
+
+ # Create a non-reed_sol_van jerasure profile (deprecated)
+ ceph osd erasure-code-profile set jerasure-cauchy plugin=jerasure k=3 m=2 technique=cauchy_good || return 1
+
+ # Create a reed_sol_van jerasure profile (not deprecated)
+ ceph osd erasure-code-profile set jerasure-rsv plugin=jerasure k=3 m=2 technique=reed_sol_van || return 1
+
+ CEPH_ARGS='' ceph --admin-daemon $(get_asok_path mon.a) log flush || return 1
+ sleep 10
+ grep -F "1 or more EC profiles are using a plugin and/or technique that are deprecated" $dir/mon.a.log || return 1
+ grep "clay.*deprecated plugin 'clay'" $dir/mon.a.log || return 1
+ grep "shec.*deprecated plugin 'shec'" $dir/mon.a.log || return 1
+ grep "jerasure-cauchy.*deprecated jerasure technique 'cauchy_good'" $dir/mon.a.log || return 1
+
+ ! grep "jerasure-rsv.*deprecated" $dir/mon.a.log || return 1
+
+ teardown $dir || return 1
+ return 0
+}
+
+
main test-erasure-code-plugins "$@"
void HealthMonitor::check_erasure_code_profiles(health_check_map_t *checks)
{
- list<string> details;
+ list<string> blaum_roth_details;
+ list<string> deprecated_details;
//This is a loop that will go through all the erasure code profiles
for (auto& erasure_code_profile : mon.osdmon()->osdmap.get_erasure_code_profiles()) {
if ((w <= 2) || (w >= 256)) {
ostringstream ds;
ds << "The value of w must be greater than 2 and less than 256";
- details.push_back(ds.str());
+ blaum_roth_details.push_back(ds.str());
}
if (!is_prime(w + 1)) {
ostringstream ds;
ds << "w+1="<< w+1 << " for the EC profile " << erasure_code_profile.first
<< " is not prime and could lead to data corruption";
- details.push_back(ds.str());
+ blaum_roth_details.push_back(ds.str());
+ }
+ }
+ }
+
+ // Check for plugins and techniques that are deprecated in Umbrella
+ auto plugin = erasure_code_profile.second.find("plugin");
+ if (plugin != erasure_code_profile.second.end()) {
+ const string& plugin_name = erasure_code_profile.second.at("plugin");
+
+ // Check if plugin is clay, shec (including legacy variants) or legacy jerasure
+ if (plugin_name == "clay" ||
+ plugin_name == "shec" ||
+ plugin_name == "shec_generic" ||
+ plugin_name == "shec_sse3" ||
+ plugin_name == "shec_sse4" ||
+ plugin_name == "shec_neon" ||
+ plugin_name == "jerasure_generic" ||
+ plugin_name == "jerasure_sse3" ||
+ plugin_name == "jerasure_sse4" ||
+ plugin_name == "jerasure_neon") {
+ ostringstream ds;
+ ds << "EC profile '" << erasure_code_profile.first
+ << "' uses deprecated plugin '" << plugin_name << "'";
+ deprecated_details.push_back(ds.str());
+ }
+ // Check if plugin is jerasure with non-reed_sol_van technique
+ else if (plugin_name == "jerasure") {
+ auto technique_it = erasure_code_profile.second.find("technique");
+ if (technique_it != erasure_code_profile.second.end()) {
+ const string& technique_name = erasure_code_profile.second.at("technique");
+ if (technique_name != "reed_sol_van") {
+ ostringstream ds;
+ ds << "EC profile '" << erasure_code_profile.first
+ << "' uses deprecated jerasure technique '" << technique_name << "'";
+ deprecated_details.push_back(ds.str());
+ }
}
}
}
}
- if (!details.empty()) {
+
+ if (!blaum_roth_details.empty()) {
ostringstream ss;
ss << "1 or more EC profiles have a w value such that w+1 is not prime."
<< " This can result in data corruption";
- auto &d = checks->add("BLAUM_ROTH_W_IS_NOT_PRIME", HEALTH_WARN, ss.str(), details.size());
- d.detail.swap(details);
+ auto &d = checks->add("BLAUM_ROTH_W_IS_NOT_PRIME", HEALTH_WARN, ss.str(), blaum_roth_details.size());
+ d.detail.swap(blaum_roth_details);
+ }
+
+ if (!deprecated_details.empty()) {
+ ostringstream ss;
+ ss << "1 or more EC profiles are using a plugin and/or technique that are "
+ << "deprecated in the Umbrella release. This will be unsupported in the V release. "
+ << "Migrate objects to a new pool that uses a supported plugin and technique. ";
+ auto &d = checks->add("DEPRECATED_EC_PLUGIN", HEALTH_WARN, ss.str(), deprecated_details.size());
+ d.detail.swap(deprecated_details);
}
}