From: myoungwon oh Date: Tue, 9 Feb 2021 10:21:47 +0000 (+0900) Subject: osd: fix wrong calculation to continue copy chunks X-Git-Tag: v17.1.0~2307^2~33 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=145fe0a7a363a00f43562270c7e4547d486bb1b3;p=ceph.git osd: fix wrong calculation to continue copy chunks 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 --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index da83656a5146..d84a605e1424 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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);