Bug #32731
closed
fsck: cid is improperly matched to oid
Added by Igor Fedotov over 5 years ago.
Updated over 5 years ago.
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.
Files
more_log.diff (564 Bytes)
more_log.diff |
patch to extend logging |
Igor Fedotov, 08/28/2018 11:48 AM
|
|
log (13.5 KB)
log |
log snippet for the patched bluestore |
Igor Fedotov, 08/28/2018 11:48 AM
|
|
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;
- Assignee set to Sage Weil
- Status changed from New to Fix Under Review
- Backport set to mimic,luminous
- Status changed from Fix Under Review to Pending Backport
- Copied to Backport #36145: luminous: fsck: cid is improperly matched to oid added
- Copied to Backport #36146: mimic: fsck: cid is improperly matched to oid added
- Status changed from Pending Backport to Resolved
Also available in: Atom
PDF