]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: preload the default plugins in the mon 2356/head
authorLoic Dachary <loic-201408@dachary.org>
Fri, 29 Aug 2014 16:13:08 +0000 (18:13 +0200)
committerLoic Dachary <loic-201408@dachary.org>
Fri, 29 Aug 2014 17:26:33 +0000 (19:26 +0200)
The commit 164f1a1959a863848319585fa752250c7b261381 preloads the
jerasure plugin 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/mon/mkfs.sh

index 4e84b4d0831630a3ec6c8301e6508d0567daa1a9..47b6913b77721e49115993d773287acfc68aac00 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;
@@ -184,6 +186,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;
@@ -416,6 +433,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 33e3fbafefb036a3f9bf26b79d4d0ce8bd106dd3..035bb596e15e389b77efb28f36e8187bae5d9749 100755 (executable)
@@ -43,6 +43,7 @@ function mon_mkfs() {
         --id $MON_ID \
         --fsid $fsid \
         --mkfs \
+        --osd-pool-default-erasure-code-directory=.libs \
         --mon-data=$MON_DIR \
         --mon-initial-members=$MON_ID \
         --mon-host=$MONA \
@@ -54,6 +55,7 @@ function mon_run() {
         --id $MON_ID \
         --chdir= \
         --mon-data=$MON_DIR \
+        --osd-pool-default-erasure-code-directory=.libs \
         --log-file=$MON_DIR/log \
         --mon-cluster-log-file=$MON_DIR/log \
         --run-dir=$MON_DIR \
@@ -76,6 +78,7 @@ function auth_none() {
 
     ./ceph-mon \
         --id $MON_ID \
+        --osd-pool-default-erasure-code-directory=.libs \
         --mon-data=$MON_DIR \
         --extract-monmap $MON_DIR/monmap
 
@@ -136,6 +139,7 @@ function makedir() {
     ./ceph-mon \
         --id $MON_ID \
         --mkfs \
+        --osd-pool-default-erasure-code-directory=.libs \
         --mon-data=$toodeep 2>&1 | tee $DIR/makedir.log
     grep 'toodeep.*No such file' $DIR/makedir.log > /dev/null
     rm $DIR/makedir.log