]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: always send scrub errors to cluster log
authorSage Weil <sage.weil@dreamhost.com>
Mon, 6 Feb 2012 04:39:49 +0000 (20:39 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Wed, 8 Feb 2012 05:14:31 +0000 (21:14 -0800)
Some errors were going to the cluster log, some weren't.  Normalize the
output format and send them all.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/ReplicatedPG.cc

index 772930cd4fa3aec7eb25e89d6ffd5697b58a7f2d..2dfb0a91631729ea70870126ddad81998fe5d9a0 100644 (file)
@@ -5834,7 +5834,8 @@ int ReplicatedPG::_scrub(ScrubMap& scrubmap, int& errors, int& fixed)
     if (soid.snap == CEPH_SNAPDIR ||
        soid.snap == CEPH_NOSNAP) {
       if (p->second.attrs.count(SS_ATTR) == 0) {
-       dout(0) << mode << " no '" << SS_ATTR << "' attr on " << soid << dendl;
+       osd->clog.error() << mode << " " << info.pgid << " " << soid
+                         << " no '" << SS_ATTR << "' attr";
        errors++;
        continue;
       }
@@ -5845,7 +5846,8 @@ int ReplicatedPG::_scrub(ScrubMap& scrubmap, int& errors, int& fixed)
 
       // did we finish the last oid?
       if (head != hobject_t()) {
-       osd->clog.error() << "Missing clone(s) for " << head << "\n";
+       osd->clog.error() << mode << " " << info.pgid << " " << head
+                         << " missing clones";
        errors++;
       }
       
@@ -5876,7 +5878,8 @@ int ReplicatedPG::_scrub(ScrubMap& scrubmap, int& errors, int& fixed)
 
     // basic checks.
     if (p->second.attrs.count(OI_ATTR) == 0) {
-      dout(0) << mode << " no '" << OI_ATTR << "' attr on " << soid << dendl;
+      osd->clog.error() << mode << " " << info.pgid << " " << soid
+                       << " no '" << OI_ATTR << "' attr";
       errors++;
       continue;
     }
@@ -5885,9 +5888,9 @@ int ReplicatedPG::_scrub(ScrubMap& scrubmap, int& errors, int& fixed)
     object_info_t oi(bv);
 
     if (oi.size != p->second.size) {
-      derr << "on disk size (" << p->second.size
-          << ") does not match object info size (" << oi.size
-          << ") for " << soid << dendl;
+      osd->clog.error() << mode << " " << info.pgid << " " << soid
+                       << " on disk size (" << p->second.size
+                       << ") does not match object info size (" << oi.size << ")";
       ++errors;
     }
 
@@ -5901,7 +5904,8 @@ int ReplicatedPG::_scrub(ScrubMap& scrubmap, int& errors, int& fixed)
 
     if (soid.snap == CEPH_NOSNAP) {
       if (!snapset.head_exists) {
-       dout(0) << mode << "  snapset.head_exists=false, but " << soid << " exists" << dendl;
+       osd->clog.error() << mode << " " << info.pgid << " " << soid
+                         << " snapset.head_exists=false, but object exists";
        errors++;
        continue;
       }