Skip to content

Commit

Permalink
osd, test: When head missing a snapset, clones not an error
Browse files Browse the repository at this point in the history
Fix log message for this case and make into "info"

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit f508ddc)
  • Loading branch information
dzafman committed Feb 25, 2016
1 parent 0988b12 commit b8c9507
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/osd/ReplicatedPG.cc
Expand Up @@ -11442,6 +11442,13 @@ void ReplicatedPG::_scrub(
expected = soid.has_snapset();
}
if (!expected) {
// If we couldn't read the head's snapset, then just ignore clones and
// don't count as an error.
if (head && !snapset) {
osd->clog->info() << mode << " " << info.pgid << " " << soid
<< " clone ignored due to missing snapset";
continue;
}
osd->clog->error() << mode << " " << info.pgid << " " << soid
<< " is an unexpected clone";
++scrubber.shallow_errors;
Expand Down
6 changes: 3 additions & 3 deletions src/test/osd/osd-scrub-snaps.sh
Expand Up @@ -164,15 +164,15 @@ err_strings[10]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/5c889059/o
err_strings[11]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/61f68bb1/obj3/head on disk size [(]3840[)] does not match object info size [(]768[)] adjusted for ondisk to [(]768[)]"
err_strings[12]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/83425cc4/obj6/1 is an unexpected clone"
err_strings[13]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/3f1ee208/obj2/snapdir no 'snapset' attr"
err_strings[14]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/3f1ee208/obj2/7 is an unexpected clone"
err_strings[15]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/3f1ee208/obj2/4 is an unexpected clone"
err_strings[14]="log_channel[(]cluster[)] log [[]INF[]] : scrub 1.0 1/3f1ee208/obj2/7 clone ignored due to missing snapset"
err_strings[15]="log_channel[(]cluster[)] log [[]INF[]] : scrub 1.0 1/3f1ee208/obj2/4 clone ignored due to missing snapset"
err_strings[16]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/a8759770/obj4/snapdir expected clone 1/a8759770/obj4/7"
err_strings[17]="log_channel[(]cluster[)] log [[]INF[]] : scrub 1.0 1/a8759770/obj4/snapdir 1 missing clone[(]s[)]"
err_strings[18]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/6cf8deff/obj1/1 is an unexpected clone"
err_strings[19]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/e478ac7f/obj9/1 is missing in clone_size"
err_strings[20]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/29547577/obj11/1 is an unexpected clone"
err_strings[21]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/94122507/obj14/1 size 1032 != clone_size 1033"
err_strings[22]="log_channel[(]cluster[)] log [[]ERR[]] : 1.0 scrub 21 errors"
err_strings[22]="log_channel[(]cluster[)] log [[]ERR[]] : 1.0 scrub 19 errors"

for i in `seq 0 ${#err_strings[@]}`
do
Expand Down

0 comments on commit b8c9507

Please sign in to comment.