Commit Graph

17402 Commits

Author SHA1 Message Date
Sage Weil
367ab142d7 paxos: store stashed state _and_ incrementals
Paxos::share_state() may share a stashed state and incrementals that
follow; we need to store the same.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-17 14:10:34 -08:00
Sage Weil
6bc9a544b6 mon: elector: always start election via monitor
Don't go from active -> electing without passing (monitor) go.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-17 13:53:52 -08:00
Sage Weil
685450b76b common: libraries should not log to stdout/stderr
Certainly not by default.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-17 12:07:34 -08:00
Sage Weil
f1dd56d93d objecter: set skipped_map if we skip a map
This ensures that we resend _all_ requests, since we aren't sure which
may have mapped to a different primary and then back.  This was missed in
the original implementation in 4fe9cca5dd63a1924be2b5cb18f542fb4b97a768.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-17 11:56:37 -08:00
Sage Weil
5afef0209f objecter: add is_locked() asserts
Sanity check.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-17 11:39:55 -08:00
Sage Weil
bf91177e57 objecter: send slow osd MPing via Connection*
This may address #1732 indirectly because we have a Connection* reference
here.  However, it's still not clear how we ended up with an OSDSession*
for an osd that doesn't exist.  :/

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-17 11:39:36 -08:00
Sage Weil
fa4b0fb961 osd: add pending_ops assert
Just a sanity check, hopefully helping us track down #1727.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-16 13:11:07 -08:00
Sage Weil
17fa1e0d4e mon: renamed get_latest* -> get_stashed*
This makes e.g. get_latest_version() vs get_last_committed() less
confusing.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-16 11:01:59 -08:00
Sage Weil
b9d5fbe494 mon: fix ver tracking for auth database
Local variable keys_ver needs to be updated when we slurp up latest stashed
version.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-16 10:57:23 -08:00
Sage Weil
b425f6d6ce mon: always load stashed version when version doesn't match
The slurp process can happen after the monitor has started and has some
in-memory version of the state, and that process may wipe out old
incrementals and change the stashed version.  That means that in
update_from_paxos, we need to pull the stashed version if it doesn't
match what we currently have or else we may not have the incrementals we
need to get up to date.

This simplifies and cleans up that code a bit so it is not specific to
monitor startup.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-16 10:54:59 -08:00
Yehuda Sadeh
2e195500b5 rgw: don't log entries with bad utf8 2011-11-14 17:02:08 -08:00
Yehuda Sadeh
0276eab440 rgw: adjust error code in swift copy failures 2011-11-14 14:39:18 -08:00
Yehuda Sadeh
1fe16923b4 rgw: fix swift responses encoding 2011-11-14 13:55:29 -08:00
Josh Pieper
2445fd8416 rgw: Fix some merge problems uncovered by gcc warnings:
* a refactor in e2100bce left the mod_ptr and unmod_ptr members set
   incorrectly in RGWCopyObj::init_common
 * a fix in 6752babd aggregated error returns, but then failed to do
   anything with them

Signed-off-by: Josh Pieper <jjp@pobox.com>
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-14 13:23:29 -08:00
Josh Pieper
cd90061239 Resolve gcc warnings.
These should have no functional changes:
 * Check errors from functions that currently cannot return any
 * Initialize variables that gcc can't determine will be initialized
   in a following function call
 * Remove unused variables

Signed-off-by: Josh Pieper <jjp@pobox.com>
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-14 13:23:18 -08:00
Sage Weil
a5b8c8518f osd: remove dead osd_max_opq code
This is no longer used as of a while ago!

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-14 12:15:14 -08:00
Josh Durgin
f418775d2c workunits: rados python workunit should be executable
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-11-14 08:18:47 -08:00
Sage Weil
102c434297 crush: send debug output to dout, not stdout/err
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-13 14:18:19 -08:00
Sage Weil
25eee416fd test/run_cmd: use mkstemp instead of mkstemps
my box didn't have mkstemps

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-13 14:16:52 -08:00
Sage Weil
18009866f2 ceph-authtool: fix clitests
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-13 14:07:01 -08:00
Sage Weil
d476ae2509 test_str_list: make sure ' ' and ', ' separaters work for str lists
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 15:17:29 -08:00
Sage Weil
ecd713c5c3 ceph-authtool: make error msg more helpful
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 14:55:39 -08:00
Sage Weil
4f39aaa7a9 keyring: don't print auid if it is the default
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 14:55:28 -08:00
Sage Weil
ee02a1e12b mon: implement 'fsid' command
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 14:55:06 -08:00
Sage Weil
5a3004e2c4 Merge branch 'stable' 2011-11-12 14:19:26 -08:00
Sage Weil
73f99a189f mon: fix 'osd crush add ..' weight
This was changed to floating point in commit 3f67893.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 14:08:02 -08:00
Sage Weil
1b843e0ef6 osdmap: build_simple with normal osd/host/rack/pool hierarchy
This will be useful in the general case where the cluster is created with
an empty map and useful crush hierarchy.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 14:05:15 -08:00
Sage Weil
ec97c852d7 mon: fix 'osd crush add ..' weight
This was changed to floating point in commit 3f67893.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 14:04:15 -08:00
Sage Weil
0349fa9625 vstart.sh: don't generate initial osdmap explicitly
This is simpler and exercises the monitors ability to start with a generic
osdmap and build it out as new osds are added to the cluster.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 13:42:38 -08:00
Sage Weil
30ddc85e54 mon: make initial osdmap optional
If an initial osdmap is not provided, we generate an empty one.  The user
add osds on their own after that.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 13:41:59 -08:00
Sage Weil
0d812252d7 osdmap: build_simple: create reasonable pools when numosd==0
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 13:41:05 -08:00
Sage Weil
8e150fb496 mon: add '--fsid foo' arg for setting generated monmap fsid
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-12 13:16:30 -08:00
Sage Weil
b51d817e23 mon: take '--fsid foo' arg with --mkfs
This will set the seed monmap's fsid.  This is useful if the monmap is
dynamically generated (e.g., based on ceph.conf or --mon-host list).

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-11 21:04:58 -08:00
Sage Weil
0c731ed7a9 osd: fix warnings
osd/ReplicatedPG.cc: In member function 'virtual void ReplicatedPG::remove_watchers_and_notifies()':
osd/ReplicatedPG.cc:1167: warning: suggest a space before ';' or explicit braces around empty body in 'for' statement
osd/ReplicatedPG.cc:1176: warning: suggest a space before ';' or explicit braces around empty body in 'for' statement

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-11 21:04:56 -08:00
Sage Weil
73705f661b monmaptool: fix clitests
Initial map is epoch 0.  Modifications still bump epoch by one.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-11-11 20:52:28 -08:00
Sage Weil
36241da4b1 paxos: discard waiting_for_active events on reset
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 20:49:00 -08:00
Sage Weil
80ab65682a monclient: use blank fsid (instead of epoch==0) for monmap checks
We can safely mkfs with an epoch=0 monmap as long as the fsid is set.  And
that is what commit f31825cee5300c708800a01a08201eef2bc03c0c changed.

