Skip to content

Commit 8066068

Browse files
Merge pull request ceph#61674 from connorfawcett/wip-ec-default-fixes
erasure-code: Set reed_sol_van to be the default technique for Jerasure if none is specified.
2 parents bb01a3e + f7cce29 commit 8066068

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

qa/standalone/ceph-helpers.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,7 +2100,6 @@ function test_wait_for_scrub() {
21002100
# @param plugin erasure code plugin
21012101
# @return 0 on success, 1 on error
21022102
#
2103-
21042103
function erasure_code_plugin_exists() {
21052104
local plugin=$1
21062105
local status
@@ -2115,10 +2114,13 @@ function erasure_code_plugin_exists() {
21152114
local status=$?
21162115
if [ $status -eq 0 ]; then
21172116
ceph osd erasure-code-profile rm TESTPROFILE
2118-
elif ! echo $s | grep --quiet "$grepstr" ; then
2117+
elif echo $s | grep --quiet "$grepstr" ; then
2118+
# expected error when the plugin doesn't exist
21192119
status=1
2120-
# display why the string was rejected.
2120+
else
2121+
# any other error means plugin exists but can't initialize
21212122
echo $s
2123+
status=0
21222124
fi
21232125
return $status
21242126
}

src/erasure-code/jerasure/ErasureCodePluginJerasure.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int ErasureCodePluginJerasure::factory(const std::string& directory,
3939
std::string t;
4040
if (profile.find("technique") != profile.end())
4141
t = profile.find("technique")->second;
42-
if (t == "reed_sol_van") {
42+
if (t == "reed_sol_van" || t == "") { // Default!
4343
interface = new ErasureCodeJerasureReedSolomonVandermonde();
4444
} else if (t == "reed_sol_r6_op") {
4545
interface = new ErasureCodeJerasureReedSolomonRAID6();

src/test/erasure-code/TestErasureCodePluginJerasure.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ using namespace std;
2828
TEST(ErasureCodePlugin, factory)
2929
{
3030
ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
31-
ErasureCodeProfile profile;
3231
{
32+
ErasureCodeProfile profile;
33+
profile["technique"] = "doesnotexist";
3334
ErasureCodeInterfaceRef erasure_code;
3435
EXPECT_FALSE(erasure_code);
3536
EXPECT_EQ(-ENOENT, instance.factory("jerasure",

0 commit comments

Comments
 (0)