From: huangjun Date: Wed, 11 Oct 2017 09:29:46 +0000 (+0800) Subject: osd: don't check overwrite flag when handling copy-get X-Git-Tag: v14.0.1~1230^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fb50f43244f0a9bc59f9aa4e2319cc8c6bc0cfdc;p=ceph.git osd: don't check overwrite flag when handling copy-get For erasure code pool, set max_size to N*stripe_width when doing copy-get, to avoid extra read. Fixes: http://tracker.ceph.com/issues/21756 Signed-off-by: huangjun --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index efdd53e017db..8f7de0f1d166 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -8020,7 +8020,7 @@ void PrimaryLogPG::_write_copy_chunk(CopyOpRef cop, PGTransaction *t) if (!cop->temp_cursor.data_complete) { assert(cop->data.length() + cop->temp_cursor.data_offset == cop->cursor.data_offset); - if (pool.info.requires_aligned_append() && + if (pool.info.required_alignment() && !cop->cursor.data_complete) { /** * Trim off the unaligned bit at the end, we'll adjust cursor.data_offset diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index 3e9de77ef767..559c5477c03e 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -1269,7 +1269,7 @@ protected: void _write_copy_chunk(CopyOpRef cop, PGTransaction *t); uint64_t get_copy_chunk_size() const { uint64_t size = cct->_conf->osd_copyfrom_max_chunk; - if (pool.info.requires_aligned_append()) { + if (pool.info.required_alignment()) { uint64_t alignment = pool.info.required_alignment(); if (size % alignment) { size += alignment - (size % alignment);