Project

General

Profile

Bug #32731

fsck: cid is improperly matched to oid

Added by Igor Fedotov 7 months ago. Updated 4 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Start date:
08/28/2018
Due date:
% Done:

0%

Source:
Tags:
Backport:
mimic,luminous
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

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 7 months 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 7 months ago

  • Assignee set to Sage Weil

#3 Updated by Sage Weil 6 months ago

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

#4 Updated by Kefu Chai 6 months ago

  • Status changed from Need Review to Pending Backport

#5 Updated by Nathan Cutler 6 months ago

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

#6 Updated by Nathan Cutler 6 months ago

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

#7 Updated by Nathan Cutler 4 months ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF