Project

General

Profile

Bug #32731

fsck: cid is improperly matched to oid

Added by Igor Fedotov over 5 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
mimic,luminous
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

It looks like the approach to match cid to oid in BlueStore::_fsck isn't valid. It's mainly based on BlueStore::Collection::contains(contains(const ghobject_t& oid) call.
Currently this issue is hidden and seems to have no negative impact but I faced it while debugging PR#19454 - resulted collection and object had different pool id.
I attached short diff and log showing the problem.
Step to reproduce - run new vstart cluster, make a pool and put 128 MB object via "rados put". Restart the cluster - fsck logging (if patched with the attached code) will show the mismatch.

more_log.diff View - patch to extend logging (564 Bytes) Igor Fedotov, 08/28/2018 11:48 AM

log View - log snippet for the patched bluestore (13.5 KB) Igor Fedotov, 08/28/2018 11:48 AM


Related issues

Copied to bluestore - Backport #36145: luminous: fsck: cid is improperly matched to oid Resolved
Copied to bluestore - Backport #36146: mimic: fsck: cid is improperly matched to oid Resolved

History

#1 Updated by Igor Fedotov over 5 years ago

Here is code snippet in question:

 if (!c ||
      oid.shard_id != pgid.shard ||
      oid.hobj.pool != (int64_t)pgid.pool() ||
      !c->contains(oid)) {
    c = nullptr;
    for (auto& p : coll_map) {
vvvvvvvvvvvvvvvvvvvv
      if (p.second->contains(oid)) {
^^^^^^^^^^^^^^^^^^^^
        c = p.second;
        break;
      }
    }
    if (!c) {
          derr << "fsck error: stray object " << oid
               << " not owned by any collection" << dendl;
      ++errors;
      continue;
    }
    c->cid.is_pg(&pgid);
    dout(20) << __func__ << "  collection " << c->cid << " " << c->cnode
         << dendl;
+       dout(0)  << __func__ << "  collection " << c->cid << " pool:" << pgid.pool()
+                << " matched " << oid << " pool:" << oid.hobj.pool
+                << dendl;

#2 Updated by Igor Fedotov over 5 years ago

  • Assignee set to Sage Weil

#3 Updated by Sage Weil over 5 years ago

  • Status changed from New to Fix Under Review
  • Backport set to mimic,luminous

#4 Updated by Kefu Chai over 5 years ago

  • Status changed from Fix Under Review to Pending Backport

#5 Updated by Nathan Cutler over 5 years ago

  • Copied to Backport #36145: luminous: fsck: cid is improperly matched to oid added

#6 Updated by Nathan Cutler over 5 years ago

  • Copied to Backport #36146: mimic: fsck: cid is improperly matched to oid added

#7 Updated by Nathan Cutler over 5 years ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF