Commit Graph

14336 Commits

Author SHA1 Message Date
Sage Weil
d2c245c4d7 osd: first pass at pg peering stats
The numbers are a bit off it seems.  Also lots of potential for cleanup
here.  But it (basically) works!

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-04 14:58:42 -07:00
Sage Weil
a347d18095 osd: use const char * state names
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-04 14:12:00 -07:00
Greg Farnum
228e857eea OSD: assert contents exist when erasing from last_scrub_map.
Insert PG into last_scrub_map on creation so that this doesn't
break right away.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-05-04 14:30:51 -07:00
Samuel Just
ca7a3724e9 PG: proc_replica_info, oinfo not info
The method param info shadowed PG::info.
2011-05-04 13:52:39 -07:00
Sage Weil
db8f96c928 osd: move directly to Reset state on pg load
Add Initial -> Reset transition on pg load.  This avoids doing any
activation-type stuff (like sending messages) before we are ready.  In
particularly, we want to advance through any new OSDMaps and only
send out queries/notifies/whatever when we get to the activate_map
stage.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-05-04 13:05:09 -07:00
Josh Durgin
d622a6fba6 OSD: start PG state machine when loading pre-existing PGs
This caused a crash when restarting a killed OSD because the Initial
state was receiving the ActMap event.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-05-04 12:23:14 -07:00
Samuel Just
c3fe4e3df3 PG: ReplicaActive must repond to requests from discover_all_missing
If the peer does not yet have the pg during GetMissing, there won't be
a peer_missing entry for that peer.  In that case, discover_all_missing
can legitimately request a missing set after the pg has gone active.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-05-04 11:36:56 -07:00
Greg Farnum
d417fb0bad uclient: fill in InodeCap::wanted member on send_cap.
Previously it was never used, which I think led to spamming the MDS
with cap messages!

Hopefully this won't reveal any new cap-handling bugs...

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-05-04 10:50:41 -07:00
Greg Farnum
c9859c2fc8 uclient: only try to update caps on the auth MDS.
Previously we would send updates on things like the max_size we
wanted to the first MDS in our list, which was bad if the auth mds
had a higher number. Now, only send them (and update bookkeeping)
for the auth MDS.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-05-04 10:50:41 -07:00
Josh Durgin
9c192e58f9 PG: collapse crashed transitions to happen on any unexpected event
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-05-04 10:28:09 -07:00
Josh Durgin
8d301d299b PG: use a state_name member instead of overriding get_state_name
Also add debugging to each state constructor. Since dout uses
the recovery machine context, anything using it in the constructor
must be a state, not a simple_state.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-05-04 10:27:17 -07:00
Samuel Just
879d6b039f Revert "osd: simplify check for unconsumed events"
This reverts commit ab34a3ce3e.

