From 895bddc5d4dabd2f05c13c343eb0d7457d6f132f Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Fri, 29 Aug 2014 18:13:08 +0200 Subject: [PATCH] erasure-code: preload the default plugins in the mon 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 --- src/ceph_mon.cc | 19 +++++++++++++++++++ src/test/mon/mkfs.sh | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/src/ceph_mon.cc b/src/ceph_mon.cc index 4e84b4d083163..47b6913b77721 100644 --- a/src/ceph_mon.cc +++ b/src/ceph_mon.cc @@ -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); diff --git a/src/test/mon/mkfs.sh b/src/test/mon/mkfs.sh index 33e3fbafefb03..035bb596e15e3 100755 --- a/src/test/mon/mkfs.sh +++ b/src/test/mon/mkfs.sh @@ -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