]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix unordered read bug (for chunked object)
authormyoungwon oh <omwmw@sk.com>
Wed, 13 Dec 2017 04:38:39 +0000 (13:38 +0900)
committermyoungwon oh <omwmw@sk.com>
Wed, 13 Dec 2017 06:48:33 +0000 (15:48 +0900)
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 <omwmw@sk.com>
src/osd/PrimaryLogPG.cc

index 2fb52543e1e9749f4c61bce5244f78cbe9848760..a19ce05f2f88e0707437f2431808be479b7b4356 100644 (file)
@@ -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;