diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp index fe909c326832..59ecd2ba841f 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp @@ -1611,9 +1611,10 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { UNIT_ASSERT(ConvertIPartsToString(parts.Get()) == res->Data.ToString().Slice()); } } + Y_UNIT_TEST(ChunkWriteDifferentOffsetAndSize) { - for (ui32 i = 0; i <= 3; ++i) { - ChunkWriteDifferentOffsetAndSizeImpl(i & 1, i & 2); + for (ui32 i = 0; i <= 1; ++i) { + ChunkWriteDifferentOffsetAndSizeImpl(i & 1, false); } } @@ -3035,7 +3036,17 @@ Y_UNIT_TEST_SUITE(TPDiskPrefailureDiskTest) { pdt.Run(); } } -/* + +// RDMA use ibverbs shared library which is part of hardware vendor provided drivers and can't be linked staticaly +// This library is not MSan-instrumented, so it causes msan fail if we run. So skip such run... +static bool IsMsanEnabled() { +#if defined(_msan_enabled_) + return true; +#else + return false; +#endif +} + Y_UNIT_TEST_SUITE(RDMA) { void TestChunkReadWithRdmaAllocator(bool plainDataChunks) { TActorTestContext testCtx({ @@ -3076,13 +3087,23 @@ Y_UNIT_TEST_SUITE(RDMA) { } Y_UNIT_TEST(TestChunkReadWithRdmaAllocatorEncryptedChunks) { + if (IsMsanEnabled()) + return; + TestChunkReadWithRdmaAllocator(false); } + Y_UNIT_TEST(TestChunkReadWithRdmaAllocatorPlainChunks) { + if (IsMsanEnabled()) + return; + TestChunkReadWithRdmaAllocator(true); } Y_UNIT_TEST(TestRcBuf) { + if (IsMsanEnabled()) + return; + ui32 size = 129961; ui32 offset = 123; ui32 tailRoom = 1111; @@ -3116,6 +3137,15 @@ Y_UNIT_TEST_SUITE(RDMA) { buf1.RawDataPtr(0, totalSize); buf2.RawDataPtr(0, totalSize); } + + Y_UNIT_TEST(ChunkWriteDifferentOffsetAndSize) { + if (IsMsanEnabled()) + return; + + for (ui32 i = 0; i <= 1; ++i) { + NTestSuiteTPDiskTest::ChunkWriteDifferentOffsetAndSizeImpl(i & 1, true); + } + } } -*/ + } // namespace NKikimr diff --git a/ydb/library/actors/interconnect/rdma/link_manager.cpp b/ydb/library/actors/interconnect/rdma/link_manager.cpp index 26d7763e41db..d34f4be41077 100644 --- a/ydb/library/actors/interconnect/rdma/link_manager.cpp +++ b/ydb/library/actors/interconnect/rdma/link_manager.cpp @@ -1,6 +1,7 @@ #include "link_manager.h" #include "ctx.h" #include "ctx_impl.h" +#include #include #include @@ -60,10 +61,12 @@ static class TRdmaLinkManager { return; } } -private: - TCtxsMap CtxMap; void ScanDevices() { + std::lock_guard lock(Mtx); + if (Inited) { + return; + } int numDevices = 0; int err; ibv_device** deviceList = ibv_get_device_list(&numDevices); @@ -130,10 +133,16 @@ static class TRdmaLinkManager { } } } + Inited = true; } +private: + TCtxsMap CtxMap; int ErrNo = 0; TString Err; + std::mutex Mtx; + bool Inited = false; + } RdmaLinkManager; @@ -159,4 +168,8 @@ const TCtxsMap& GetAllCtxs() { return RdmaLinkManager.GetAllCtxs(); } +void Init() { + RdmaLinkManager.ScanDevices(); +} + } diff --git a/ydb/library/actors/interconnect/rdma/link_manager.h b/ydb/library/actors/interconnect/rdma/link_manager.h index 03fc49e3eb1e..7d909fccda2f 100644 --- a/ydb/library/actors/interconnect/rdma/link_manager.h +++ b/ydb/library/actors/interconnect/rdma/link_manager.h @@ -44,5 +44,5 @@ using TCtxsMap = std::vector