]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
store_test::col_split_test: send bounded size transactions
authorSamuel Just <sjust@redhat.com>
Sat, 12 Nov 2016 01:45:59 +0000 (17:45 -0800)
committerSamuel Just <sjust@redhat.com>
Thu, 17 Nov 2016 18:40:16 +0000 (10:40 -0800)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/test/objectstore/store_test.cc

index b2ce0dec50acc8ab8bf999b3f009d356a834bcda..877f5a31371cce0e373bfaff8e15732154002af9 100644 (file)
@@ -4870,6 +4870,11 @@ void colsplittest(
                       52, ""));
        t.clone(cid, a, b);
       }
+      if (i % 100) {
+       r = apply_transaction(store, &osr, std::move(t));
+       ASSERT_EQ(r, 0);
+       t = ObjectStore::Transaction();
+      }
     }
     r = apply_transaction(store, &osr, std::move(t));
     ASSERT_EQ(r, 0);
@@ -4888,11 +4893,18 @@ void colsplittest(
                             INT_MAX, &objects, 0);
   ASSERT_EQ(r, 0);
   ASSERT_EQ(objects.size(), num_objects);
+  unsigned size = 0;
   for (vector<ghobject_t>::iterator i = objects.begin();
        i != objects.end();
        ++i) {
     ASSERT_EQ(!!(i->hobj.get_hash() & (1<<common_suffix_size)), 0u);
     t.remove(cid, *i);
+    if (++size > 100) {
+      size = 0;
+      r = apply_transaction(store, &osr, std::move(t));
+      ASSERT_EQ(r, 0);
+      t = ObjectStore::Transaction();
+    }
   }
 
   objects.clear();
@@ -4905,6 +4917,12 @@ void colsplittest(
        ++i) {
     ASSERT_EQ(!(i->hobj.get_hash() & (1<<common_suffix_size)), 0u);
     t.remove(tid, *i);
+    if (++size > 100) {
+      size = 0;
+      r = apply_transaction(store, &osr, std::move(t));
+      ASSERT_EQ(r, 0);
+      t = ObjectStore::Transaction();
+    }
   }
 
   t.remove_collection(cid);