]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: preload the default plugins in the mon 2354/head
authorLoic Dachary <loic-201408@dachary.org>
Fri, 29 Aug 2014 10:06:49 +0000 (12:06 +0200)
committerLoic Dachary <loic-201408@dachary.org>
Fri, 29 Aug 2014 10:12:32 +0000 (12:12 +0200)
The commit 9b802701f78288ba4f706c65b853415c69002d27 preloads the
supported plugins in the OSD. They must also be preloaded in the mon for
the same reasons.

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

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

index 87f829bbbd445cf040197fc9d7dfa1228475420c..5db3253414d690bd60f4ff47e50bccbf797cf0c0 100644 (file)
@@ -43,6 +43,8 @@ using namespace std;
 
 #include "include/assert.h"
 
+#include "erasure-code/ErasureCodePlugin.h"
+
 #define dout_subsys ceph_subsys_mon
 
 Monitor *mon = NULL;
@@ -182,6 +184,21 @@ void usage()
   generic_server_usage();
 }
 
+int preload_erasure_code()
+{
+  string directory = g_conf->osd_pool_default_erasure_code_directory;
+  string plugins = g_conf->osd_erasure_code_plugins;
+  stringstream ss;
+  int r = ErasureCodePluginRegistry::instance().preload(plugins,
+                                                       directory,
+                                                       ss);
+  if (r)
+    derr << ss.str() << dendl;
+  else
+    dout(10) << ss.str() << dendl;
+  return r;
+}
+
 int main(int argc, const char **argv) 
 {
   int err;
@@ -466,6 +483,8 @@ int main(int argc, const char **argv)
     }
     common_init_finish(g_ceph_context);
     global_init_chdir(g_ceph_context);
+    if (preload_erasure_code() < -1)
+      prefork.exit(1);
   }
 
   MonitorDBStore *store = new MonitorDBStore(g_conf->mon_data);
index 7c2c17c9a783a081570986946bfb0dd3f2adc17b..8ad52a09045c440ca4cc4f93ea893b0cc0826093 100755 (executable)
@@ -27,6 +27,9 @@ function run() {
 
     setup $dir || return 1
     run_mon $dir a --public-addr 127.0.0.1 || return 1
+    # check that erasure code plugins are preloaded
+    CEPH_ARGS='' ./ceph --admin-daemon $dir/a/ceph-mon.a.asok log flush || return 1
+    grep 'load: jerasure' $dir/a/log || return 1
     for id in $(seq 0 4) ; do
         run_osd $dir $id || return 1
     done