]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: add ordered flag if the object is flushing
authormyoungwon oh <omwmw@sk.com>
Tue, 5 Dec 2017 07:12:56 +0000 (16:12 +0900)
committermyoungwon oh <omwmw@sk.com>
Sun, 7 Jan 2018 13:41:12 +0000 (22:41 +0900)
Signed-off-by: Myoungwon Oh <omwmw@sk.com>
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index 682ec073491cd759451efd5b25f4deed68d0453d..32f542fe56af1a82f7adbeab06eea3d9c54bc344 100644 (file)
@@ -2383,6 +2383,11 @@ PrimaryLogPG::cache_result_t PrimaryLogPG::maybe_handle_manifest_detail(
   case object_manifest_t::TYPE_CHUNKED: 
     {
       if (can_proxy_chunked_read(op, obc)) {
+       map<hobject_t,FlushOpRef>::iterator p = flush_ops.find(obc->obs.oi.soid);
+        if (p != flush_ops.end()) {
+          do_proxy_chunked_op(op, obc->obs.oi.soid, obc, true);
+          return cache_result_t::HANDLED_PROXY;
+        }
        do_proxy_chunked_op(op, obc->obs.oi.soid, obc, write_ordered);
        return cache_result_t::HANDLED_PROXY;
       }
@@ -3311,14 +3316,14 @@ void PrimaryLogPG::do_proxy_chunked_op(OpRequestRef op, const hobject_t& missing
       dout(20) << __func__ << " chunk_index: " << chunks->first 
              << " next_length: " << chunks->second << " cursor: " 
              << p.first << dendl;
-      do_proxy_chunked_read(op, obc, i, chunks->first, p.first, chunks->second, req_len);
+      do_proxy_chunked_read(op, obc, i, chunks->first, p.first, chunks->second, req_len, write_ordered);
     }
   } 
 }
 
 void PrimaryLogPG::do_proxy_chunked_read(OpRequestRef op, ObjectContextRef obc, int op_index,
                                         uint64_t chunk_index, uint64_t req_offset, uint64_t req_length,
-                                        uint64_t req_total_len)
+                                        uint64_t req_total_len, bool write_ordered)
 {
   MOSDOp *m = static_cast<MOSDOp*>(op->get_nonconst_req());
   object_manifest_t *manifest = &obc->obs.oi.manifest;
@@ -3330,6 +3335,9 @@ void PrimaryLogPG::do_proxy_chunked_read(OpRequestRef op, ObjectContextRef obc,
   hobject_t ori_soid = m->get_hobj();
   object_locator_t oloc(soid);
   unsigned flags = CEPH_OSD_FLAG_IGNORE_CACHE | CEPH_OSD_FLAG_IGNORE_OVERLAY;
+  if (write_ordered) {
+    flags |= CEPH_OSD_FLAG_RWORDERED;
+  }
   
   if (!chunk_length || soid == hobject_t()) {
     return;
index 838053bd2f8048b20bebb5f9520ee39f498739b5..fd906e3316f2861fd45d4ffdaa6732cbe5d3c5ab 100644 (file)
@@ -1411,7 +1411,7 @@ protected:
                           ObjectContextRef obc, bool write_ordered);
   void do_proxy_chunked_read(OpRequestRef op, ObjectContextRef obc, int op_index,
                             uint64_t chunk_index, uint64_t req_offset, uint64_t req_length,
-                            uint64_t req_total_len);
+                            uint64_t req_total_len, bool write_ordered);
   bool can_proxy_chunked_read(OpRequestRef op, ObjectContextRef obc);
   void _copy_some_manifest(ObjectContextRef obc, CopyOpRef cop, uint64_t start_offset);
   void process_copy_chunk_manifest(hobject_t oid, ceph_tid_t tid, int r, uint64_t offset);