]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/test: generate useful log regarding ENOENT
authormyoungwon oh <ohmyoungwon@gmail.com>
Mon, 8 Mar 2021 12:04:35 +0000 (21:04 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Mon, 29 Mar 2021 08:23:53 +0000 (17:23 +0900)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/test/osd/RadosModel.h

index e0510e8a2c969db339c86e8129beb29a38cac84a..63d93622a30ca87db84889d64c530ce225efa0a6 100644 (file)
@@ -2957,9 +2957,18 @@ public:
     } else if (r == -EBUSY) {
       // could fail if snap is not oldest
       ceph_assert(!context->check_oldest_snap_flushed(oid, snap)); 
-    } else if (r == -ENOENT && src_value.deleted()) {
+    } else if (r == -ENOENT) {
       // could fail if object is removed
+      if (src_value.deleted()) {
+       cout << num << ":  got expected ENOENT (src dne)" << std::endl;
+      } else {
+       cerr << num << ": got unexpected ENOENT" << std::endl;
+       ceph_abort();
+      }
     } else {
+      if (r != -ENOENT && src_value.deleted()) {
+       cerr << num << ": src dne, but r is not ENOENT" << std::endl;
+      }        
       ceph_abort_msg("shouldn't happen");
     }
     context->update_object_tier_flushed(oid, snap);
@@ -3052,12 +3061,21 @@ public:
     if (r == 0) {
       // ok
     } else if (r == -EINVAL) {
-      // modifying manifeset object makes existing chunk_map clear
+      // modifying manifest object makes existing chunk_map clear
       // as a result, the modified object is no longer manifest object 
       // this casues to return -EINVAL
-    } else if (r == -ENOENT && src_value.deleted()) {
+    } else if (r == -ENOENT) {
       // could fail if object is removed
+      if (src_value.deleted()) {
+       cout << num << ":  got expected ENOENT (src dne)" << std::endl;
+      } else {
+       cerr << num << ": got unexpected ENOENT" << std::endl;
+       ceph_abort();
+      }
     } else {
+      if (r != -ENOENT && src_value.deleted()) {
+       cerr << num << ": src dne, but r is not ENOENT" << std::endl;
+      }        
       ceph_abort_msg("shouldn't happen");
     }
     context->oid_in_use.erase(oid);