Skip to content

Commit 8c68a50

Browse files
author
Pere Diaz Bou
committed
os/bluestore: test _extend_log sequence advance
Signed-off-by: Pere Diaz Bou <[email protected]>
1 parent 81cc774 commit 8c68a50

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/test/objectstore/test_bluefs.cc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,6 +1559,30 @@ TEST(BlueFS, test_log_runway_3) {
15591559
}
15601560
}
15611561

1562+
TEST(BlueFS, test_log_runway_advance_seq) {
1563+
uint64_t max_log_runway = 65536;
1564+
ConfSaver conf(g_ceph_context->_conf);
1565+
conf.SetVal("bluefs_alloc_size", "4096");
1566+
conf.SetVal("bluefs_shared_alloc_size", "4096");
1567+
conf.SetVal("bluefs_compact_log_sync", "false");
1568+
conf.SetVal("bluefs_min_log_runway", "32768");
1569+
conf.SetVal("bluefs_max_log_runway", std::to_string(max_log_runway).c_str());
1570+
conf.ApplyChanges();
1571+
1572+
uint64_t size = 1048576 * 128;
1573+
TempBdev bdev{size};
1574+
BlueFS fs(g_ceph_context);
1575+
ASSERT_EQ(0, fs.add_block_device(BlueFS::BDEV_DB, bdev.path, false));
1576+
uuid_d fsid;
1577+
ASSERT_EQ(0, fs.mkfs(fsid, { BlueFS::BDEV_DB, false, false }));
1578+
ASSERT_EQ(0, fs.mount());
1579+
ASSERT_EQ(0, fs.maybe_verify_layout({ BlueFS::BDEV_DB, false, false }));
1580+
1581+
std::string longdir(max_log_runway*2, 'A');
1582+
ASSERT_EQ(fs.mkdir(longdir), 0);
1583+
fs.compact_log();
1584+
}
1585+
15621586
int main(int argc, char **argv) {
15631587
auto args = argv_to_vec(argc, argv);
15641588
map<string,string> defaults = {

0 commit comments

Comments
 (0)