]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/test: fix not updating the object state in the error case
authormyoungwon oh <ohmyoungwon@gmail.com>
Tue, 30 Mar 2021 02:20:21 +0000 (11:20 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Tue, 30 Mar 2021 14:33:24 +0000 (23:33 +0900)
This commit prevent updating wrong state, which happens when
TierFlush receives error values.

Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/test/osd/RadosModel.h

index 63d93622a30ca87db84889d64c530ce225efa0a6..5cb37946ba153654fef32d2a723a3f6f3e02d249 100644 (file)
@@ -2954,6 +2954,8 @@ public:
     cout << num << ":  got " << cpp_strerror(r) << std::endl;
     if (r == 0) {
       // sucess
+      context->update_object_tier_flushed(oid, snap);
+      context->update_object_version(oid, completion->get_version64(), snap);
     } else if (r == -EBUSY) {
       // could fail if snap is not oldest
       ceph_assert(!context->check_oldest_snap_flushed(oid, snap)); 
@@ -2971,8 +2973,6 @@ public:
       }        
       ceph_abort_msg("shouldn't happen");
     }
-    context->update_object_tier_flushed(oid, snap);
-    context->update_object_version(oid, completion->get_version64(), snap);
     context->oid_in_use.erase(oid);
     context->oid_not_in_use.insert(oid);
     context->kick();