Commit Graph

15129 Commits

Author SHA1 Message Date
Sage Weil
2e7d06c6a3 msgr: only SO_REUSEADDR when specific port is specified
In general SO_REUSEADDR is slightly dangerous, but avoids waiting for the
timeout when restarting servers.  This is important when binding to a
specific port.

When binding to a random port, it doesn't matter.  Also, it appears that
two processes can bind() to the same port with that flag set, and then one
will fail with EADDRINUSE on listen().  That's racy when starting up
daemons that should be binding to unique/random ports.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-21 12:47:32 -07:00
Sage Weil
4c1cb28cb6 mon: fix log state trimming
We need to stash last_consumed in order for trimming to work.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-21 12:29:15 -07:00
Colin Patrick McCabe
282575a2c5 Merge branch 'wip-globalfoo' 2011-06-21 12:28:44 -07:00
Sage Weil
888e880caf mon: add 'log ....' command
Just sticks something in the central log.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-21 12:29:23 -07:00
Colin Patrick McCabe
112e569296 Convert g_ceph_context to a pointer.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-21 12:28:16 -07:00
Colin Patrick McCabe
89dca91635 gitignore: add test_libcommon_build
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-21 12:07:12 -07:00
Colin Patrick McCabe
1ef909971b inode_load_vec_t: de-globalize
Don't call ceph_clock_now from the constructor of inode_load_vec_t.
Update the classes that contain inode_load_vec_t to reflect this.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-21 11:40:20 -07:00
Colin Patrick McCabe
b02c8d6545 Create test_libcommon_build
Create test_libcommon_build to test for references to g_ceph_context and
other libglobal symbols from within libcommon.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-21 11:40:20 -07:00
Colin Patrick McCabe
b64a48b7ef DecayCounter: take a utime_t in ::decode
We need to initialize the last_decay time of the DecayCounter when
decoding it. This is not found in the encoded information, but instead
is set to the current time. We need to pass this in explicitly now
because of deglobalization.

This also reduces the number of calls to gettimeofday, which is good in
general.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-21 11:40:20 -07:00
Colin Patrick McCabe
209d1407fb Thread.cc: deglobalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-21 11:40:20 -07:00
Colin Patrick McCabe
fbf3f4ac2e common_init: de-globalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-21 11:40:20 -07:00
Yehuda Sadeh
c48540aec6 filestore: fix fiemap 2011-06-21 11:31:39 -07:00
Yehuda Sadeh
39e2c6e853 rbd: fix read_iterate for sparse read 2011-06-21 11:31:26 -07:00
Yehuda Sadeh
5ad52aff9c rgw: use adapting window for put obj 2011-06-21 11:22:47 -07:00
Colin Patrick McCabe
9e9cec694a AuthNone: encode entity name in authorizer
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-21 11:16:11 -07:00
Sage Weil
7f92d370a3 osd: warn instead of error if cluster addr specified but not public addr
Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-21 09:51:22 -07:00
Colin Patrick McCabe
37a976222f include/atomic.h:fix build for non-atomic-ops case
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 22:40:28 -07:00
Yehuda Sadeh
8f1beb1b86 rgw: put data using a window 2011-06-20 17:09:55 -07:00
Colin Patrick McCabe
8147350c33 MDSMap: de-globalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:43 -07:00
Colin Patrick McCabe
83020ad03f assert: de-globalize
Implement a simple registration system so that assert output can still
show up non-interleaved in daemons and utilities. Library code will just
use dout_emergency, which is simple and deadlock-free, but might be
interleaved with ongoing messages sometimes.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:43 -07:00
Colin Patrick McCabe
fae8dde3e4 Messenger: de-globalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:43 -07:00
Colin Patrick McCabe
4053204954 DoutStreambuf: de-globalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:43 -07:00
Colin Patrick McCabe
2b22c32b1a OSDMap: de-globalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:43 -07:00
Colin Patrick McCabe
f6c7343f75 auth: more deglobalization
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:43 -07:00
Colin Patrick McCabe
4615913c74 hex.cc: de-globalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:43 -07:00
Colin Patrick McCabe
d5ec8b77a4 MonClient: deglobalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:43 -07:00
Colin Patrick McCabe
dcc6448285 ProfLogger: de-globalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:42 -07:00
Colin Patrick McCabe
ba5b7331e7 tcp.cc: de-globalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:42 -07:00
Colin Patrick McCabe
0fc6ef2ef3 LogClient: remove accidental g_conf references
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:42 -07:00
Colin Patrick McCabe
ba61191021 msg: remove globals
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:42 -07:00
Colin Patrick McCabe
b0cb48083d KeyRing: derr -> lderr
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:42 -07:00
Colin Patrick McCabe
91065f4820 auth: AuthSupported: deglobalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:42 -07:00
Colin Patrick McCabe
fc43438601 Create global_context.cc to house g_ceph_context
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:42 -07:00
Colin Patrick McCabe
6ff09ef541 Move signal, pidfile to global
Move the global parts of signal and pidfile handling into global/

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:42 -07:00
Colin Patrick McCabe
63bbadddb0 move common_init to global_init
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:37:34 -07:00
Colin Patrick McCabe
c46814db69 Makefile: put LIBGLOBAL LDFLAGS into LIBGLOBAL_LDA
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:35:19 -07:00
Colin Patrick McCabe
c95062c7d0 libclient: remove client/SyntheticClient.cc
client/SyntheticClient.cc is only of interest to csyn. The other users
of libclient don't need it.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:35:19 -07:00
Colin Patrick McCabe
02c2ee166d mon/MonClient: use ldout instead of dout
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:35:19 -07:00
Colin Patrick McCabe
b44ead7659 mon/MonMap: deglobalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:35:19 -07:00
Colin Patrick McCabe
8a0d4864cf SimpleMessenger: de-globalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:35:18 -07:00
Colin Patrick McCabe
8069e83c0f common/DecayCounter: deglobalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:35:18 -07:00
Colin Patrick McCabe
d224876ec5 ThreadPool: de-globalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:35:18 -07:00
Colin Patrick McCabe
f82611d7ce common: de-globalize LogClient, ProfLogger, Timer
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:35:18 -07:00
Colin Patrick McCabe
5d5a7116ac common_init: misc globals cleanup
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:35:18 -07:00
Colin Patrick McCabe
01038faf69 auth: remove remaining globals
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:35:18 -07:00
Colin Patrick McCabe
51ffa7b137 auth: CephxKeyServer: de-globalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:35:18 -07:00
Colin Patrick McCabe
76c5f24863 auth: AuthAuthorizeHandler: deglobalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:35:18 -07:00
Colin Patrick McCabe
ab75f2ab76 auth: KeyRing, RotatingKeyRing: deglobalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:35:18 -07:00
Colin Patrick McCabe
17d22a96bf auth: CryptoKey, CryptoAES: deglobalize
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:35:18 -07:00
Colin Patrick McCabe
da2d4297c5 Create ProfLoggerCollection to hold ProfLoggers
Rather than having global variables, create ProfLoggerCollection to
store the current set of ProfLoggers. This collection will be stored
inside of CephContext.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:35:18 -07:00