]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/store_test: Retune tests to current code 56138/head
authorAdam Kupczyk <akupczyk@ibm.com>
Fri, 17 Feb 2023 14:51:55 +0000 (14:51 +0000)
committerIgor Fedotov <igor.fedotov@croit.io>
Tue, 12 Mar 2024 11:07:49 +0000 (14:07 +0300)
After introduction of lazy statfs updates and mechanism to store them at exit,
some tests required tune-up.

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
(cherry picked from commit 85f03d314e7ea5a3ed22fdd3eaca1349e5c23710)

src/os/bluestore/BlueStore.cc
src/test/objectstore/store_test.cc

index ebf70f76e68cefdb8b645bac2e7a39533828354e..959145c468f5ee87a509ef799d519425987ba509 100644 (file)
@@ -10230,6 +10230,9 @@ void BlueStore::inject_global_statfs(const store_statfs_t& new_statfs)
   v.encode(bl);
   t->set(PREFIX_STAT, BLUESTORE_GLOBAL_STATFS_KEY, bl);
   db->submit_transaction_sync(t);
+  // must set these; are needed at _close_db() statfs persisting
+  per_pool_stat_collection = false;
+  vstatfs = new_statfs;
 }
 
 void BlueStore::inject_misreference(coll_t cid1, ghobject_t oid1,
index 8dc7cfe433ffd9d5de285cfb5fb26ba68b0586bf..839ce145ca0b16b80c7f359dfde992308d6fd6f4 100644 (file)
@@ -9339,9 +9339,10 @@ TEST_P(StoreTestSpecificAUSize, BluestoreRepairTest) {
 
   //////////// verify invalid statfs ///////////
   cerr << "fix invalid statfs" << std::endl;
-  SetVal(g_conf(), "bluestore_fsck_error_on_no_per_pool_stats", "true");
+  SetVal(g_conf(), "bluestore_fsck_error_on_no_per_pool_stats", "false");
+  // disable allocation recovery - it will fix statfs too
   SetVal(g_conf(),
-    "bluestore_debug_inject_allocation_from_file_failure", "1");
+    "bluestore_debug_inject_allocation_from_file_failure", "0");
   store_statfs_t statfs0;
   store_statfs_t statfs;
   bstore->mount();
@@ -9351,7 +9352,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreRepairTest) {
   statfs.data_stored += 0x10000;
   ASSERT_FALSE(statfs0 == statfs);
   // this enforces global stats usage
-  bstore->inject_statfs("bluestore_statfs", statfs);
+  bstore->inject_global_statfs(statfs);
   bstore->umount();
 
   ASSERT_GE(bstore->fsck(false), 1); // global stats mismatch might omitted when
@@ -9375,10 +9376,10 @@ TEST_P(StoreTestSpecificAUSize, BluestoreRepairTest) {
   statfs.data_stored += 0x20000;
   ASSERT_FALSE(statfs0 == statfs);
   // this enforces global stats usage
-  bstore->inject_statfs("bluestore_statfs", statfs);
+  bstore->inject_global_statfs(statfs);
   bstore->umount();
 
-  ASSERT_EQ(bstore->fsck(false), 2);
+  ASSERT_EQ(bstore->fsck(false), 1);
   ASSERT_EQ(bstore->repair(false), 0);
   ASSERT_EQ(bstore->fsck(false), 0);
   ASSERT_EQ(bstore->mount(), 0);