]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ECBackend: suppress 'Error -2 reading object' if EC fast reads 24225/head
authorSage Weil <sage@redhat.com>
Sat, 22 Sep 2018 15:42:20 +0000 (10:42 -0500)
committerSage Weil <sage@redhat.com>
Sat, 22 Sep 2018 15:42:20 +0000 (10:42 -0500)
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 <sage@redhat.com>
src/osd/ECBackend.cc

index 44d4f63054ebae40f2893c8387d21ceb62a4d25b..b69112c2b5c17e5ba1a289b56012516333f5bc51 100644 (file)
@@ -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;