From 1f86435436efbd3c030f9b026204a9ecdee7112e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 5 Feb 2012 20:39:49 -0800 Subject: [PATCH] osd: always send scrub errors to cluster log Some errors were going to the cluster log, some weren't. Normalize the output format and send them all. Signed-off-by: Sage Weil --- src/osd/ReplicatedPG.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 772930cd4fa3a..2dfb0a9163172 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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; } -- 2.39.5