Instead, use a zeroed fsid to tell if the monmap is valid/usable.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 20:48:59 -08:00
Sage Weil
2253c0168d use libuuid for fsid
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 20:48:59 -08:00
Sage Weil
07950bb8f0 crush: grammer: allow '.' in name token
These are now in the generated crush maps, so it seems appropriate to
recompile them :).

Reported-by: Martin Mailand <martin@tuxadero.com>
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 14:59:38 -08:00
Sage Weil
cf0a53e1ed mon: fix seed monmap removal
Remove if we previous had no latest, not based on which map we now have.
It's possible we join when monmap epoch is something much larger than 1!

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 14:54:41 -08:00
Sage Weil
6d370f3bd6 mon: allow monitor to automagically join cluster
If a monitor starts up with the correct fsid and auth keys, it will now
add itself to the monmap (and subsequently try to join the quorum) if it
is not already in the monmap.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 14:52:44 -08:00
Sage Weil
d56485a8af osd: pass monclient::init errors up the stack
Fixes crash like

 ceph version 0.38-149-gbf254de (commit:bf254de5cf8a17ce9467d166d87f3ab93170ae13)
 1: (ceph::BackTrace::BackTrace(int)+0x2d) [0x91d97b]
 2: ./ceph-osd() [0xa05baa]
 3: (()+0xef60) [0x7fb54c87ef60]
 4: (std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>, std::allocator<unsigned int> >::size() const+0xc) [0x8a4bc6]
 5: (std::set<unsigned int, std::less<unsigned int>, std::allocator<unsigned int> >::size() const+0x18) [0x8a1d32]
 6: (void encode<unsigned int>(std::set<unsigned int, std::less<unsigned int>, std::allocator<unsigned int> > const&, ceph::buffer::list&)+0x1c) [0x8a0311]
 7: (MonClient::_reopen_session()+0x2c5) [0x89a425]
 8: (MonClient::authenticate(double)+0x24f) [0x898da7]
 9: (OSD::init()+0x112b) [0x807ca1]
 10: (main()+0x2c09) [0x73e406]
 11: (__libc_start_main()+0xfd) [0x7fb54b04ec4d]
 12: ./ceph-osd() [0x73b499]

due to auth_supported being NULL.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:52:24 -08:00
Sage Weil
bf254de5cf mon: verify fsid during probe and election
This will keep mismatched fsids out of the same quorum.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:37:07 -08:00
Sage Weil
f1a98fb8af mon: tolerate won election while active
Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:22:37 -08:00
Sage Weil
cd736b9da0 mon: clean up logic a bit
More explicit.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:22:22 -08:00
Sage Weil
2633d71dbd mon: only re bootstrap if monmap actually changes
If we go thru here just to update latest, that's fine; no need to restart
the bootstrap process.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:22:09 -08:00
Sage Weil
622fbadd66 paxos: fix off-by-one in share_state
We hit this on adding a new monitor to an existing cluster.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:15:16 -08:00
Sage Weil
6c663d855e mon: fix monmap update
It's on the stack; update in place.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:05:01 -08:00
Sage Weil
1134fdfe78 mon: properly process monmaps even when i have the latest
We may get the latest monmap when we are doing our probing, but we still
need to process it in update_from_paxos().  Consider get_latest_version()
in addition to the active map.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 12:02:52 -08:00
Sage Weil
c097e63401 mon: fix up update_from_paxos() methods
Make sure they behave when the initial state is learned from paxos.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-11-11 11:55:34 -08:00