Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpeye committed Sep 25, 2024
1 parent fda3f3a commit f1b456d
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 21 deletions.
4 changes: 2 additions & 2 deletions cloud/blockstore/config/disk.proto
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,12 @@ message TDiskAgentConfig
// Max. count of concurrently processing operations (io_setup).
optional uint32 MaxAIOContextEvents = 33;

// Number of file paths per each IO service.
// Number of paths per each FileIOService.
// 0 means that only one IO service will be created.
// 1 means that one IO service per file path will be created.
// 2 means that one IO service will be created for every two file paths.
// etc.
optional uint32 FilePathsPerIOServiceCount = 34;
optional uint32 PathsPerFileIOService = 34;
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
3 changes: 2 additions & 1 deletion cloud/blockstore/libs/daemon/common/bootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,8 @@ void TBootstrapBase::InitLocalService()
? *Configs->ServerConfig->GetLocalServiceConfig()
: NProto::TLocalServiceConfig();

FileIOServiceProvider = CreateFileIOServiceProviderStub(CreateAIOService());
FileIOServiceProvider =
CreateSingleFileIOServiceProvider(CreateAIOService());

NvmeManager = CreateNvmeManager(
Configs->DiskAgentConfig->GetSecureEraseTimeout());
Expand Down
6 changes: 3 additions & 3 deletions cloud/blockstore/libs/daemon/ydb/bootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,11 @@ void TBootstrapYdb::InitKikimrService()
};

FileIOServiceProvider =
config.GetFilePathsPerIOServiceCount()
config.GetPathsPerFileIOService()
? CreateFileIOServiceProvider(
config.GetFilePathsPerIOServiceCount(),
config.GetPathsPerFileIOService(),
factory)
: CreateFileIOServiceProviderStub(factory());
: CreateSingleFileIOServiceProvider(factory());

AioStorageProvider = CreateAioStorageProvider(
FileIOServiceProvider,
Expand Down
6 changes: 3 additions & 3 deletions cloud/blockstore/libs/disk_agent/bootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,11 @@ bool TBootstrap::InitKikimrService()
};

FileIOServiceProvider =
config.GetFilePathsPerIOServiceCount()
config.GetPathsPerFileIOService()
? CreateFileIOServiceProvider(
config.GetFilePathsPerIOServiceCount(),
config.GetPathsPerFileIOService(),
factory)
: CreateFileIOServiceProviderStub(factory());
: CreateSingleFileIOServiceProvider(factory());

AioStorageProvider = CreateAioStorageProvider(
FileIOServiceProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ class TFileIOServiceProvider final

////////////////////////////////////////////////////////////////////////////////

struct TFileIOServiceProviderStub final
struct TSingleFileIOServiceProvider final
: IFileIOServiceProvider
{
IFileIOServicePtr FileIO;

explicit TFileIOServiceProviderStub(
explicit TSingleFileIOServiceProvider(
IFileIOServicePtr fileIO)
: FileIO{std::move(fileIO)}
{}
Expand All @@ -96,10 +96,10 @@ struct TFileIOServiceProviderStub final

////////////////////////////////////////////////////////////////////////////////

IFileIOServiceProviderPtr CreateFileIOServiceProviderStub(
IFileIOServiceProviderPtr CreateSingleFileIOServiceProvider(
IFileIOServicePtr fileIO)
{
return std::make_shared<TFileIOServiceProviderStub>(std::move(fileIO));
return std::make_shared<TSingleFileIOServiceProvider>(std::move(fileIO));
}

IFileIOServiceProviderPtr CreateFileIOServiceProvider(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct IFileIOServiceProvider

////////////////////////////////////////////////////////////////////////////////

IFileIOServiceProviderPtr CreateFileIOServiceProviderStub(
IFileIOServiceProviderPtr CreateSingleFileIOServiceProvider(
IFileIOServicePtr fileIO);

IFileIOServiceProviderPtr CreateFileIOServiceProvider(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Y_UNIT_TEST_SUITE(TFileIOServiceProviderTest)
auto fileIO = std::make_shared<TTestFileIOService>();
UNIT_ASSERT_VALUES_EQUAL(0, fileIO->Started);

auto provider = CreateFileIOServiceProviderStub(fileIO);
auto provider = CreateSingleFileIOServiceProvider(fileIO);
provider->Start();

UNIT_ASSERT_VALUES_EQUAL(1, fileIO->Started);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Y_UNIT_TEST_SUITE(TAioStorageTest)
fileData.Resize(blockSize * totalBlockCount);

auto fileIOServiceProvider =
CreateFileIOServiceProviderStub(CreateAIOService());
CreateSingleFileIOServiceProvider(CreateAIOService());

fileIOServiceProvider->Start();
Y_DEFER { fileIOServiceProvider->Stop(); };
Expand Down
2 changes: 1 addition & 1 deletion cloud/blockstore/libs/storage/disk_agent/model/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace {
xxx(OffloadAllIORequestsParsingEnabled, bool, false )\
xxx(DisableNodeBrokerRegisterationOnDevicelessAgent, bool, false )\
xxx(MaxAIOContextEvents, ui32, 1024 )\
xxx(FilePathsPerIOServiceCount, ui32, 0 )\
xxx(PathsPerFileIOService, ui32, 0 )\
// BLOCKSTORE_AGENT_CONFIG

#define BLOCKSTORE_DECLARE_CONFIG(name, type, value) \
Expand Down
2 changes: 1 addition & 1 deletion cloud/blockstore/libs/storage/disk_agent/model/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class TDiskAgentConfig
bool GetOffloadAllIORequestsParsingEnabled() const;
bool GetDisableNodeBrokerRegisterationOnDevicelessAgent() const;
ui32 GetMaxAIOContextEvents() const;
ui32 GetFilePathsPerIOServiceCount() const;
ui32 GetPathsPerFileIOService() const;

void Dump(IOutputStream& out) const;
void DumpHtml(IOutputStream& out) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ IStorageProviderPtr CreateTestStorageProvider(
{
return std::make_shared<TTestStorageProvider>(
NServer::CreateAioStorageProvider(
NServer::CreateFileIOServiceProviderStub(std::move(fileIO)),
NServer::CreateSingleFileIOServiceProvider(std::move(fileIO)),
std::move(nvmeManager),
false, // directIO
NServer::EAioSubmitQueueOpt::DontUse
Expand Down
2 changes: 1 addition & 1 deletion cloud/blockstore/tests/python/lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def generate_disk_agent_txt(
config.ShutdownTimeout = 0
config.IOParserActorCount = 4
config.OffloadAllIORequestsParsingEnabled = True
config.FilePathsPerIOServiceCount = 1
config.PathsPerFileIOService = 1

if device_erase_method is not None:
config.DeviceEraseMethod = EDeviceEraseMethod.Value(device_erase_method)
Expand Down
2 changes: 1 addition & 1 deletion cloud/blockstore/tests/python/lib/nonreplicated_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def setup_disk_agent_config(
config.ShutdownTimeout = get_shutdown_agent_interval()
config.IOParserActorCount = 4
config.OffloadAllIORequestsParsingEnabled = True
config.FilePathsPerIOServiceCount = 1
config.PathsPerFileIOService = 1

if cached_sessions_path is not None:
config.CachedSessionsPath = cached_sessions_path
Expand Down

0 comments on commit f1b456d

Please sign in to comment.