]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/store_test: extend test that reproduces bug #56488
authorAdam Kupczyk <akupczyk@redhat.com>
Thu, 13 Oct 2022 15:01:21 +0000 (15:01 +0000)
committerAdam Kupczyk <akupczyk@redhat.com>
Thu, 1 Dec 2022 09:14:58 +0000 (09:14 +0000)
Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
(cherry picked from commit 3e8e4fff587375bc7863769ce6d7fb0757bafb4c)

Conflict:
  Modified l_bluestore_* perf names to pacific's names.

src/test/objectstore/store_test.cc

index 811a23b84c759bb9177eb38d34fdea9322a1ce42..9ce18a68165fff1d95e5bb14002b9e8c68e34649 100644 (file)
@@ -8262,10 +8262,36 @@ TEST_P(StoreTestSpecificAUSize, ReproBug56488Test) {
     ASSERT_EQ(logger->get(l_bluestore_write_deferred_bytes),
       issued_dw_bytes + write_size);
   }
+  {
+    ghobject_t hoid(hobject_t("test-a", "", CEPH_NOSNAP, 0, -1, ""));
+    {
+      ObjectStore::Transaction t;
+      t.touch(cid, hoid);
+      r = queue_transaction(store, ch, std::move(t));
+      ASSERT_EQ(r, 0);
+    }
+
+    auto issued_dw = logger->get(l_bluestore_write_deferred);
+    auto issued_dw_bytes = logger->get(l_bluestore_write_deferred_bytes);
+    {
+      ObjectStore::Transaction t;
+      bufferlist bl;
+      bl.append(std::string(write_size * 2, 'x'));
+      t.write(cid, hoid, alloc_size - write_size, bl.length(), bl,
+             CEPH_OSD_OP_FLAG_FADVISE_NOCACHE);
+      r = queue_transaction(store, ch, std::move(t));
+      ASSERT_EQ(r, 0);
+    }
+    ASSERT_EQ(logger->get(l_bluestore_write_deferred), issued_dw + 2);
+    ASSERT_EQ(logger->get(l_bluestore_write_deferred_bytes),
+      issued_dw_bytes + write_size * 2);
+  }
   {
     ObjectStore::Transaction t;
     ghobject_t hoid(hobject_t("test", "", CEPH_NOSNAP, 0, -1, ""));
     t.remove(cid, hoid);
+    ghobject_t hoid_a(hobject_t("test-a", "", CEPH_NOSNAP, 0, -1, ""));
+    t.remove(cid, hoid_a);
     t.remove_collection(cid);
     cerr << "Cleaning" << std::endl;
     r = queue_transaction(store, ch, std::move(t));