This lets us run multiple cleanup steps right before ceph
teardown.
Note that we drop the facet from multimon/ because it
doesn't factor out cluster creation before this step
properly. That's fine because the require_luminous
cleanup shouldn't be related to the multimon tests.
Signed-off-by: Sage Weil <sage@redhat.com>
Instead of deleting a pool, add a .NNN.DELETED suffix to the end. This
keeps the data around long enough for it to be scrubbed later (in the
case of a teuthology job cleanup).
If you really want to delete the pool, then instead of the usual force
flag option you can pass --yes-i-really-really-mean-it-not-faking. :)
Signed-off-by: Sage Weil <sage@redhat.com>
First, this is pointless--each test runs in a namespace so they don't
step on each other. Second, leaving objects in place is an opportunity
for scrub to notice any issues we created. Third, the cleanup asserts
that delete succeeds but if clones exist pgls will show whiteouts and then
delete will return ENOENT. We could disable the assert, but why bother
even attempting a sloppy cleanup?
We need to preserve cleanup behavior for a few tests (notably the object
listing ones).
Signed-off-by: Sage Weil <sage@redhat.com>
Do not touch the object before the put if we expect to see ENOENT.
We would get it anyway with older code, but with the snapset
changes we are on a whiteout and get ENODATA instead.
And really we shouldn't have been getting ENOENT after a touch
anyway!
Signed-off-by: Sage Weil <sage@redhat.com>
If we encounter legacy snaps, add to snapmapper then; otherwise, use the
clone_snaps field in SnapSet to add all clones to snapmapper when we
process the head object.
Signed-off-by: Sage Weil <sage@redhat.com>
- objects come in a different order, meh
- ss is on head, always, not snapdir.
- error messages on head, not snapdir
Signed-off-by: Sage Weil <sage@redhat.com>
In the new world, head_exists is always true. Stop clearing it in
_delete_oid (except for legacy compatibility), and fix the various callers
and assertions to compensate. Note that we now use head_exists as a flag
to guide us into the snapdir branch of finish_ctx() (which will go away
post-luminous).
Signed-off-by: Sage Weil <sage@redhat.com>
We include a check to make sure we do not delete a dirty whiteout if this
is a tier pool and the object is dirty.
Signed-off-by: Sage Weil <sage@redhat.com>
- Assume that any snapset we update, if not require_luminous, is a net-new
legacy SnapSet. (It might be an existing one, which would be net-0, but
that is harder to tell.)
Then, during scrub,
- Any unreadable oi is assumed to include a legacy snapset
- Any snapset we encounter if !require_luminous is legacy
- Any object that should have a snapset but doesn't (corrupt or missing)
is assumed to be legacy.
- If were trying to update a legacy Snapset but have to abort, then it is
still legacy.
We could assume that a missing/broken snapset is not legacy since it has
to be repaired anyway (and therefore shouldn't block upgrade), but I'm
not sure. For now, we'll take the conservative approach of blocking the
upgrade if the snapset metadata is missing/corrupt.
Signed-off-by: Sage Weil <sage@redhat.com>
# Conflicts:
# src/osd/PrimaryLogPG.cc
During scrub, we assemble the clone legacy_snaps values and put them
in the SnapSet.
Note that we do not bother clearing legacy_snaps in the clones; this is
more complexity to do correctly and not worth the effort; we will always
have the SnapSet to indicate whether we need to look at the oldf ield
or not.
If the rebuild clone_snaps is not the correct size we bail out; this can
happen if some clones are missing oi or missing entirely, or if there are
extra clones.
Signed-off-by: Sage Weil <sage@redhat.com>
Store the per-clone snaps list in SnapSet if (1) REQUIRE_LUMINOUS is set
in the OSDMap and (2) the SnapSet isn't a 'legacy' SnapSet that hasn't
been converted yet by scrub.
Signed-off-by: Sage Weil <sage@redhat.com>
This will make it easier to identify users of this field that need to
conditionally use either the old legacy_snaps or the new
SnapSet::clone_snaps vector.
Signed-off-by: Sage Weil <sage@redhat.com>
We may still need to create a whiteout because clones still exist.
Arguably delete+ignore_cache is not the right way to remove whiteouts and
we should have a separate RADOS operation for this. But we don't.
Signed-off-by: Sage Weil <sage@redhat.com>
If REQUIRE_LUMINOUS is set on the OSDMap, put the SnapSet on the head
and make it a whiteout. This is simpler and will eventually (once all
the old snapdir objects have been fixed up) let us remove a ton of
snapdir-related headaches.
This is surprisingly simple. Everywhere else we work with snapdir is
already set up to handle the snapset on the head. The only difference is
that we are preventing outselves from moving from the snapset-on-head
state to the snapset-on-snapdir-with-no-head state. The only time this
happens is when the object is logically deleted in _delete_oid.
Signed-off-by: Sage Weil <sage@redhat.com>
We moved to v7 encoding in ca81563d8d, which
was pre-jewel, so that's the oldest version we need to decode.
Drop the nlink field, which has not been used in a long time.
Signed-off-by: Sage Weil <sage@redhat.com>