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>
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>
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>
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>
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>
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>
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>
This reverts commit ab34a3ce3e.
It turns out that unconsumed_event supersedes checking outer states. :(
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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.