From 43aad06d09dcc4937a01c3f5b2cc7c1c5de27ea7 Mon Sep 17 00:00:00 2001 From: Sanal P Date: Wed, 7 Feb 2024 18:04:03 -0700 Subject: [PATCH] Add lock is blk alloced to fix assert. There seems a concurrency issue when is blk alloced fails in test_data_service. --- src/lib/device/virtual_dev.cpp | 2 +- src/tests/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/device/virtual_dev.cpp b/src/lib/device/virtual_dev.cpp index c534c2d71..7153d31b6 100644 --- a/src/lib/device/virtual_dev.cpp +++ b/src/lib/device/virtual_dev.cpp @@ -149,7 +149,7 @@ folly::Future< std::error_code > VirtualDev::async_format() { } bool VirtualDev::is_blk_alloced(BlkId const& blkid) const { - return m_dmgr.get_chunk(blkid.chunk_num())->blk_allocator()->is_blk_alloced(blkid); + return m_dmgr.get_chunk(blkid.chunk_num())->blk_allocator()->is_blk_alloced(blkid, true /* lock */); } BlkAllocStatus VirtualDev::commit_blk(BlkId const& blkid) { diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index fac27aa58..e5f4ea0b2 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -110,7 +110,7 @@ if (${io_tests}) if(${epoll_tests}) # add_test(NAME LogStore-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_log_store) add_test(NAME MetaBlkMgr-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_meta_blk_mgr) - # add_test(NAME DataService-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_data_service) + add_test(NAME DataService-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_data_service) # add_test(NAME SoloReplDev-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_solo_repl_dev) # add_test(NAME HomeRaftLogStore-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_home_raft_logstore)