It turns out that unconsumed_event supersedes checking outer states. :(

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-05-03 17:58:46 -07:00
Samuel Just
31f6a8cf8c PG: Primary should also discard the ActMap event
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-05-03 17:19:56 -07:00
Samuel Just
dda3261efe PG: ActMap should be dicarded if no outer state handles it 2011-05-03 17:02:34 -07:00
Sage Weil
ab34a3ce3e osd: simplify check for unconsumed events
No need for the Crashed pseudo state.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-03 17:03:37 -07:00
Sage Weil
71abe265ee osd: make debug output include state name
Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-03 16:38:47 -07:00
Sage Weil
efcab968e3 osd: fix event names
Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-03 16:38:47 -07:00
Samuel Just
28fdffcc31 PG.h: transition to crashed on unhandled message 2011-05-03 16:28:11 -07:00
Colin Patrick McCabe
fdc679158d obsync: improve ACL handling again
LocalAcl: store ACLs in memory. They're very small, and the tempfile
stuff was just getting cumbersome.

LocalAcl.equal: do deep comparison of ACLs, not just seeing if the XML
is the same.

Strip owner when setting an ACL. We never want to try to set the owner.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-03 16:13:30 -07:00
Colin Patrick McCabe
0802cfdeb1 obsync: fix some bugs
* Allow parsing of AclPolicy elements that don't have owner_id fields.

* Put all XML attributes in the correct namespace when generating ACL XML

* Fix FileStore.get_acl

* test-obsync: better formatting for obsync command lines

* test-obsync: test ACL-syncing stuff

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-03 15:33:39 -07:00
Sage Weil
c71583d068 osd: feed new pg mapping into state machine
instead of recalculating it.  Also pass the last map into warm_restart,
while we're at it.  Drop the Reset state constructor and instead repost
the AdvMap event before transitioning.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-03 15:31:28 -07:00
Sage Weil
d0dd5497c8 osdmap: fix some constedness
Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-03 15:29:48 -07:00
Sage Weil
39dc084607 osd: turn off recovery oid sets
This is slow, eats memory, and dumps huge amounts of crap to the debug
logs when enabled.  Leave it off unless we are actually hunting down a bug.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-03 14:38:37 -07:00
Josh Durgin
eac23e178f PG: remove peer_info_requested member
This is internal to the GetInfo state now.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-05-03 14:26:34 -07:00
Josh Durgin
258fe7c018 PG: don't become clean in purge_strays
Our state is already clean here.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-05-03 14:26:34 -07:00
Josh Durgin
9c70fdfb22 PG: send notifies when a stray or an active replica gets an ActMap
This was present before refactoring.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-05-03 14:26:34 -07:00
Josh Durgin
c96f3e9bc6 PG: fix proc_master_log output
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-05-03 14:26:34 -07:00
Josh Durgin
892e58d04f PG: handle info in proc_replica_log just like we did in _process_pg_info
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-05-03 14:26:34 -07:00
Sage Weil
1a204a60bd Merge branch 'master' into wip_pg_refactor 2011-05-03 14:28:45 -07:00
Sage Weil
b659fd02d0 osd: only specify start version for Qeury::LOG
Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-03 14:27:35 -07:00
Colin Patrick McCabe
f175d27a48 obsync: check if ACLs match
If all other aspects of two objects match, we should make sure the ACLs
match before deciding that there's nothing for us to do.

Restructure LocalCopy so that it no longer contains the ACL. Create
LocalAcl to represent a cached local copy of the ACL. Add get_acl
methods to all stores.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-03 14:23:22 -07:00
Sage Weil
780ec44b1c osd: use enum instead of const static int members
Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-03 14:06:54 -07:00
Sage Weil
a5f352cc22 osd: leave recovery hooks in PG
Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-03 14:06:51 -07:00
Sage Weil
90ee7cf911 osd: fix pg log entry types to not always be delete
This was broken by the osd_trans work merged in 01f3526b62.  We need to
use the obs reference to new_obs.  This caused objects to be deleted during
pg recovery.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-03 13:08:35 -07:00
Sage Weil
85131220c8 mon: add 'ceph osd rm N...' command
So we can mark an old osd as deleted and have it not appear in the osdmap
dump, summary count.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-03 12:37:33 -07:00
Sage Weil
c0c2029922 Merge remote branch 'origin/stable'
Conflicts:
	src/mon/OSDMonitor.cc
2011-05-03 12:36:16 -07:00
Sage Weil
f680eca790 osdmap: allow incremental to represent osd deletion
Convert new_down to new_state, with values xored onto the old state.  We
preserve compatibility with old incrementals because they were (virtually)
always 0, and we can special case that to mean toggle CEPH_OSD_UP.  We
don't really care if clients get new values right.. if they don't clear
the EXISTS flag that doesn't really hurt them.  It's only important that
the monitor get it right.

To ensure that, we rev the monitor internal protocol.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-03 12:34:54 -07:00
Sage Weil
890dc2aed2 objecter: remove useless mark_down code
We already check sessions a bit further down, and this code only worked
when we got incrementals, not full maps.  Take it out.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-05-03 12:28:00 -07:00
Colin Patrick McCabe
f39f5c8168 test-obsync: test ACL translation, run unit tests
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-03 11:07:17 -07:00
Colin Patrick McCabe
472d7bee27 obsync: remove --owner, elide owner from ACL XML
Just omit the owner field from the ACL XML. It is optional anyway.

Don't supply an --owner switch. The owner will always be the same user
that created the object.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-03 10:58:04 -07:00
Colin Patrick McCabe
a6383e9448 obsync: better usage
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-03 10:20:30 -07:00
Samuel Just
48eb343ba2 OSD,PG: Peering refactor
Previously, peering was handled by a defacto state machine in do_peer
and related methods.  Peering state will now be encapsulated in
RecoveryState, which uses boost::state_chart internally to enforce an
explicit state machine abstraction.  OSD::handle_pg_* pass off to
PG::handle_*, which pass messages to the state machine.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-05-03 10:19:45 -07:00
Samuel Just
09f6d22d0c OSD,PG: Move pg reset code from OSD::advance_map to PG
OSD::advance_map previously handled resetting the PG for peering.  Now,
PG::acting_up_affected returns true if peering needs to be restarted and
PG::warm_restart takes care of restting the pg.
2011-05-03 10:19:45 -07:00
Josh Durgin
f06269de5e PG: choose_log_location
Choosing the master log holder and deciding whether to generate a
backlog are now handled by choose_log_location.
2011-05-03 10:19:45 -07:00
Josh Durgin
21d8e72ad2 PG: Extract query map generation from recover_master_log
PgPriorSet::gen_query_map now generates the initial info query map.
2011-05-03 10:19:45 -07:00
Samuel Just
1477c06826 PG: Refactor build_prior into a PgPriorSet constructor. 2011-05-03 10:19:45 -07:00
Samuel Just
1b0dfcf53b PG: Add gen_prefix method for generating the pg error prefix
This should make it easier to add dout macros for non-pg methods
2011-05-03 10:19:45 -07:00
Samuel Just
fe30d90aeb TestSnaps.cc: default to testing with the data pool 2011-05-03 10:19:45 -07:00
Samuel Just
789b9672db OSD.cc: handle_pg_create fix initial last_epoch_started value
last_epoch_started == same_acting_since should not be true before the pg
goes active for the first time.
2011-05-03 10:19:45 -07:00
Colin Patrick McCabe
a8a16c7106 obsync: only require --owner if --xuser is set
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-03 10:06:11 -07:00