This adds a query_epoch to notify and log messages, which are
sent in response to queries from the primary during peering. To
guarantee we don't try to process old logs and notifies after
restarting peering, query_epoch is set to the epoch at which the
query was sent. If query_epoch is less than last_peering_reset,
the primary discards the message.
This caused a "bad state machine event" crash in the following
scenario:
1. Primary tells a stray to generate a backlog at epoch 199.
2. The up set changes because a stray goes up.
3. Primary restarts peering at epoch 200.
4. Stray gets new map for epoch 200, sees that acting set did not
change, and sends log to primary.
5. Primary crashes.
Related to #1403, #1449
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
These names make more sense, since last_warm_restart was updated
outside of the warm_restart function.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
It's not clear to me why this is a class member -- it's only
written to or read from in this function, which allocates a fresh
one each time it's called.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
warning: rgw/rgw_main.cc:265: ignoring return value of ‘int chdir(const char*)’, declared with attribute warn_unused_result
Signed-off-by: Sage Weil <sage@newdream.net>
same_acting_since actually means "same acting AND up set since". This is
what the other same_acting_since update does (see a22511d).
We should rename it same_interval_since or something similar.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
The addition of a Finisher in 9c56070bc2
broke shutdown in the case where MonClient::init() was never called, so
add a guard variable to keep track.
I'm not sure this is actually the best solution (Timer guard itself,
for instance; maybe Finisher should too?), but I don't want to change
the Finisher interface without looking at it more carefully than I'm
going to right now.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
RGWRados::create_bucket is the only user now, so make it private
and make the interface a little tighter.
(We are going to need to handle placement at some point in the future,
but the interface needs to be designed a lot more carefully than this
one [wasn't].)
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Push all its extra functionality down into RGWRados::create_bucket. Convert
callers to the different interface (there's no reason to pass in the
bucket name apart from the bucket, and all callers know if they're
using a system bucket or not).
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Do this by adding an add_bucket_placement function to RGWAccess. Hurray
leaky abstractions! :(
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
We weren't filling in pg->up, which meant we booked an incorrect past
interval in PG::warm_restart(), leading to unknown strangeness down the
line.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>