From 68dc3eb81ed9cfcb93999fbbc4d8619994b014e3 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Fri, 12 Jun 2026 07:29:18 +0530 Subject: [PATCH] core: Handle OP_TOUCH_TEMP in BlueStore without any guard(WITH_CRIMSON) 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 --- src/os/Transaction.cc | 2 -- src/os/Transaction.h | 7 +------ src/os/bluestore/BlueStore.cc | 4 ---- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/os/Transaction.cc b/src/os/Transaction.cc index 960dfd30191..21539e91171 100644 --- a/src/os/Transaction.cc +++ b/src/os/Transaction.cc @@ -87,7 +87,6 @@ void Transaction::dump(ceph::Formatter *f) } break; -#ifdef WITH_CRIMSON case Transaction::OP_TOUCH_TEMP: { coll_t cid = i.get_cid(op->cid); @@ -99,7 +98,6 @@ void Transaction::dump(ceph::Formatter *f) f->dump_stream("oid") << dest_oid; } break; -#endif case Transaction::OP_WRITE: { diff --git a/src/os/Transaction.h b/src/os/Transaction.h index d4c3623addd..220e701f45d 100644 --- a/src/os/Transaction.h +++ b/src/os/Transaction.h @@ -153,9 +153,7 @@ public: 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 @@ -442,9 +440,7 @@ public: 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()); @@ -862,7 +858,6 @@ public: _op->oid = _get_object_id(oid); data.ops = data.ops + 1; } -#ifdef WITH_CRIMSON /** * touch_temp * @@ -884,7 +879,7 @@ public: _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 diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index bbfd74a2175..1720efc3d5b 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -16226,9 +16226,7 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t) // 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) { @@ -16252,9 +16250,7 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t) 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; -- 2.47.3