From 9ef5a956cb2aab43e44e022f6d086403053675b1 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 22 Sep 2018 10:42:20 -0500 Subject: [PATCH] osd/ECBackend: suppress 'Error -2 reading object' if EC fast reads When fast reads are enabled, it's possible for the ordering of a shard read to not be enforced with respect to writes that come after because the read completes on the primary before all shards reply. This can lead to an ENOENT on the non-primary, and an ERR message in the cluster log, even though everything is fine. (The reply will go back to the primary with the error but it will be ignored since the read has completed.) Suppress the error message so we don't see these ERR messages in the cluster log during the normal course of events. Fixes: http://tracker.ceph.com/issues/26972 Signed-off-by: Sage Weil --- src/osd/ECBackend.cc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index 44d4f63054eba..b69112c2b5c17 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -1001,11 +1001,20 @@ void ECBackend::handle_sub_read( } if (r < 0) { - get_parent()->clog_error() << "Error " << r - << " reading object " - << i->first; - dout(5) << __func__ << ": Error " << r - << " reading " << i->first << dendl; + // if we are doing fast reads, it's possible for one of the shard + // reads to cross paths with another update and get a (harmless) + // ENOENT. Suppress the message to the cluster log in that case. + if (r == -ENOENT && get_parent()->get_pool().fast_read) { + dout(5) << __func__ << ": Error " << r + << " reading " << i->first << ", fast read, probably ok" + << dendl; + } else { + get_parent()->clog_error() << "Error " << r + << " reading object " + << i->first; + dout(5) << __func__ << ": Error " << r + << " reading " << i->first << dendl; + } goto error; } else { dout(20) << __func__ << " read request=" << j->get<1>() << " r=" << r << " len=" << bl.length() << dendl; -- 2.39.5