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>
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);