From: myoungwon oh Date: Wed, 13 Dec 2017 04:38:39 +0000 (+0900) Subject: osd: fix unordered read bug (for chunked object) X-Git-Tag: v13.0.2~762^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d70b71aa2f87013975d7fee16be549bf24944b72;p=ceph.git osd: fix unordered read bug (for chunked object) The current implementation for chunked object only supports proxy_read(if offset is within range) and write(local write) In this case, a read request can be handled before a write request. This commit prevents unordered read processing because proxy_read() will be executed if the chunk is missing state. If chunked object has been overwritten, its state will not be missing. Fixes: http://tracker.ceph.com/issues/22369 Signed-off-by: Myoungwon Oh --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 2fb52543e1e9..a19ce05f2f88 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -3214,6 +3214,9 @@ bool PrimaryLogPG::can_proxy_chunked_read(OpRequestRef op, ObjectContextRef obc) /* requested chunks exist in chunk_map ? */ for (auto &p : obc->obs.oi.manifest.chunk_map) { if (p.first <= cursor && p.first + p.second.length > cursor) { + if (p.second.flags != chunk_info_t::FLAG_MISSING) { + return false; + } if (p.second.length >= remain) { remain = 0; break;