From: Josh Durgin Date: Fri, 7 Feb 2014 02:20:06 +0000 (-0800) Subject: ReplicatedPG: set individual osd op rvals X-Git-Tag: v0.78~154^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1d661ca97299352ef96f923baf1ead0ef5d7bb8e;p=ceph.git ReplicatedPG: set individual osd op rvals This takes care of things that can fail before transaction is executed, like omap comparison. Getting individual rvals from a transaction requires more refactoring, so I'm leaving it for a later cleanup. Fixes: #6483 Signed-off-by: Josh Durgin --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 3202c658a924..9a04358ec5c6 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -4385,6 +4385,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) ctx->bytes_read += osd_op.outdata.length(); fail: + osd_op.rval = result; if (result < 0 && (op.flags & CEPH_OSD_OP_FLAG_FAILOK)) result = 0; diff --git a/src/test/librados/c_read_operations.cc b/src/test/librados/c_read_operations.cc index 90fb8afc078b..106f6b4f162d 100644 --- a/src/test/librados/c_read_operations.cc +++ b/src/test/librados/c_read_operations.cc @@ -135,7 +135,7 @@ TEST_F(CReadOpsTest, SetOpFlags) { &bytes_read, &rval); rados_read_op_set_flags(op, LIBRADOS_OP_FLAG_FAILOK); EXPECT_EQ(0, rados_read_op_operate(op, ioctx, obj, 0)); - EXPECT_EQ(0, rval); + EXPECT_EQ(-EIO, rval); EXPECT_EQ(0u, bytes_read); EXPECT_EQ((char*)NULL, out); rados_release_read_op(op); @@ -477,8 +477,7 @@ TEST_F(CReadOpsTest, Omap) { rados_write_op_omap_rm_keys(op, keys, 2); EXPECT_EQ(-ECANCELED, rados_write_op_operate(op, ioctx, obj, NULL, 0)); rados_release_write_op(op); - // due to http://tracker.ceph.com/issues/6483 this is 0: - EXPECT_EQ(0, r_vals); + ASSERT_EQ(-ECANCELED, r_vals); // verifying the keys are still there, and then remove them op = rados_create_write_op();