Require it for osd <-> osd and osd <-> mon communication.
This covers all the new encoding changes, except hobject_t, which is used
between the rados command line tool and the OSD for a object listing
position marker. We can't distinguish between specific types of clients,
though, and we don't want to introduce any incompatibility with other
clients, so we'll just have to make do here. :(
Signed-off-by: Sage Weil <sage@newdream.net>
A write may trigger via make_writeable the creation of a clone which
sorts before the object being written.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Signed-off-by: Sage Weil <sage@newdream.net>
If is_degraded returns true for backfill, the object may not be
in any replica's missing set. Only call start_recovery_op if
we actually started an op. This bug could cause a stuck
in backfill error.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Signed-off-by: Sage Weil <sage@newdream.net>
We haven't used this feature for years and years, and don't plan to. It
was there to facilitate "read shedding", where the primary OSD would
forward a read request to a replica. However, replicas can't reply back
to the client in that case because OSDs don't initiate connections (they
used to).
Rip this out for now, especially since osd_peer_stat_t just changed.
Signed-off-by: Sage Weil <sage@newdream.net>
We weren't using this, and it had broken (raw) encoding. The constructor
also didn't initialize fields properly.
Clear out the struct and use the new encoding scheme, so we can cleanly
add fields moving forward.
Signed-off-by: Sage Weil <sage@newdream.net>
We can receive an op with an old SnapContext that includes snaps that we've
already trimmed or are in the process of trimming. Filter them out!
Otherwise we will recreate and add links into collections we've already
marked as removed, and we'll get things like ENOTEMPTY when we try to
remove them. Or just leave them laying around.
Fixes: #1949
Signed-off-by: Sage Weil <sage@newdream.net>
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>