From fa8aff9a255b097e0e3d88fa25397ab2e8698a66 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Fri, 17 Jun 2016 14:49:33 -0700 Subject: [PATCH] ReplicatedPG: require kraken feature bit on osdmap to record write errors in the pg log Older OSDs can't handle the error entries. Signed-off-by: Josh Durgin --- src/osd/ReplicatedPG.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 5e216f23a1a..47f9f945966 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1914,7 +1914,8 @@ void ReplicatedPG::do_op(OpRequestRef& op) return; } dout(20) << __func__ << "find_object_context got error " << r << dendl; - if (op->may_write()) { + if (op->may_write() && + get_osdmap()->test_flag(CEPH_OSDMAP_REQUIRE_KRAKEN)) { record_write_error(op, oid, nullptr, r); } else { osd->reply_op_error(op, r); @@ -2090,7 +2091,8 @@ void ReplicatedPG::do_op(OpRequestRef& op) if (r) { dout(20) << __func__ << " returned an error: " << r << dendl; close_op_ctx(ctx); - if (op->may_write()) { + if (op->may_write() && + get_osdmap()->test_flag(CEPH_OSDMAP_REQUIRE_KRAKEN)) { record_write_error(op, oid, nullptr, r); } else { osd->reply_op_error(op, r); @@ -6660,7 +6662,8 @@ int ReplicatedPG::prepare_transaction(OpContext *ctx) // prepare the actual mutation int result = do_osd_ops(ctx, ctx->ops); if (result < 0) { - if (ctx->op->may_write()) { + if (ctx->op->may_write() && + get_osdmap()->test_flag(CEPH_OSDMAP_REQUIRE_KRAKEN)) { // need to save the error code in the pg log, to detect dup ops, // but do nothing else ctx->update_log_only = true; -- 2.39.5