The PG may be doing work relative to a different epoch than what the osd
has. Make sure the PG removal message is queued under that epoch to avoid
confusing/crashing the recipient like so:
2012-02-10 23:26:35.691793 7f387281f700 osd.3 514 queue_pg_for_deletion: 0.0
osd/OSD.cc: In function 'void OSD::handle_pg_remove(OpRequest*)' thread 7f387281f700 time 2012-02-10 23:26:35.691820
osd/OSD.cc: 4860: FAILED assert(pg->get_primary() == m->get_source().num())
Signed-off-by: Sage Weil <sage@newdream.net>
This was only ever used while initializing the Paxos machine, and it
doesn't need to be. Its existence is just an invitation to have races
between updating the stashed data and the stashed version.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
This lets us recover from an interrupted slurp while still noticing
other corruption issues. Rather than running init() and then
update_from_paxos() on each instance, we run init() and check
consistency. If it is consistent, we update_from_paxos as before. If
it is not, we do nothing and detect the slurping state
in handle_probe_reply(). (This assumes the disk was in a slurping state. If not, the
daemon crashes because something else went horribly wrong.)
While we're at it, remove unnecessary sets of first_committed. These
are done in the call to pax->trim_to().
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Define a HEAD_VERSION and COMPAT_VERSION for any versioned message. Pass
to Message constructor so that it is always initialized, even from the
the default constructor. That's needed because we use that to check
decoding compatibility when receiving/decoding messages.
If we are conditionally encoding an old version, explicitly set
header.version in encode_payload().
We also set compat_version to demonstrate what will happen for future
revisions. In this case, it's moot, because no old code understands
compat_version yet: nobody with old decode code will see these values
anyway. But use this opportunity to demonstrate how it would be used in
the future.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Set it before we start slurping, and clear it when we end slurping.
This allows us to differentiate between deliberately inconsistent
disk states, and broken disk states. Run simple checks in a new
is_consistent() call.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
EAGAIN indicates that the op is
waiting_for_missing or waiting_for_degraded
Reviewed-by: Greg Farnum <greg.farnum@dreamhost.com>
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
These should all be initialized in init() anyway
(except accepted_pn_from, which is set in collect and handle_collect),
but initializing them to safe defaults in the constructor provides
a safety net.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
If the newly constructed message's version is older than the
compat_version, don't even try to decode; just fail.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
header.version is the version we encoded.
header.compat_version is the oldest version of code that can decode it.
If the value is 0, we don't know anything about backward compatibility.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
There was no version encoding previously, so this is an incompatible
change. Fortunately this type is only used in one place, MOSDPGCreate,
so we'll rev that encoding and compensate there. All is well!
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Track the time when the pg state last changed (or was refreshed) in
interesting ways.
Also track the epoch when the mapping last changed (same_interval_since).
Signed-off-by: Sage Weil <sage@newdream.net>