osd/ReplicatedPG: handle snapdir properly during scrub

Handle snapdir similarly to how head is treated when updating the
next_clone info.  Also, add a warning when we have a snapdir object and
head_exists == true (the converse of the existing check).

Fixes: #7937
Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2014-04-01 11:04:47 -07:00
parent 87b08b23c3
commit c2e5a42874

View File

@ -11176,10 +11176,16 @@ void ReplicatedPG::_scrub(ScrubMap& scrubmap)
++scrubber.shallow_errors;
}
if (soid.snap == CEPH_NOSNAP) {
if (!snapset.head_exists) {
if (soid.snap == CEPH_NOSNAP || soid.snap == CEPH_SNAPDIR) {
if (soid.snap == CEPH_NOSNAP && !snapset.head_exists) {
osd->clog.error() << mode << " " << info.pgid << " " << soid
<< " snapset.head_exists=false, but object exists";
<< " snapset.head_exists=false, but head exists";
++scrubber.shallow_errors;
continue;
}
if (soid.snap == CEPH_SNAPDIR && snapset.head_exists) {
osd->clog.error() << mode << " " << info.pgid << " " << soid
<< " snapset.head_exists=true, but snapdir exists";
++scrubber.shallow_errors;
continue;
}