]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/osd/RadosModel: check retval of read op
authorKefu Chai <kchai@redhat.com>
Mon, 24 Aug 2020 11:06:11 +0000 (19:06 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 30 Aug 2020 10:34:18 +0000 (18:34 +0800)
* check racing read's return value
* check if racing read completes

Fixes: https://tracker.ceph.com/issues/47061
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/osd/RadosModel.h

index ae0efb373cdfab3322e8c6420543f12f673c08bb..7612b69c1f49fe745d3b14021dd71ab1291d59a8 100644 (file)
@@ -755,6 +755,7 @@ public:
   ContDesc cont;
   set<librados::AioCompletion *> waiting;
   librados::AioCompletion *rcompletion = nullptr;
+  // numbers of async ops submitted
   uint64_t waiting_on = 0;
   uint64_t last_acked_tid = 0;
 
@@ -1095,12 +1096,15 @@ public:
       }
 
       context->update_object_version(oid, version);
+      ceph_assert(rcompletion->is_complete());
+      ceph_assert(rcompletion->get_return_value() == 1);
       if (rcompletion->get_version64() != version) {
        cerr << "Error: racing read on " << oid << " returned version "
             << rcompletion->get_version64() << " rather than version "
             << version << std::endl;
        ceph_abort_msg("racing read got wrong version");
       }
+      rcompletion->release();
 
       {
        ObjectDesc old_value;
@@ -1112,7 +1116,6 @@ public:
                    << old_value.most_recent() << std::endl;
       }
 
-      rcompletion->release();
       context->oid_in_use.erase(oid);
       context->oid_not_in_use.insert(oid);
       context->kick();