]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix wrong calculation to continue copy chunks
authormyoungwon oh <ohmyoungwon@gmail.com>
Tue, 9 Feb 2021 10:21:47 +0000 (19:21 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Mon, 29 Mar 2021 08:13:02 +0000 (17:13 +0900)
If the last offset, which indicate the last copy completed, is less then
the offset of the last entry,
copy_some_manifest should be called to copy remaining chunks.
This commit fixes miscalculation to conitnue copy chunks.

Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/osd/PrimaryLogPG.cc

index da83656a5146597e49acbb4c01d5e169259122d6..d84a605e14242e9f0e90ed3a0274afdc46913dbb 100644 (file)
@@ -9664,11 +9664,12 @@ void PrimaryLogPG::process_copy_chunk_manifest(hobject_t oid, ceph_tid_t tid, in
     ctx->at_version = get_next_version();
     finish_ctx(ctx.get(), pg_log_entry_t::PROMOTE);
     simple_opc_submit(std::move(ctx));
+    obj_cop->chunk_cops.clear();
 
     auto p = cobc->obs.oi.manifest.chunk_map.rbegin();
     /* check remaining work */
     if (p != cobc->obs.oi.manifest.chunk_map.rend()) {
-      if (obj_cop->last_offset >= p->first + p->second.length) {
+      if (obj_cop->last_offset < p->first) {
        for (auto &en : cobc->obs.oi.manifest.chunk_map) {
          if (obj_cop->last_offset < en.first) {
            _copy_some_manifest(cobc, obj_cop, en.first);