diff options
author | Sage Weil <sage@inktank.com> | 2012-12-20 17:43:51 -0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-12-20 17:43:51 -0800 |
commit | ae26432de8fc05fbff2dac443cc9df6914fb8ec9 (patch) | |
tree | aa6eaf4076df55447f7da85c6ba9430549295180 | |
parent | 719679ea11a67917154fcc479a6e9b819a4b8d83 (diff) | |
parent | accce830514c6b099eb0e00a8ae34396d14565a3 (diff) | |
download | ceph-ae26432de8fc05fbff2dac443cc9df6914fb8ec9.tar.gz |
Merge remote-tracking branch 'gh/next'
-rw-r--r-- | src/log/Log.cc | 2 | ||||
-rw-r--r-- | src/osd/OSD.h | 9 | ||||
-rw-r--r-- | src/osd/ReplicatedPG.cc | 21 | ||||
-rw-r--r-- | src/rgw/rgw_formats.cc | 1 | ||||
-rw-r--r-- | src/rgw/rgw_main.cc | 21 | ||||
-rw-r--r-- | src/test/cli/ceph/help.t | 3 | ||||
-rw-r--r-- | src/tools/ceph.cc | 3 |
7 files changed, 15 insertions, 45 deletions
diff --git a/src/log/Log.cc b/src/log/Log.cc index 32d8be79c45..51a340ffcb1 100644 --- a/src/log/Log.cc +++ b/src/log/Log.cc @@ -136,13 +136,13 @@ void Log::set_stderr_level(int log, int crash) void Log::submit_entry(Entry *e) { pthread_mutex_lock(&m_queue_mutex); - pthread_cond_signal(&m_cond); // wait for flush to catch up while (m_new.m_len > m_max_new) pthread_cond_wait(&m_cond, &m_queue_mutex); m_new.enqueue(e); + pthread_cond_signal(&m_cond); pthread_mutex_unlock(&m_queue_mutex); } diff --git a/src/osd/OSD.h b/src/osd/OSD.h index ce387391180..211a4c1fe7c 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -501,17 +501,8 @@ public: epoch_t last_sent_epoch; Connection *con; std::map<void *, pg_t> watches; - std::map<void *, entity_name_t> notifs; Session() : auid(-1), last_sent_epoch(0), con(0) {} - void add_notif(void *n, entity_name_t& name) { - notifs[n] = name; - } - void del_notif(void *n) { - std::map<void *, entity_name_t>::iterator iter = notifs.find(n); - if (iter != notifs.end()) - notifs.erase(iter); - } }; private: diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 4c6c481cc65..612dc4a8677 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1608,6 +1608,7 @@ void ReplicatedPG::remove_notify(ObjectContext *obc, Watch::Notification *notif) obc->notifs.erase(niter); put_object_context(obc); + delete notif; } void ReplicatedPG::remove_watchers_and_notifies() @@ -3396,17 +3397,15 @@ void ReplicatedPG::do_osd_op_effects(OpContext *ctx) } // ack any pending notifies - map<void*, entity_name_t>::iterator p = session->notifs.begin(); - while (p != session->notifs.end()) { - Watch::Notification *notif = (Watch::Notification *)p->first; - entity_name_t by = p->second; + map<Watch::Notification *, bool>::iterator p = obc->notifs.begin(); + while (p != obc->notifs.end()) { + Watch::Notification *notif = p->first; + entity_name_t by = entity; p++; - if (notif->obc == obc) { - dout(10) << " acking pending notif " << notif->id << " by " << by << dendl; - session->del_notif(notif); - // TODOSAM: osd->osd-> not good - osd->osd->ack_notification(entity, notif, obc, this); - } + assert(notif->obc == obc); + dout(10) << " acking pending notif " << notif->id << " by " << by << dendl; + // TODOSAM: osd->osd-> not good + osd->osd->ack_notification(entity, notif, obc, this); } } @@ -3435,7 +3434,6 @@ void ReplicatedPG::do_osd_op_effects(OpContext *ctx) watch_info_t& w = obc->obs.oi.watchers[q->first]; notif->add_watcher(name, Watch::WATCHER_NOTIFIED); // adding before send_message to avoid race - s->add_notif(notif, name); MWatchNotify *notify_msg = new MWatchNotify(w.cookie, oi.user_version.version, notif->id, WATCH_NOTIFY, notif->bl); osd->send_message_osd_client(notify_msg, s->con); @@ -3470,7 +3468,6 @@ void ReplicatedPG::do_osd_op_effects(OpContext *ctx) Watch::Notification *notif = osd->watch->get_notif(cookie); assert(notif); - session->del_notif(notif); // TODOSAM: osd->osd-> not good osd->osd->ack_notification(entity, notif, obc, this); } diff --git a/src/rgw/rgw_formats.cc b/src/rgw/rgw_formats.cc index 6153ec0c4bb..61d4d04c7a4 100644 --- a/src/rgw/rgw_formats.cc +++ b/src/rgw/rgw_formats.cc @@ -208,7 +208,6 @@ done: pos--; // squash null termination strcpy(buf + pos, p); len = pos + strlen(p) + 1; - cerr << "RGWFormatter_Plain::write_data: len= " << len << " bytes" << std::endl; done_free: if (!p_on_stack) free(p); diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index 4e99f60ccb3..3165ab0454a 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -396,32 +396,13 @@ int main(int argc, const char **argv) global_init(&def_args, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_DAEMON, CINIT_FLAG_UNPRIVILEGED_DAEMON_DEFAULTS); - pid_t childpid = 0; if (g_conf->daemonize) { if (g_conf->rgw_socket_path.empty()) { cerr << "radosgw: must specify 'rgw socket path' to run as a daemon" << std::endl; exit(1); } - g_ceph_context->_log->stop(); - - childpid = fork(); - if (childpid) { - // i am the parent - cout << "radosgw daemon started with pid " << childpid << std::endl; - exit(0); - } - - // i am child - close(0); - close(1); - close(2); - int r = chdir(g_conf->chdir.c_str()); - if (r < 0) { - dout(0) << "weird, i couldn't chdir to '" << g_conf->chdir << "'" << dendl; - } - - g_ceph_context->_log->start(); + global_init_daemonize(g_ceph_context, 0); } Mutex mutex("main"); SafeTimer init_timer(g_ceph_context, mutex); diff --git a/src/test/cli/ceph/help.t b/src/test/cli/ceph/help.t index a92eb7ca943..c8d6fa7556c 100644 --- a/src/test/cli/ceph/help.t +++ b/src/test/cli/ceph/help.t @@ -29,6 +29,7 @@ OBJECT STORAGE DEVICE (OSD) COMMANDS ceph osd dump [--format=json] + ceph osd ls [--format=json] ceph osd tree ceph osd map <pool-name> <object-name> ceph osd down <osd-id> @@ -60,7 +61,7 @@ ceph osd scrub <osd-id> ceph osd deep-scrub <osd-id> ceph osd repair <osd-id> - ceph osd tell N bench [bytes per write] [total bytes] + ceph osd tell <osd-id or *> bench [bytes per write] [total bytes] PLACEMENT GROUP (PG) COMMANDS ceph pg dump diff --git a/src/tools/ceph.cc b/src/tools/ceph.cc index 5dab98f0d26..d5300e69bdd 100644 --- a/src/tools/ceph.cc +++ b/src/tools/ceph.cc @@ -72,6 +72,7 @@ static void usage() cout << "\n"; cout << "OBJECT STORAGE DEVICE (OSD) COMMANDS\n"; cout << " ceph osd dump [--format=json]\n"; + cout << " ceph osd ls [--format=json]\n"; cout << " ceph osd tree\n"; cout << " ceph osd map <pool-name> <object-name>\n"; cout << " ceph osd down <osd-id>\n"; @@ -103,7 +104,7 @@ static void usage() cout << " ceph osd scrub <osd-id>\n"; cout << " ceph osd deep-scrub <osd-id>\n"; cout << " ceph osd repair <osd-id>\n"; - cout << " ceph osd tell N bench [bytes per write] [total bytes]\n"; + cout << " ceph osd tell <osd-id or *> bench [bytes per write] [total bytes]\n"; cout << "\n"; cout << "PLACEMENT GROUP (PG) COMMANDS\n"; cout << " ceph pg dump\n"; |