From: Igor Fedotov Date: Thu, 12 Jan 2017 17:26:36 +0000 (+0000) Subject: os/store_test: extend Onode in-mem size estimation with cached data presence case. X-Git-Tag: v12.0.0~30^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ef46b4878d5b774ae2479e40c054ae9eb9871730;p=ceph.git os/store_test: extend Onode in-mem size estimation with cached data presence case. Signed-off-by: Igor Fedotov --- diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index a998e5d9a71..201c3b1f4e4 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -5664,6 +5664,7 @@ TEST_P(StoreTest, OnodeSizeTracking) { g_conf->set_val("bluestore_compression_mode", "none"); g_conf->set_val("bluestore_csum_type", "none"); g_conf->set_val("bluestore_min_alloc_size", stringify(block_size)); + g_ceph_context->_conf->set_val("bluestore_cache_size", "400000000"); g_ceph_context->_conf->apply_changes(NULL); int r = store->umount(); ASSERT_EQ(r, 0); @@ -5720,7 +5721,25 @@ TEST_P(StoreTest, OnodeSizeTracking) { f.flush(cout); cout << std::endl; } + { + bufferlist bl; + for (size_t i = 0; i < obj_size; i += 0x1000) { + store->read(cid, hoid, i, 0x1000, bl); + } + } + get_mempool_stats(&total_bytes, &total_onodes); + ASSERT_NE(total_bytes, 0u); + ASSERT_EQ(total_onodes, 1u); + { + cout <<" mempool dump:\n"; + JSONFormatter f(true); + f.open_object_section("transaction"); + mempool::dump(&f); + f.close_section(); + f.flush(cout); + cout << std::endl; + } { ObjectStore::Transaction t; t.remove(cid, hoid); @@ -5729,6 +5748,7 @@ TEST_P(StoreTest, OnodeSizeTracking) { r = apply_transaction(store, &osr, std::move(t)); ASSERT_EQ(r, 0); } + g_ceph_context->_conf->set_val("bluestore_cache_size", "4000000"); g_conf->set_val("bluestore_min_alloc_size", stringify(block_size)); g_conf->set_val("bluestore_compression_mode", "none"); g_conf->set_val("bluestore_csum_type", "crc32c");