]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/osd_types: include PG log return codes in object copy data
authorJason Dillaman <dillaman@redhat.com>
Thu, 18 Oct 2018 14:17:42 +0000 (10:17 -0400)
committerJason Dillaman <dillaman@redhat.com>
Mon, 29 Oct 2018 14:48:32 +0000 (10:48 -0400)
If the base tier records an error against an operation, the cache
tier currently might incorrectly respond with a success return code.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/osd/osd_types.cc
src/osd/osd_types.h

index 79b0ab8482b7d894432bcbc995ee6a0d7de73b24..dc02c3ff11b9e9995028e4dcedf80a12ef3b5137 100644 (file)
@@ -4495,7 +4495,7 @@ void object_copy_cursor_t::generate_test_instances(list<object_copy_cursor_t*>&
 
 void object_copy_data_t::encode(bufferlist& bl, uint64_t features) const
 {
-  ENCODE_START(7, 5, bl);
+  ENCODE_START(8, 5, bl);
   encode(size, bl);
   encode(mtime, bl);
   encode(attrs, bl);
@@ -4511,6 +4511,7 @@ void object_copy_data_t::encode(bufferlist& bl, uint64_t features) const
   encode(reqids, bl);
   encode(truncate_seq, bl);
   encode(truncate_size, bl);
+  encode(reqid_return_codes, bl);
   ENCODE_FINISH(bl);
 }
 
@@ -4574,6 +4575,9 @@ void object_copy_data_t::decode(bufferlist::const_iterator& bl)
       decode(truncate_seq, bl);
       decode(truncate_size, bl);
     }
+    if (struct_v >= 8) {
+      decode(reqid_return_codes, bl);
+    }
   }
   DECODE_FINISH(bl);
 }
@@ -4633,12 +4637,17 @@ void object_copy_data_t::dump(Formatter *f) const
     f->dump_unsigned("snap", *p);
   f->close_section();
   f->open_array_section("reqids");
+  uint32_t idx = 0;
   for (auto p = reqids.begin();
        p != reqids.end();
-       ++p) {
+       ++idx, ++p) {
     f->open_object_section("extra_reqid");
     f->dump_stream("reqid") << p->first;
     f->dump_stream("user_version") << p->second;
+    auto it = reqid_return_codes.find(idx);
+    if (it != reqid_return_codes.end()) {
+      f->dump_int("return_code", it->second);
+    }
     f->close_section();
   }
   f->close_section();
index c87e3bccf46c5ea6efd020d456152bd365916e2e..cd92a1c76a29fc36e04f0c39861acc65f7960923 100644 (file)
@@ -4484,6 +4484,9 @@ struct object_copy_data_t {
   ///< recent reqids on this object
   mempool::osd_pglog::vector<pair<osd_reqid_t, version_t> > reqids;
 
+  ///< map reqids by index to error return code (if any)
+  mempool::osd_pglog::map<uint32_t, int> reqid_return_codes;
+
   uint64_t truncate_seq;
   uint64_t truncate_size;