diff options
author | serg-belyakov <serg-belyakov@yandex-team.com> | 2022-12-08 13:03:32 +0300 |
---|---|---|
committer | serg-belyakov <serg-belyakov@yandex-team.com> | 2022-12-08 13:03:32 +0300 |
commit | d2f1358e178da6fc852cab295d41f92f8eb2d7a5 (patch) | |
tree | 4a1ed163842508c2c87512bd13928d81e2a8b719 | |
parent | a871e0d3cbc0abef908f17920a4cf6f2b32bbe8e (diff) | |
download | ydb-d2f1358e178da6fc852cab295d41f92f8eb2d7a5.tar.gz |
Add EnableSmallDiskOptimization feature flag,
Add feature flag
23 files changed, 66 insertions, 44 deletions
diff --git a/ydb/core/blobstorage/backpressure/queue_backpressure_client_ut.cpp b/ydb/core/blobstorage/backpressure/queue_backpressure_client_ut.cpp index ef24faa173..63892dbe57 100644 --- a/ydb/core/blobstorage/backpressure/queue_backpressure_client_ut.cpp +++ b/ydb/core/blobstorage/backpressure/queue_backpressure_client_ut.cpp @@ -163,7 +163,7 @@ public: PDiskKey = 1; MainKey = {1}; FormatPDisk(Path, DiskSize, 4096, ChunkSize, PDiskGuid, PDiskKey, PDiskKey, PDiskKey, MainKey.back(), "queue_test", - false, false, SectorMap); + false, false, SectorMap, false); PDiskId = MakeBlobStoragePDiskID(1, 1); ui64 pDiskCategory = 0; diff --git a/ydb/core/blobstorage/dsproxy/ut_fat/dsproxy_ut.cpp b/ydb/core/blobstorage/dsproxy/ut_fat/dsproxy_ut.cpp index fbb213f272..6560fa4ec8 100644 --- a/ydb/core/blobstorage/dsproxy/ut_fat/dsproxy_ut.cpp +++ b/ydb/core/blobstorage/dsproxy/ut_fat/dsproxy_ut.cpp @@ -4218,7 +4218,7 @@ public: SectorMapByPath[filePath].Reset(new NPDisk::TSectorMap(diskSizeBytes)); FormatPDisk(filePath, diskSizeBytes, 4 << 10, chunkSize, pDiskGuid, 0x123, 0x456, 0x789, isBad ? badMainKey : mainKey, "", false, false, - SectorMapByPath[filePath]); + SectorMapByPath[filePath], false); } TIntrusivePtr<TPDiskConfig> pDiskConfig = new TPDiskConfig(filePath, pDiskGuid, i + 1, pDiskCategory); diff --git a/ydb/core/blobstorage/incrhuge/ut/incrhuge_basic_ut.cpp b/ydb/core/blobstorage/incrhuge/ut/incrhuge_basic_ut.cpp index 026c9918f5..b5896de7ee 100644 --- a/ydb/core/blobstorage/incrhuge/ut/incrhuge_basic_ut.cpp +++ b/ydb/core/blobstorage/incrhuge/ut/incrhuge_basic_ut.cpp @@ -59,7 +59,8 @@ public: PDiskGuid = Now().GetValue(); PDiskKey = 1; MainKey = {1}; - FormatPDisk(Path, DiskSize, 4096, ChunkSize, PDiskGuid, PDiskKey, PDiskKey, PDiskKey, MainKey.back(), "incrhuge"); + FormatPDisk(Path, DiskSize, 4096, ChunkSize, PDiskGuid, PDiskKey, PDiskKey, PDiskKey, MainKey.back(), "incrhuge", + false, false, nullptr, false); } PDiskId = MakeBlobStoragePDiskID(1, 1); diff --git a/ydb/core/blobstorage/nodewarden/blobstorage_node_warden_ut.cpp b/ydb/core/blobstorage/nodewarden/blobstorage_node_warden_ut.cpp index e103f1d830..c80b263c77 100644 --- a/ydb/core/blobstorage/nodewarden/blobstorage_node_warden_ut.cpp +++ b/ydb/core/blobstorage/nodewarden/blobstorage_node_warden_ut.cpp @@ -68,7 +68,7 @@ constexpr ui32 DOMAIN_ID = 1; using namespace NActors; void FormatPDiskRandomKeys(TString path, ui32 diskSize, ui32 chunkSize, ui64 guid, bool isGuidValid, - TIntrusivePtr<NPDisk::TSectorMap> sectorMap) { + TIntrusivePtr<NPDisk::TSectorMap> sectorMap, bool enableSmallDiskOptimization) { NPDisk::TKey chunkKey; NPDisk::TKey logKey; NPDisk::TKey sysLogKey; @@ -83,7 +83,7 @@ void FormatPDiskRandomKeys(TString path, ui32 diskSize, ui32 chunkSize, ui64 gui NKikimr::FormatPDisk(path, diskSize, 4 << 10, chunkSize, guid, chunkKey, logKey, sysLogKey, NPDisk::YdbDefaultPDiskSequence, "Test", - false, false, sectorMap); + false, false, sectorMap, enableSmallDiskOptimization); } void SetupLogging(TTestActorRuntime& runtime) { @@ -225,7 +225,7 @@ void SetupServices(TTestActorRuntime &runtime, TString extraPath, TIntrusivePtr< ++iteration; ::NKikimr::FormatPDisk(pDiskPath0, 0, 4 << 10, 32u << 20u, pDiskGuid, 0x1234567890 + iteration, 0x4567890123 + iteration, 0x7890123456 + iteration, - NPDisk::YdbDefaultPDiskSequence, "", false, false, sectorMap); + NPDisk::YdbDefaultPDiskSequence, "", false, false, sectorMap, false); // Magic path from testlib, do not change it @@ -650,7 +650,7 @@ Y_UNIT_TEST_SUITE(TBlobStorageWardenTest) { // TActorId sender1 = runtime.AllocateEdgeActor(1); VERBOSE_COUT(" Formatting pdisk"); - FormatPDiskRandomKeys(tempDir() + "/new_pdisk.dat", sectorMap->DeviceSize, 32 << 20, 1, false, sectorMap); + FormatPDiskRandomKeys(tempDir() + "/new_pdisk.dat", sectorMap->DeviceSize, 32 << 20, 1, false, sectorMap, false); VERBOSE_COUT(" Creating PDisk"); ui64 guid = 1; diff --git a/ydb/core/blobstorage/nodewarden/ut_sequence/dsproxy_config_retrieval.cpp b/ydb/core/blobstorage/nodewarden/ut_sequence/dsproxy_config_retrieval.cpp index 7aca70b068..16648d78cb 100644 --- a/ydb/core/blobstorage/nodewarden/ut_sequence/dsproxy_config_retrieval.cpp +++ b/ydb/core/blobstorage/nodewarden/ut_sequence/dsproxy_config_retrieval.cpp @@ -31,7 +31,7 @@ void SetupServices(TTestBasicRuntime& runtime) { ui64 guid = RandomNumber<ui64>(); auto sectorMap = MakeIntrusive<NPDisk::TSectorMap>(pdiskSize); FormatPDisk(path, 0, 4096, chunkSize, guid, 0x1234567890 + 1, 0x4567890123 + 1, 0x7890123456 + 1, - NPDisk::YdbDefaultPDiskSequence, TString(), false, false, sectorMap); + NPDisk::YdbDefaultPDiskSequence, TString(), false, false, sectorMap, false); // per-node NodeWarden configurations; node 0 has the static group and the BS_CONTROLLER tablet THashMap<ui32, NKikimrBlobStorage::TNodeWardenServiceSet> configs; diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_actor.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_actor.cpp index 2cddd788fa..f46c1f368c 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_actor.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_actor.cpp @@ -365,11 +365,13 @@ public: try { FormatPDisk(cfg->GetDevicePath(), 0, cfg->SectorSize, cfg->ChunkSize, cfg->PDiskGuid, chunkKey, logKey, sysLogKey, actor->MainKey.back(), TString(), false, - cfg->FeatureFlags.GetTrimEntireDeviceOnStartup(), cfg->SectorMap); + cfg->FeatureFlags.GetTrimEntireDeviceOnStartup(), cfg->SectorMap, + cfg->FeatureFlags.GetEnableSmallDiskOptimization()); } catch (NPDisk::TPDiskFormatBigChunkException) { FormatPDisk(cfg->GetDevicePath(), 0, cfg->SectorSize, NPDisk::SmallDiskMaximumChunkSize, - cfg->PDiskGuid, chunkKey, logKey, sysLogKey, actor->MainKey.back(), TString(), false, - cfg->FeatureFlags.GetTrimEntireDeviceOnStartup(), cfg->SectorMap); + cfg->PDiskGuid, chunkKey, logKey, sysLogKey, actor->MainKey.back(), TString(), false, + cfg->FeatureFlags.GetTrimEntireDeviceOnStartup(), cfg->SectorMap, + cfg->FeatureFlags.GetEnableSmallDiskOptimization()); } actorSystem->Send(pDiskActor, new TEvPDiskFormattingFinished(true, "")); } catch (yexception ex) { @@ -987,8 +989,7 @@ public: void Handle(NMon::TEvHttpInfo::TPtr &ev) { const TCgiParameters &cgi = ev->Get()->Request.GetPostParams(); - TAppData* app = NKikimr::AppData(TActivationContext::AsActorContext()); - bool enableChunkLocking = app->FeatureFlags.GetEnableChunkLocking(); + bool enableChunkLocking = Cfg->FeatureFlags.GetEnableChunkLocking(); if (enableChunkLocking) { using TColor = NKikimrBlobStorage::TPDiskSpaceColor; diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.cpp index 78ceee79ec..3e7f6dc578 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.cpp @@ -51,7 +51,7 @@ LWTRACE_USING(BLOBSTORAGE_PROVIDER); void FormatPDisk(TString path, ui64 diskSizeBytes, ui32 sectorSizeBytes, ui32 userAccessibleChunkSizeBytes, const ui64 &diskGuid, const NPDisk::TKey &chunkKey, const NPDisk::TKey &logKey, const NPDisk::TKey &sysLogKey, const NPDisk::TKey &mainKey, TString textMessage, const bool isErasureEncodeUserLog, bool trimEntireDevice, - TIntrusivePtr<NPDisk::TSectorMap> sectorMap) + TIntrusivePtr<NPDisk::TSectorMap> sectorMap, bool enableSmallDiskOptimization) { TActorSystemCreator creator; @@ -75,15 +75,15 @@ void FormatPDisk(TString path, ui64 diskSizeBytes, ui32 sectorSizeBytes, ui32 us ->DetectFileParameters(path, diskSizeBytes, isBlockDevice); } } - if (diskSizeBytes > 0 && diskSizeBytes < NPDisk::FullSizeDiskMinimumSize && + if (enableSmallDiskOptimization && diskSizeBytes > 0 && diskSizeBytes < NPDisk::FullSizeDiskMinimumSize && userAccessibleChunkSizeBytes > NPDisk::SmallDiskMaximumChunkSize) { throw NPDisk::TPDiskFormatBigChunkException() << "diskSizeBytes# " << diskSizeBytes << " userAccessibleChunkSizeBytes# " << userAccessibleChunkSizeBytes << " bool(sectorMap)# " << bool(sectorMap) << " sectorMap->DeviceSize# " << (sectorMap ? sectorMap->DeviceSize : 0); } - Y_VERIFY_S(diskSizeBytes < NPDisk::FullSizeDiskMinimumSize || (diskSizeBytes > 0 && - diskSizeBytes / userAccessibleChunkSizeBytes > 200), + Y_VERIFY_S((enableSmallDiskOptimization && diskSizeBytes < NPDisk::FullSizeDiskMinimumSize) || ( + diskSizeBytes > 0 && diskSizeBytes / userAccessibleChunkSizeBytes > 200), " diskSizeBytes# " << diskSizeBytes << " userAccessibleChunkSizeBytes# " << userAccessibleChunkSizeBytes << " bool(sectorMap)# " << bool(sectorMap) << diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.h b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.h index 4702179240..8a44c6a6bb 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.h +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.h @@ -44,7 +44,7 @@ void FormatPDisk(TString path, ui64 diskSizeBytes, ui32 sectorSizeBytes, ui32 us const ui64 &diskGuid, const NPDisk::TKey &chunkKey, const NPDisk::TKey &logKey, const NPDisk::TKey &sysLogKey, const NPDisk::TKey &mainKey, TString textMessage, const bool isErasureEncodeUserLog = false, const bool trimEntireDevice = false, - TIntrusivePtr<NPDisk::TSectorMap> sectorMap = nullptr); + TIntrusivePtr<NPDisk::TSectorMap> sectorMap = nullptr, bool enableSmallDiskOptimization = true); bool ReadPDiskFormatInfo(const TString &path, const NPDisk::TMainKey &mainKey, TPDiskInfo &outInfo, const bool doLock = false, TIntrusivePtr<NPDisk::TSectorMap> sectorMap = nullptr); diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp index 302f09918d..5e082d5848 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp @@ -780,6 +780,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { TActorTestContext testCtx({ .IsBad = false, .DiskSize = diskSize, + .SmallDisk = true, }); } } diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_actions.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_actions.cpp index 2577225b9b..c5db676a90 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_actions.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_actions.cpp @@ -964,7 +964,7 @@ void TTestChunkLock::TestFSM(const TActorContext &ctx) { Owner = LastResponse.Owner; OwnerRound = LastResponse.OwnerRound; VERBOSE_COUT(" Sending TEvChunkLock from LOG"); - ctx.Send(Yard, new NPDisk::TEvChunkLock(EFrom::LOG, 0, TColor::YELLOW)); + ctx.Send(Yard, new NPDisk::TEvChunkLock(EFrom::LOG, 5, TColor::GREEN)); break; case 20: TEST_RESPONSE(EvChunkLockResult, OK); @@ -1019,7 +1019,7 @@ void TTestChunkUnlock::TestFSM(const TActorContext &ctx) { LockedNumLog = LastResponse.ChunkIds.size(); ASSERT_YTHROW(LockedNumLog, "Didn't lock anything"); VERBOSE_COUT(" Sending TEvChunkLock from PERSONAL_QUOTA"); - ctx.Send(Yard, new NPDisk::TEvChunkLock(EFrom::PERSONAL_QUOTA, Owner, 0, TColor::RED)); + ctx.Send(Yard, new NPDisk::TEvChunkLock(EFrom::PERSONAL_QUOTA, Owner, 5, TColor::GREEN)); break; case 30: TEST_RESPONSE(EvChunkLockResult, OK); diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_env.h b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_env.h index 8789f80449..e3093759c4 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_env.h +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_env.h @@ -24,6 +24,7 @@ public: ui64 DiskSize = 0; EDiskMode DiskMode = EDiskMode::DM_NONE; ui32 ChunkSize = 128 * (1 << 20); + bool SmallDisk = false; }; private: @@ -43,9 +44,9 @@ public: EntropyPool().Read(&TestCtx.PDiskGuid, sizeof(TestCtx.PDiskGuid)); ui64 formatGuid = TestCtx.PDiskGuid + static_cast<ui64>(isBad); if (Settings.DiskSize) { - FormatPDiskForTest(path, formatGuid, Settings.ChunkSize, Settings.DiskSize, false, TestCtx.SectorMap); + FormatPDiskForTest(path, formatGuid, Settings.ChunkSize, Settings.DiskSize, false, TestCtx.SectorMap, Settings.SmallDisk); } else { - FormatPDiskForTest(path, formatGuid, Settings.ChunkSize, false, TestCtx.SectorMap); + FormatPDiskForTest(path, formatGuid, Settings.ChunkSize, false, TestCtx.SectorMap, Settings.SmallDisk); } ui64 pDiskCategory = 0; @@ -55,6 +56,7 @@ public: pDiskConfig->ChunkSize = Settings.ChunkSize; pDiskConfig->SectorMap = TestCtx.SectorMap; pDiskConfig->EnableSectorEncryption = !pDiskConfig->SectorMap; + pDiskConfig->FeatureFlags.SetEnableSmallDiskOptimization(Settings.SmallDisk); return pDiskConfig; } diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.cpp index 68dd70c70d..4a79eaedfe 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.cpp @@ -38,7 +38,7 @@ TString MakePDiskPath(const char *dir) { } void FormatPDiskForTest(TString path, ui64 guid, ui32& chunkSize, ui64 diskSize, bool isErasureEncodeUserLog, - TIntrusivePtr<NPDisk::TSectorMap> sectorMap) { + TIntrusivePtr<NPDisk::TSectorMap> sectorMap, bool enableSmallDiskOptimization) { NPDisk::TKey chunkKey; NPDisk::TKey logKey; NPDisk::TKey sysLogKey; @@ -46,20 +46,28 @@ void FormatPDiskForTest(TString path, ui64 guid, ui32& chunkSize, ui64 diskSize, EntropyPool().Read(&logKey, sizeof(NKikimr::NPDisk::TKey)); EntropyPool().Read(&sysLogKey, sizeof(NKikimr::NPDisk::TKey)); - try { - FormatPDisk(path, diskSize, 4 << 10, chunkSize, guid, chunkKey, logKey, sysLogKey, - NPDisk::YdbDefaultPDiskSequence, "Info", isErasureEncodeUserLog, false, sectorMap); - } catch (NPDisk::TPDiskFormatBigChunkException) { - chunkSize = NPDisk::SmallDiskMaximumChunkSize; + if (enableSmallDiskOptimization) { + try { + FormatPDisk(path, diskSize, 4 << 10, chunkSize, guid, chunkKey, logKey, sysLogKey, + NPDisk::YdbDefaultPDiskSequence, "Info", isErasureEncodeUserLog, false, sectorMap, + enableSmallDiskOptimization); + } catch (NPDisk::TPDiskFormatBigChunkException) { + FormatPDisk(path, diskSize, 4 << 10, NPDisk::SmallDiskMaximumChunkSize, guid, chunkKey, logKey, sysLogKey, + NPDisk::YdbDefaultPDiskSequence, "Info", isErasureEncodeUserLog, false, sectorMap, + enableSmallDiskOptimization); + } + } else { FormatPDisk(path, diskSize, 4 << 10, chunkSize, guid, chunkKey, logKey, sysLogKey, - NPDisk::YdbDefaultPDiskSequence, "Info", isErasureEncodeUserLog, false, sectorMap); + NPDisk::YdbDefaultPDiskSequence, "Info", isErasureEncodeUserLog, false, sectorMap, + enableSmallDiskOptimization); } } void FormatPDiskForTest(TString path, ui64 guid, ui32& chunkSize, bool isErasureEncodeUserLog, - TIntrusivePtr<NPDisk::TSectorMap> sectorMap) { + TIntrusivePtr<NPDisk::TSectorMap> sectorMap, bool enableSmallDiskOptimization) { ui64 diskSizeHeuristic = (ui64)chunkSize * 1000; - FormatPDiskForTest(path, guid, chunkSize, diskSizeHeuristic, isErasureEncodeUserLog, sectorMap); + FormatPDiskForTest(path, guid, chunkSize, diskSizeHeuristic, isErasureEncodeUserLog, sectorMap, + enableSmallDiskOptimization); } void ReadPdiskFile(TTestContext *tc, ui32 dataSize, NPDisk::TAlignedData &outData) { diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.h b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.h index ba530cab62..94259b1275 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.h +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.h @@ -14,9 +14,9 @@ TString StatusToString(const NKikimrProto::EReplyStatus status); TString MakeDatabasePath(const char *dir); TString MakePDiskPath(const char *dir); void FormatPDiskForTest(TString path, ui64 guid, ui32& chunkSize, ui64 diskSize, bool isErasureEncodeUserLog, - TIntrusivePtr<NPDisk::TSectorMap> sectorMap); + TIntrusivePtr<NPDisk::TSectorMap> sectorMap, bool enableSmallDiskOptimization = false); void FormatPDiskForTest(TString path, ui64 guid, ui32& chunkSize, bool isErasureEncodeUserLog, - TIntrusivePtr<NPDisk::TSectorMap> sectorMap); + TIntrusivePtr<NPDisk::TSectorMap> sectorMap, bool enableSmallDiskOptimization = false); void ReadPdiskFile(TTestContext *tc, ui32 dataSize, NPDisk::TAlignedData &outData); i64 FindLastDifferingBytes(NPDisk::TAlignedData &dataBefore, NPDisk::TAlignedData &dataAfter, ui32 dataSize); diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_run.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_run.cpp index ee72a04893..5b7243c4c1 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_run.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_run.cpp @@ -86,6 +86,7 @@ void Run(TVector<IActor*> tests, TTestRunConfig runCfg) { pDiskConfig->SectorMap = runCfg.TestContext->SectorMap; pDiskConfig->EnableSectorEncryption = !pDiskConfig->SectorMap; pDiskConfig->UseT1ha0HashInFooter = runCfg.UseT1ha0Hasher; + pDiskConfig->FeatureFlags.SetEnableSmallDiskOptimization(false); NPDisk::TMainKey mainKey = {NPDisk::YdbDefaultPDiskSequence}; TActorSetupCmd pDiskSetup(CreatePDisk(pDiskConfig.Get(), diff --git a/ydb/core/blobstorage/ut_pdiskfit/lib/fail_injection_test.h b/ydb/core/blobstorage/ut_pdiskfit/lib/fail_injection_test.h index f82dcc478e..2e9ac8f3f0 100644 --- a/ydb/core/blobstorage/ut_pdiskfit/lib/fail_injection_test.h +++ b/ydb/core/blobstorage/ut_pdiskfit/lib/fail_injection_test.h @@ -137,7 +137,7 @@ struct TPDiskFailureInjectionTest { // format pdisk NKikimr::FormatPDisk(PDiskFilePath, DiskSize, SectorSize, ChunkSize, PDiskGuid, 1, 1, 1, 1, "text message", - ErasureEncode); + ErasureEncode, false, nullptr, false); Cerr << "created pdisk at " << PDiskFilePath << Endl; } diff --git a/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp b/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp index 7d691ba7a1..013e4911c4 100644 --- a/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp +++ b/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp @@ -84,7 +84,10 @@ void TOnePDisk::FormatDisk(bool force) { sysLogKey, // sysLogKey NPDisk::YdbDefaultPDiskSequence, // mainKey "", // textMessage - false // isErasureEncode + false, // isErasureEncode + false, // trimEntireDevice + nullptr, // sectorMap + false // enableSmallDiskOptimization ); } } diff --git a/ydb/core/cms/cms_ut_common.cpp b/ydb/core/cms/cms_ut_common.cpp index 5e45421a56..52e6edc0db 100644 --- a/ydb/core/cms/cms_ut_common.cpp +++ b/ydb/core/cms/cms_ut_common.cpp @@ -474,8 +474,8 @@ static void SetupServices(TTestActorRuntime &runtime, TString(""), false, false, - sectorMap - ); + sectorMap, + false); } SetupBSNodeWarden(runtime, nodeIndex, nodeWardenConfig); diff --git a/ydb/core/driver_lib/cli_utils/cli_cmds_disk.cpp b/ydb/core/driver_lib/cli_utils/cli_cmds_disk.cpp index ebc4a18930..d7028ee5f4 100644 --- a/ydb/core/driver_lib/cli_utils/cli_cmds_disk.cpp +++ b/ydb/core/driver_lib/cli_utils/cli_cmds_disk.cpp @@ -180,7 +180,7 @@ public: virtual int Run(TConfig&) override { FormatPDisk(Path, DiskSize, SectorSize, ChunkSize, Guid, ChunkKey, LogKey, SysLogKey, MainKey.back(), TextMessage, - IsErasureEncode); + IsErasureEncode, false, nullptr, true); return 0; } }; diff --git a/ydb/core/mind/hive/hive_ut.cpp b/ydb/core/mind/hive/hive_ut.cpp index a4e7277a90..bfb85a59d3 100644 --- a/ydb/core/mind/hive/hive_ut.cpp +++ b/ydb/core/mind/hive/hive_ut.cpp @@ -210,7 +210,8 @@ namespace { TString(""), false, false, - sectorMap); + sectorMap, + false); } void SetupLocals(TTestActorRuntime &runtime, bool isLocalEnabled) { @@ -428,7 +429,8 @@ void FormatPDiskForTest(TString path, ui64 diskSize, ui32 chunkSize, ui64 guid, EntropyPool().Read(&sysLogKey, sizeof(NKikimr::NPDisk::TKey)); NKikimr::FormatPDisk(path, diskSize, 4 << 10, chunkSize, guid, - chunkKey, logKey, sysLogKey, NPDisk::YdbDefaultPDiskSequence, "", false, false, sectorMap); + chunkKey, logKey, sysLogKey, NPDisk::YdbDefaultPDiskSequence, "", false, false, sectorMap, + false); } void InitSchemeRoot(TTestBasicRuntime& runtime, const TActorId& sender) { diff --git a/ydb/core/mind/node_broker_ut.cpp b/ydb/core/mind/node_broker_ut.cpp index 6293413ef1..7d171f43ad 100644 --- a/ydb/core/mind/node_broker_ut.cpp +++ b/ydb/core/mind/node_broker_ut.cpp @@ -131,7 +131,8 @@ void SetupServices(TTestActorRuntime &runtime, TString(""), false, false, - sectorMap); + sectorMap, + false); } NodeWardenConfigs[nodeIndex] = nodeWardenConfig; diff --git a/ydb/core/mind/ut_fat/blobstorage_node_warden_ut_fat.cpp b/ydb/core/mind/ut_fat/blobstorage_node_warden_ut_fat.cpp index 40e385c734..a347ed3c3c 100644 --- a/ydb/core/mind/ut_fat/blobstorage_node_warden_ut_fat.cpp +++ b/ydb/core/mind/ut_fat/blobstorage_node_warden_ut_fat.cpp @@ -83,7 +83,8 @@ void FormatPDisk(TString path, ui64 diskSize, ui32 chunkSize, ui64 guid, bool is } NKikimr::FormatPDisk(path, diskSize, 4 << 10, chunkSize, guid, - chunkKey, logKey, sysLogKey, NPDisk::YdbDefaultPDiskSequence, "Test"); + chunkKey, logKey, sysLogKey, NPDisk::YdbDefaultPDiskSequence, "Test", + false, false, nullptr, false); } void SetupLogging(TTestActorRuntime& runtime) { @@ -206,7 +207,7 @@ void SetupServices(TTestActorRuntime &runtime) { ++iteration; ::NKikimr::FormatPDisk(pDiskPath, 16000000000ull, 4 << 10, 32u << 20u, pDiskGuid, 0x1234567890 + iteration, 0x4567890123 + iteration, 0x7890123456 + iteration, - NPDisk::YdbDefaultPDiskSequence, ""); + NPDisk::YdbDefaultPDiskSequence, "", false, false, nullptr, false); } SetupBSNodeWarden(runtime, nodeIndex, nodeWardenConfig.Release()); diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto index 3b2024f607..3bef73182b 100644 --- a/ydb/core/protos/config.proto +++ b/ydb/core/protos/config.proto @@ -754,6 +754,7 @@ message TFeatureFlags { // directly in subdomain's hive optional bool EnableAlterDatabaseCreateHiveFirst = 82 [default = false]; optional bool EnableKqpDataQuerySourceRead = 83 [default = false]; + optional bool EnableSmallDiskOptimization = 84 [default = true]; } diff --git a/ydb/core/testlib/basics/storage.h b/ydb/core/testlib/basics/storage.h index 36cee17818..80878f54da 100644 --- a/ydb/core/testlib/basics/storage.h +++ b/ydb/core/testlib/basics/storage.h @@ -66,7 +66,7 @@ namespace NKikimr { FormatPDisk(PDiskPath, Conf.DiskSize, Conf.SectorSize, Conf.ChunkSize, PDiskGuid, 0x123 + salt, 0x456 + salt, 0x789 + salt, mainKey, - "", false, false, SectorMap); + "", false, false, SectorMap, false); } } |