]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG::get_snapset_context: set exists to false for new ssc with can_create 6017/head
authorSamuel Just <sjust@redhat.com>
Thu, 17 Sep 2015 23:49:53 +0000 (16:49 -0700)
committerSamuel Just <sjust@redhat.com>
Fri, 18 Sep 2015 17:03:22 +0000 (10:03 -0700)
Otherwise, if we do a proxy_write and don't promote it, the ssc will
stick around with exists = true and cause future reads on snaps for the
object to fail to fall through to the base tier.

Fixes: #13150
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ReplicatedPG.cc

index 52bb6deff9da2de66eb4fa89d24f40e920d57c52..9e432b5237ad238dce04c3349eea1b0aec18e193 100644 (file)
@@ -8447,7 +8447,7 @@ int ReplicatedPG::find_object_context(const hobject_t& oid,
   }
 
   SnapSetContext *ssc = get_snapset_context(oid, can_create);
-  if (!ssc || !(ssc->exists)) {
+  if (!ssc || !(ssc->exists || can_create)) {
     dout(20) << __func__ << " " << oid << " no snapset" << dendl;
     if (pmissing)
       *pmissing = head;  // start by getting the head
@@ -8695,7 +8695,6 @@ SnapSetContext *ReplicatedPG::get_snapset_context(
   if (p != snapset_contexts.end()) {
     if (can_create || p->second->exists) {
       ssc = p->second;
-      ssc->exists = true;
     } else {
       return NULL;
     }
@@ -8718,6 +8717,9 @@ SnapSetContext *ReplicatedPG::get_snapset_context(
     if (bv.length()) {
       bufferlist::iterator bvp = bv.begin();
       ssc->snapset.decode(bvp);
+      ssc->exists = true;
+    } else {
+      ssc->exists = false;
     }
   }
   assert(ssc);