]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: preload the jerasure plugin variant (sse4,sse3,generic) 2298/head
authorLoic Dachary <loic-201408@dachary.org>
Thu, 21 Aug 2014 12:41:55 +0000 (14:41 +0200)
committerLoic Dachary <loic-201408@dachary.org>
Thu, 21 Aug 2014 12:41:55 +0000 (14:41 +0200)
The preloading of the jerasure plugin ldopen the plugin that is in
charge of selecting the variant optimized for the
CPU (sse4,sse3,generic). The variant plugin itself is not loaded because
it does not happen at load() but when the factory() method is called.

The JerasurePlugin::preload method is modified to call the factory()
method to load jerasure_sse4 or jerasure_sse3 or jerasure_generic as a
side effect.

Indirectly loading another plugin in the factory() method is error prone
and should be moved to the load() method instead. This change should be
done in a separate commit.

http://tracker.ceph.com/issues/9153 Fixes: #9153

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
src/erasure-code/ErasureCodePlugin.cc
src/test/erasure-code/test-erasure-code.sh

index f77041eff941f47e13a4bf5c108a3b2bc0b1cb60..3ce0563829ec0b2ce20e1c867c5c54ef720cdcbd 100644 (file)
@@ -152,6 +152,12 @@ int ErasureCodePluginRegistry::preload(const std::string &plugins,
     int r = load(*i, profile, &plugin, ss);
     if (r)
       return r;
+
+    ErasureCodeInterfaceRef erasure_code;
+    profile["technique"] = "reed_sol_van";
+    r = plugin->factory(profile, &erasure_code);
+    if (r)
+      return r;
   }
   return 0;
 }
index 63663e0a38448af73733d3996f6d16f23bd55a9a..3a1b1a26789e8871cb9675b440deb6a396d21fd8 100755 (executable)
@@ -33,6 +33,7 @@ function run() {
     # check that erasure code plugins are preloaded
     CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
     grep 'load: jerasure' $dir/osd-0.log || return 1
+    grep 'ErasureCodePluginSelectJerasure' $dir/osd-0.log || return 1
     create_erasure_coded_pool || return 1
     FUNCTIONS=${FUNCTIONS:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
     for TEST_function in $FUNCTIONS ; do