From: sage Date: Fri, 10 Jun 2005 18:43:02 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: v0.1~2089 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=986830aa21d818ad7448ffff2b4e00c12be268cb;p=ceph.git *** empty log message *** git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@292 29311d96-e01e-0410-9327-a35deaab8ce9 --- diff --git a/ceph/config.cc b/ceph/config.cc index 78e75bab1ac2..af51bc015ab5 100644 --- a/ceph/config.cc +++ b/ceph/config.cc @@ -39,12 +39,13 @@ md_config_t g_conf = { mds_log_max_trimming: 16, mds_log_read_inc: 65536, mds_log_before_reply: true, - mds_log_flush_on_shutdown: true, + mds_log_flush_on_shutdown: false, //true, mds_bal_replicate_threshold: 500, mds_bal_unreplicate_threshold: 200, mds_bal_interval: 200, + mds_flush_on_shutdown: true, mds_verify_export_dirauth: true, @@ -108,18 +109,26 @@ void parse_config_options(int argc, char **argv, g_conf.num_client = atoi(argv[++i]); else if (strcmp(argv[i], "--numosd") == 0) g_conf.num_osd = atoi(argv[++i]); + else if (strcmp(argv[i], "--debug") == 0) g_conf.debug = atoi(argv[++i]); + else if (strcmp(argv[i], "--mds_cache_size") == 0) g_conf.mds_cache_size = atoi(argv[++i]); else if (strcmp(argv[i], "--mds_log_max_len") == 0) g_conf.mds_log_max_len = atoi(argv[++i]); else if (strcmp(argv[i], "--mds_log_max_trimming") == 0) g_conf.mds_log_max_trimming = atoi(argv[++i]); + else if (strcmp(argv[i], "--mds_flush_on_shutdown") == 0) + g_conf.mds_flush_on_shutdown = atoi(argv[++i]); else if (strcmp(argv[i], "--mds_log_flush_on_shutdown") == 0) g_conf.mds_log_flush_on_shutdown = atoi(argv[++i]); else if (strcmp(argv[i], "--mds_bal_interval") == 0) g_conf.mds_bal_interval = atoi(argv[++i]); + + else if (strcmp(argv[i], "--osd_fsync") == 0) + g_conf.osd_fsync = atoi(argv[++i]); + else { //cout << "passing arg " << argv[i] << endl; nargv[nargc++] = argv[i]; diff --git a/ceph/config.h b/ceph/config.h index aefc78b704b0..77dbd8196c6e 100644 --- a/ceph/config.h +++ b/ceph/config.h @@ -37,6 +37,7 @@ struct md_config_t { float mds_bal_unreplicate_threshold; int mds_bal_interval; + bool mds_flush_on_shutdown; bool mds_verify_export_dirauth; // debug flag // osd diff --git a/ceph/mds/MDCache.cc b/ceph/mds/MDCache.cc index 1f89fd3a639b..b4b11b513799 100644 --- a/ceph/mds/MDCache.cc +++ b/ceph/mds/MDCache.cc @@ -523,23 +523,20 @@ bool MDCache::trim(__int32_t max) { void MDCache::shutdown_start() { - dout(1) << "shutdown_start: forcing unsync, unlock of everything" << endl; + dout(1) << "shutdown_start" << endl; - // walk cache - bool didsomething = false; - for (hash_map::iterator it = inode_map.begin(); - it != inode_map.end(); - it++) { - CInode *in = it->second; + if (g_conf.mds_commit_on_shutdown) { + dout(1) << "shutdown_start committing all dirty dirs" << endl; - // commit any dirty dir that's ours - if (in->is_dir() && in->dir && in->dir->is_auth() && in->dir->is_dirty()) - mds->mdstore->commit_dir(in->dir, NULL); - - //drop locks? - if (in->is_auth()) { - //if (in->is_syncbyme()) inode_sync_release(in); - //if (in->is_lockbyme()) inode_lock_release(in); + for (hash_map::iterator it = inode_map.begin(); + it != inode_map.end(); + it++) { + CInode *in = it->second; + + // commit any dirty dir that's ours + if (in->is_dir() && in->dir && in->dir->is_auth() && in->dir->is_dirty()) + mds->mdstore->commit_dir(in->dir, NULL); + } } @@ -611,7 +608,8 @@ bool MDCache::shutdown_pass() assert(inode_map.size() == lru.lru_get_size()); // done? - if ((lru.lru_get_size() == 0 || g_conf.mds_log_flush_on_shutdown == false) && + if ((lru.lru_get_size() == 0 || + (g_conf.mds_commit_on_shutdown == false && g_conf.mds_log_flush_on_shutdown == false)) && !mds->filer->is_active()) { if (mds->get_nodeid() != 0) { dout(7) << "done, sending shutdown_finish" << endl; diff --git a/ceph/mds/MDS.cc b/ceph/mds/MDS.cc index 4d36d4efec64..c63abd45268c 100644 --- a/ceph/mds/MDS.cc +++ b/ceph/mds/MDS.cc @@ -458,7 +458,7 @@ void MDS::handle_client_mount(MClientMount *m) return; } else { // fake out idalloc (reset, pretend loaded) - mds->idalloc->reset(); + idalloc->reset(); } }