]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/ObjectCacher: set complete flag when we observe ENOENT
authorSage Weil <sage@inktank.com>
Wed, 24 Oct 2012 21:41:38 +0000 (14:41 -0700)
committerSage Weil <sage@inktank.com>
Fri, 26 Oct 2012 18:31:45 +0000 (11:31 -0700)
If we observe an ENOENT on a read, set the complete flag.  Any dirty
buffers we have will still be in memory, even if the write are in flight,
because the TX state remains pinned until the writes commit.  Writes cannot
proceed faster than reads, even though reads may proceed faster than
writes.

Signed-off-by: Sage Weil <sage@inktank.com>
src/osdc/ObjectCacher.cc

index 708fb4872f14f204baa654312c570add24b0df64..c56423b32a67dec7cd27108db76f622197c37254 100644 (file)
@@ -562,6 +562,11 @@ void ObjectCacher::bh_read_finish(int64_t poolid, sobject_t oid, loff_t start,
   } else {
     Object *ob = objects[poolid][oid];
     
+    if (r == -ENOENT && !ob->complete) {
+      ldout(cct, 7) << "bh_read_finish ENOENT, marking complete on " << *ob << dendl;
+      ob->complete = true;
+    }
+
     // apply to bh's!
     loff_t opos = start;
     while (true) {