From cad8cf58188272778bcaf88b910a56a3281426ed Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Mon, 24 Jun 2013 14:50:07 -0700 Subject: [PATCH 1/6] Add python-argparse to dependencies (for pre-2.7 systems) Signed-off-by: Dan Mick --- README | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README b/README index 2ac68504d8724..640b7f8c7295a 100644 --- a/README +++ b/README @@ -126,7 +126,8 @@ To build the source code, you must install the following: - libleveldb-dev - libsnappy-dev - libcurl4-gnutls-dev +- python-argparse For example: - $ apt-get install automake autoconf pkg-config gcc g++ make libboost-dev libedit-dev libssl-dev libtool libfcgi libfcgi-dev libfuse-dev linux-kernel-headers libcrypto++-dev libaio-dev libgoogle-perftools-dev libkeyutils-dev uuid-dev libatomic-ops-dev libboost-program-options-dev libboost-thread-dev libexpat1-dev libleveldb-dev libsnappy-dev libcurl4-gnutls-dev + $ apt-get install automake autoconf pkg-config gcc g++ make libboost-dev libedit-dev libssl-dev libtool libfcgi libfcgi-dev libfuse-dev linux-kernel-headers libcrypto++-dev libaio-dev libgoogle-perftools-dev libkeyutils-dev uuid-dev libatomic-ops-dev libboost-program-options-dev libboost-thread-dev libexpat1-dev libleveldb-dev libsnappy-dev libcurl4-gnutls-dev python-argparse From eb86eebe1ba42f04b46f7c3e3419b83eb6fe7f9a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 24 Jun 2013 12:52:44 -0700 Subject: [PATCH 2/6] common/pick_addresses: behave even after internal_safe_to_start_threads ceph-mon recently started using Preforker to working around forking issues. As a result, internal_safe_to_start_threads got set sooner and calls to pick_addresses() which try to set string config values now fail because there are no config observers for them. Work around this by observing the change while we adjust the value. We assume pick_addresses() callers are smart enough to realize that their result will be reflected by cct->_conf and not magically handled elsewhere. Fixes: #5195, #5205 Backport: cuttlefish Signed-off-by: Sage Weil Reviewed-by: Dan Mick --- src/common/pick_address.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/common/pick_address.cc b/src/common/pick_address.cc index 90327666ad5b6..ff036c613604e 100644 --- a/src/common/pick_address.cc +++ b/src/common/pick_address.cc @@ -48,6 +48,24 @@ static const struct sockaddr *find_ip_in_subnet_list(CephContext *cct, return NULL; } +// observe this change +struct Observer : public md_config_obs_t { + const char *conf_var; + Observer(const char *c) : conf_var(c) {} + + const char** get_tracked_conf_keys() const { + static const char *foo[] = { + conf_var, + NULL + }; + return foo; + } + void handle_conf_change(const struct md_config_t *conf, + const std::set &changed) { + // do nothing. + } +}; + static void fill_in_one_address(CephContext *cct, const struct ifaddrs *ifa, const string networks, @@ -75,8 +93,14 @@ static void fill_in_one_address(CephContext *cct, exit(1); } + Observer obs(conf_var); + + cct->_conf->add_observer(&obs); + cct->_conf->set_val_or_die(conf_var, buf); cct->_conf->apply_changes(NULL); + + cct->_conf->remove_observer(&obs); } void pick_addresses(CephContext *cct, int needs) From 31d6062076fdbcd2691c07a23b381b26abc59f65 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 24 Jun 2013 17:42:04 -0700 Subject: [PATCH 3/6] init-radosgw.sysv: remove -x debug mode Fixes: #5443 Signed-off-by: Sage Weil --- src/init-radosgw.sysv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init-radosgw.sysv b/src/init-radosgw.sysv index ed9d178d7a864..cf22408d853a0 100644 --- a/src/init-radosgw.sysv +++ b/src/init-radosgw.sysv @@ -1,4 +1,4 @@ -#! /bin/bash -x +#! /bin/bash ### BEGIN INIT INFO # Provides: radosgw # Required-Start: $remote_fs $named $network $time From 521fdc2a4e65559b3da83283e6ca607b6e55406f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 24 Jun 2013 17:58:48 -0700 Subject: [PATCH 4/6] mon/AuthMonitor: ensure initial rotating keys get encoded when create_initial called 2x The create_initial() method may get called multiple times; make sure it will unconditionally generate new/initial rotating keys. Move the block up so that we can easily assert as much. Broken by commit cd98eb0c651d9ee62e19c2cc92eadae9bed678cd. Signed-off-by: Sage Weil Reviewed-by: Yehuda Sadeh --- src/mon/AuthMonitor.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index 301133af2e5c4..24542564e8ef8 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -96,6 +96,11 @@ void AuthMonitor::create_initial() { dout(10) << "create_initial -- creating initial map" << dendl; + // initialize rotating keys + last_rotating_ver = 0; + check_rotate(); + assert(pending_auth.size() == 1); + KeyRing keyring; bufferlist bl; int ret = mon->store->get("mkfs", "keyring", bl); @@ -111,9 +116,6 @@ void AuthMonitor::create_initial() inc.inc_type = GLOBAL_ID; inc.max_global_id = max_global_id; pending_auth.push_back(inc); - - // initalize rotating keys, too - check_rotate(); } void AuthMonitor::update_from_paxos() From 03d3be3eaa96a8e72754c36abd6f355c68d52d59 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 24 Jun 2013 18:12:11 -0700 Subject: [PATCH 5/6] mon: cancel probe timeout on reset If we are probing and get (say) an election timeout that calls reset(), cancel the timer. Otherwise, we assert later with a splat like 2013-06-24 01:09:33.675882 7fb9627e7700 4 mon.b@0(leader) e1 probe_timeout 0x307a520 2013-06-24 01:09:33.676956 7fb9627e7700 -1 mon/Monitor.cc: In function 'void Monitor::probe_timeout(int)' thread 7fb9627e7700 time 2013-06-24 01:09:43.675904 mon/Monitor.cc: 1888: FAILED assert(is_probing() || is_synchronizing()) ceph version 0.64-613-g134d08a (134d08a9654f66634b893d493e4a92f38acc63cf) 1: (Monitor::probe_timeout(int)+0x161) [0x56f5c1] 2: (Context::complete(int)+0xa) [0x574a2a] 3: (SafeTimer::timer_thread()+0x425) [0x7059a5] 4: (SafeTimerThread::entry()+0xd) [0x7065dd] 5: (()+0x7e9a) [0x7fb966f62e9a] 6: (clone()+0x6d) [0x7fb9652f9ccd] NOTE: a copy of the executable, or `objdump -rdS ` is needed to interpret this. Fixes: #5438 Backport: cuttlefish Signed-off-by: Sage Weil Reviewed-by: Joao Eduardo Luis --- src/mon/Monitor.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 7b8d95173f0e1..c4ce357765182 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -712,6 +712,7 @@ void Monitor::reset() { dout(10) << "reset" << dendl; + cancel_probe_timeout(); timecheck_finish(); leader_since = utime_t(); From 9ae0ec83dabe37ac15e5165559debdfef7a5f91d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 24 Jun 2013 18:51:07 -0700 Subject: [PATCH 6/6] mon/Elector: cancel election timer if we bootstrap If we short-circuit and bootstrap, cancel our timer. Otherwise it will go off some time later when we are in who knows what state. Backport: cuttlefish Signed-off-by: Sage Weil Reviewed-by: Joao Eduardo Luis --- src/mon/Elector.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mon/Elector.cc b/src/mon/Elector.cc index b3db1afab3cea..7172510d807c0 100644 --- a/src/mon/Elector.cc +++ b/src/mon/Elector.cc @@ -346,6 +346,7 @@ void Elector::dispatch(Message *m) t.put("monmap", "last_committed", mon->monmap->epoch); mon->store->apply_transaction(t); //mon->monmon()->paxos->stash_latest(mon->monmap->epoch, em->monmap_bl); + cancel_timer(); mon->bootstrap(); m->put(); delete peermap;