From 2ca2c1b97869fecd0ef511eecb94a91204515287 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Tue, 1 Sep 2015 12:49:06 -0700 Subject: [PATCH] osd, test: Minor clean-up from fast-read and error handling ec changes Signed-off-by: David Zafman --- src/osd/ECBackend.cc | 9 +++++---- src/osd/ReplicatedPG.cc | 2 ++ src/test/erasure-code/test-erasure-eio.sh | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index aef52a03476a..305c17f266a4 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -1001,7 +1001,7 @@ void ECBackend::handle_sub_read_reply( map::iterator iter = tid_to_read_map.find(op.tid); if (iter == tid_to_read_map.end()) { //canceled - dout(10) << __func__ << ": abort " << op << dendl; + dout(20) << __func__ << ": dropped " << op << dendl; return; } ReadOp &rop = iter->second; @@ -1082,7 +1082,6 @@ void ECBackend::handle_sub_read_reply( set want_to_read, dummy_minimum; get_want_to_read_shards(&want_to_read); int err; - // XXX: Could just do if (have.size < ec_impl->get_data_chunk_count()) if ((err = ec_impl->minimum_to_decode(want_to_read, have, &dummy_minimum)) < 0) { dout(20) << __func__ << " minimum_to_decode failed" << dendl; if (rop.in_progress.empty()) { @@ -1610,6 +1609,7 @@ void ECBackend::start_read_op( dout(10) << __func__ << ": started " << op << dendl; } +// This is based on start_read_op(), maybe this should be refactored void ECBackend::start_remaining_read_op( ReadOp &op, map &to_read) @@ -1621,7 +1621,8 @@ void ECBackend::start_remaining_read_op( dout(10) << __func__ << ": starting additional " << op << dendl; map messages; - for (map::iterator i = op.to_read.begin(); + for (map::iterator i = op.to_read.begin(); i != op.to_read.end(); ++i) { bool need_attrs = i->second.want_attrs; @@ -1956,7 +1957,7 @@ int ECBackend::objects_remaining_read_async( ReadOp &rop) { set already_read; - set ots = rop.obj_to_source[hoid]; + const set& ots = rop.obj_to_source[hoid]; for (set::iterator i = ots.begin(); i != ots.end(); ++i) already_read.insert(i->shard); dout(10) << __func__ << " have/error shards=" << already_read << dendl; diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 9485f0eae157..4c704ee9f139 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -3667,6 +3667,8 @@ struct FillInVerifyExtent : public Context { void finish(int len) { *rval = len; *r = len; + if (len < 0) + return; // whole object? can we verify the checksum? if (maybe_crc && *r == size) { uint32_t crc = outdatap->crc32c(-1); diff --git a/src/test/erasure-code/test-erasure-eio.sh b/src/test/erasure-code/test-erasure-eio.sh index fe465c93bda3..129d09b7ec81 100755 --- a/src/test/erasure-code/test-erasure-eio.sh +++ b/src/test/erasure-code/test-erasure-eio.sh @@ -102,7 +102,7 @@ function rados_get() { if [ $expect = "1" ]; then ! ./rados --pool $poolname get $objname $dir/COPY - return $? + return fi # # get an object, compare with $dir/ORIGINAL -- 2.47.3