During backfill recovery on Crimson OSD replica, Bluestore
aborts with _txc_add_transaction error ENOENT on operation
due to OP_TOUCH_TEMP. OP_TOUCH_TEMP is guarded by #ifdef WITH_CRIMSON
but WITH_CRIMSON is not defined when BlueStore is compiled.
OP_TOUCH_TEMP is a crimson specific op to manage temporary
objects and the op is not used by classic osd. It is a plain
integer constant defined in the shared transaction layer so
adding it to the common code path in Transaction.h and BlueStore.cc
requires no additional includes or compile time guards.Handling
it unconditonally is therefore safe for all Objectstore backends.
Solution: Handle OP_TOUCH_TEMP without any guard
Fixes: https://tracker.ceph.com/issues/75957
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
}
break;
-#ifdef WITH_CRIMSON
case Transaction::OP_TOUCH_TEMP:
{
coll_t cid = i.get_cid(op->cid);
f->dump_stream("oid") << dest_oid;
}
break;
-#endif
case Transaction::OP_WRITE:
{
OP_COLL_SET_BITS = 42, // cid, bits
OP_MERGE_COLLECTION = 43, // cid, destination
-#ifdef WITH_CRIMSON
OP_TOUCH_TEMP = 44, // cid, temp_oid, target_oid
-#endif
};
// Transaction hint type
op->oid = om[op->oid];
break;
-#ifdef WITH_CRIMSON
case OP_TOUCH_TEMP:
-#endif
case OP_CLONERANGE2:
case OP_CLONE:
ceph_assert(op->cid < cm.size());
_op->oid = _get_object_id(oid);
data.ops = data.ops + 1;
}
-#ifdef WITH_CRIMSON
/**
* touch_temp
*
_op->dest_oid = _get_object_id(target_oid);
data.ops = data.ops + 1;
}
-#endif
+
/**
* Write data to an offset within an object. If the object is too
* small, it is expanded as needed. It is possible to specify an
// these operations implicity create the object
bool create = false;
if (op->op == Transaction::OP_TOUCH ||
-#ifdef WITH_CRIMSON
op->op == Transaction::OP_TOUCH_TEMP ||
-#endif
op->op == Transaction::OP_CREATE ||
op->op == Transaction::OP_WRITE ||
op->op == Transaction::OP_ZERO) {
switch (op->op) {
case Transaction::OP_CREATE:
case Transaction::OP_TOUCH:
-#ifdef WITH_CRIMSON
case Transaction::OP_TOUCH_TEMP:
-#endif
r = _touch(txc, c, o);
break;