]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: send decrement message to only target chunks (not all chunks)
authormyoungwon oh <ohmyoungwon@gmail.com>
Sat, 31 Oct 2020 12:25:47 +0000 (21:25 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Sat, 31 Oct 2020 12:25:47 +0000 (21:25 +0900)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsumg.com>
src/osd/PrimaryLogPG.cc

index 87b3882ee3d0425eee1992ffe7b3a0af4f1e5706..a93274b1cfd80b5cdea282f5805c470ec20a2ab2 100644 (file)
@@ -10227,18 +10227,7 @@ void PrimaryLogPG::finish_set_dedup(hobject_t oid, int r, ceph_tid_t tid, uint64
       return;    
     }
 
-    // drop all references the current chunk_map has
     object_ref_delta_t refs;
-    for (auto p : obc->obs.oi.manifest.chunk_map) {
-      refs.dec_ref(p.second.oid);
-    }
-    if (!refs.is_empty()) {
-      ctx->register_on_commit(
-       [oid, this, refs](){
-         dec_refcount(oid, refs);
-       });
-    }
-    
     ctx->at_version = get_next_version();
     ctx->new_obs = obc->obs;
     ctx->new_obs.oi.clear_flag(object_info_t::FLAG_DIRTY);
@@ -10248,6 +10237,14 @@ void PrimaryLogPG::finish_set_dedup(hobject_t oid, int r, ceph_tid_t tid, uint64
       info.length = p.second.second;
       info.oid =  p.first;
       ctx->new_obs.oi.manifest.chunk_map[p.second.first] = info;
+      // drop all references issued before
+      refs.dec_ref(p.first);
+    }
+    if (!refs.is_empty()) {
+      ctx->register_on_commit(
+        [oid, this, refs](){
+          dec_refcount(oid, refs);
+        });
     }
   
     finish_ctx(ctx.get(), pg_log_entry_t::CLEAN);