struct FLTreeOnode final : Onode, Value {
static constexpr tree_conf_t TREE_CONF = {
value_magic_t::ONODE,
- 128, // max_ns_size
- 320, // max_oid_size
+ 256, // max_ns_size
+ // same to option osd_max_object_namespace_len
+ 2048, // max_oid_size
+ // same to option osd_max_object_name_len
1200, // max_value_payload_size
- 4096, // internal_node_size
- 4096 // leaf_node_size
+ // see crimson::os::seastore::onode_layout_t
+ 8192, // internal_node_size
+ // see the formula in validate_tree_config
+ 16384 // leaf_node_size
+ // see the formula in validate_tree_config
};
enum class status_t {
}
static KVPool create_raw_range(
- const std::vector<size_t>& str_sizes,
+ const std::vector<size_t>& ns_sizes,
+ const std::vector<size_t>& oid_sizes,
const std::vector<size_t>& value_sizes,
const std::pair<index_t, index_t>& range2,
const std::pair<index_t, index_t>& range1,
ns_size = 0;
oid_size = 0;
} else {
- ns_size = str_sizes[rd() % str_sizes.size()];
- oid_size = str_sizes[rd() % str_sizes.size()];
+ ns_size = ns_sizes[rd() % ns_sizes.size()];
+ oid_size = oid_sizes[rd() % oid_sizes.size()];
assert(ns_size && oid_size);
}
for (index_t k = range0.first; k < range0.second; ++k) {
case value_magic_t::TEST_BOUNDED:
ret = std::make_unique<BoundedValue::Recorder>(encoded);
break;
+ case value_magic_t::TEST_EXTENDED:
+ ret = std::make_unique<ExtendedValue::Recorder>(encoded);
+ break;
default:
ret = nullptr;
break;
ONODE = 0x52,
TEST_UNBOUND,
TEST_BOUNDED,
+ TEST_EXTENDED,
};
inline std::ostream& operator<<(std::ostream& os, const value_magic_t& magic) {
switch (magic) {
return os << "TEST_UNBOUND";
case value_magic_t::TEST_BOUNDED:
return os << "TEST_BOUNDED";
+ case value_magic_t::TEST_EXTENDED:
+ return os << "TEST_EXTENDED";
default:
return os << "UNKNOWN(" << magic << ")";
}
constexpr bool TEST_SEASTORE = true;
constexpr bool TRACK_CURSORS = true;
auto kvs = KVPool<test_item_t>::create_raw_range(
- {8, 11, 64, 256, 301, 320},
+ {8, 11, 64, 256, 301, 320},
+ {8, 11, 64, 256, 301, 320},
{8, 16, 128, 512, 576, 640},
{0, 16}, {0, 10}, {0, 4});
auto moved_nm = (TEST_SEASTORE ? NodeExtentManager::create_seastore(*tm)
constexpr double EAGAIN_PROBABILITY = 0.1;
constexpr bool TRACK_CURSORS = false;
auto kvs = KVPool<test_item_t>::create_raw_range(
- {8, 11, 64, 256, 301, 320},
- {8, 16, 128, 512, 576, 640},
+ {8, 11, 64, 128, 255, 256},
+ {8, 13, 64, 512, 2035, 2048},
+ {8, 16, 128, 576, 992, 1200},
{0, 8}, {0, 10}, {0, 4});
auto moved_nm = NodeExtentManager::create_seastore(
*tm, L_ADDR_MIN, EAGAIN_PROBABILITY);
auto p_nm = static_cast<SeastoreNodeExtentManager<true>*>(moved_nm.get());
- auto tree = std::make_unique<TreeBuilder<TRACK_CURSORS, BoundedValue>>(
+ auto tree = std::make_unique<TreeBuilder<TRACK_CURSORS, ExtendedValue>>(
kvs, std::move(moved_nm));
unsigned num_ops = 0;
unsigned num_ops_eagain = 0;
};
using UnboundedValue = TestValue<
- value_magic_t::TEST_UNBOUND, 4096, 4096, 4096, 4096, 4096, false>;
+ value_magic_t::TEST_UNBOUND, 4096, 4096, 4096, 4096, 4096, false>;
using BoundedValue = TestValue<
- value_magic_t::TEST_BOUNDED, 320, 320, 640, 4096, 4096, true>;
+ value_magic_t::TEST_BOUNDED, 320, 320, 640, 4096, 4096, true>;
+// should be the same configuration with FLTreeOnode
+using ExtendedValue = TestValue<
+ value_magic_t::TEST_EXTENDED, 256, 2048, 1200, 8192, 16384, true>;
}
seastar::future<> run(KVPool<test_item_t>& kvs, double erase_ratio) {
return tm_setup().then([this, &kvs, erase_ratio] {
return seastar::async([this, &kvs, erase_ratio] {
- auto tree = std::make_unique<TreeBuilder<TRACK, BoundedValue>>(kvs,
+ auto tree = std::make_unique<TreeBuilder<TRACK, ExtendedValue>>(kvs,
(is_dummy ? NodeExtentManager::create_dummy(true)
: NodeExtentManager::create_seastore(*tm)));
{
} else {
ceph_abort(false && "invalid backend");
}
- auto str_sizes = config["str-sizes"].as<std::vector<size_t>>();
+ auto ns_sizes = config["ns-sizes"].as<std::vector<size_t>>();
+ auto oid_sizes = config["oid-sizes"].as<std::vector<size_t>>();
auto onode_sizes = config["onode-sizes"].as<std::vector<size_t>>();
auto range2 = config["range2"].as<std::vector<int>>();
ceph_assert(range2.size() == 2);
});
auto kvs = KVPool<test_item_t>::create_raw_range(
- str_sizes, onode_sizes,
+ ns_sizes, oid_sizes, onode_sizes,
{range2[0], range2[1]},
{range1[0], range1[1]},
{range0[0], range0[1]});
"tree backend: dummy, seastore")
("tracked", bpo::value<bool>()->default_value(false),
"track inserted cursors")
- ("str-sizes", bpo::value<std::vector<size_t>>()->default_value(
- {8, 11, 64, 256, 301, 320}),
- "sizes of ns/oid strings")
+ ("ns-sizes", bpo::value<std::vector<size_t>>()->default_value(
+ {8, 11, 64, 128, 255, 256}),
+ "sizes of ns strings")
+ ("oid-sizes", bpo::value<std::vector<size_t>>()->default_value(
+ {8, 13, 64, 512, 2035, 2048}),
+ "sizes of oid strings")
("onode-sizes", bpo::value<std::vector<size_t>>()->default_value(
- {8, 16, 128, 512, 576, 640}),
+ {8, 16, 128, 576, 992, 1200}),
"sizes of onode")
("range2", bpo::value<std::vector<int>>()->default_value(
{0, 128}),