Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cloud/filestore/config/filesystem.proto
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,10 @@ message TFileSystemConfig

// Disable fsync queue which is used to synchronize data/metadata ops during fsync
optional bool FSyncQueueDisabled = 26;

// Enable directory handles storage functionality
optional bool DirectoryHandlesStorageEnabled = 27;

// Capacity for DirectoryHandles persistent table.
optional uint64 DirectoryHandlesTableSize = 28;
}
6 changes: 6 additions & 0 deletions cloud/filestore/config/server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ message TLocalServiceConfig

// Disable fsync queue which is used to synchronize data/metadata ops during fsync
optional bool FSyncQueueDisabled = 29;

// Enable directory handles storage functionality
optional bool DirectoryHandlesStorageEnabled = 30;

// Capacity for DirectoryHandles persistent table.
optional uint64 DirectoryHandlesTableSize = 31;
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
5 changes: 5 additions & 0 deletions cloud/filestore/config/storage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -664,4 +664,9 @@ message TStorageConfig
// Disable fsync queue which is used to synchronize data/metadata ops during fsync
optional bool FSyncQueueDisabled = 465;

// Enable directory handles storage functionality.
optional bool DirectoryHandlesStorageEnabled = 466;

// Capacity for DirectoryHandles persistent table.
optional uint64 DirectoryHandlesTableSize = 467;
}
8 changes: 8 additions & 0 deletions cloud/filestore/config/vfs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,12 @@ message TVFSConfig
// operation. If this limit is exceeded, flush will be split into
// a sequence of multiple flush operations.
optional uint64 WriteBackCacheFlushMaxSumWriteRequestsSize = 21;

// Path to the directory where DirectoryHandles storage is stored for all sessions.
// Will create a directory with filesystem id as name
// (and a subdirectory with session id as name) if not present.
optional string DirectoryHandlesStoragePath = 22;

// Initial data area size for DirectoryHandles persistent table.
optional uint64 DirectoryHandlesInitialDataSize = 23;
}
8 changes: 8 additions & 0 deletions cloud/filestore/config/vhost.proto
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ message TVhostServiceConfig
// operation. If this limit is exceeded, flush will be split into
// a sequence of multiple flush operations.
optional uint64 WriteBackCacheFlushMaxSumWriteRequestsSize = 18;

// Path to the directory where DirectoryHandles storage is stored for all sessions.
// Will create a directory with filesystem id as name
// (and a subdirectory with session id as name) if not present.
optional string DirectoryHandlesStoragePath = 19;

// Initial data area size for DirectoryHandles persistent table.
optional uint64 DirectoryHandlesInitialDataSize = 20;
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
7 changes: 6 additions & 1 deletion cloud/filestore/libs/daemon/vhost/bootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,12 @@ void TBootstrapVhost::InitEndpoints()
->GetWriteBackCacheFlushMaxWriteRequestsCount(),
.FlushMaxSumWriteRequestsSize =
Configs->VhostServiceConfig
->GetWriteBackCacheFlushMaxSumWriteRequestsSize(),
->GetWriteBackCacheFlushMaxSumWriteRequestsSize()
},
TDirectoryHandlesStorageConfig{
.PathPrefix = Configs->VhostServiceConfig->GetDirectoryHandlesStoragePath(),
.InitialDataSize =
Configs->VhostServiceConfig->GetDirectoryHandlesInitialDataSize()
}
);

Expand Down
1 change: 1 addition & 0 deletions cloud/filestore/libs/diagnostics/critical_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ namespace NCloud::NFileStore{
xxx(InvalidShardNo) \
xxx(WriteBackCacheCreatingOrDeletingError) \
xxx(ErrorWasSentToTheGuest) \
xxx(DirectoryHandlesStorageError) \
// FILESTORE_CRITICAL_EVENTS

#define FILESTORE_IMPOSSIBLE_EVENTS(xxx) \
Expand Down
2 changes: 2 additions & 0 deletions cloud/filestore/libs/endpoint_vhost/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ static constexpr int MODE0660 = S_IRGRP | S_IWGRP | S_IRUSR | S_IWUSR;
xxx(WriteBackCacheFlushMaxWriteRequestSize, ui32, 1_MB )\
xxx(WriteBackCacheFlushMaxWriteRequestsCount, ui32, 64 )\
xxx(WriteBackCacheFlushMaxSumWriteRequestsSize, ui32, 32_MB )\
xxx(DirectoryHandlesStoragePath, TString, "" )\
xxx(DirectoryHandlesInitialDataSize, ui64, 1_GB )\
// VHOST_SERVICE_CONFIG

#define VHOST_SERVICE_DECLARE_CONFIG(name, type, value) \
Expand Down
3 changes: 3 additions & 0 deletions cloud/filestore/libs/endpoint_vhost/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class TVhostServiceConfig
ui32 GetWriteBackCacheFlushMaxWriteRequestsCount() const;
ui32 GetWriteBackCacheFlushMaxSumWriteRequestsSize() const;

TString GetDirectoryHandlesStoragePath() const;
ui64 GetDirectoryHandlesInitialDataSize() const;

void Dump(IOutputStream& out) const;
void DumpHtml(IOutputStream& out) const;
};
Expand Down
13 changes: 10 additions & 3 deletions cloud/filestore/libs/endpoint_vhost/listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class TEndpointListener final
const IFileSystemLoopFactoryPtr LoopFactory;
const THandleOpsQueueConfig HandleOpsQueueConfig;
const TWriteBackCacheConfig WriteBackCacheConfig;
const TDirectoryHandlesStorageConfig DirectoryHandlesStorageConfig;

TLog Log;

Expand All @@ -78,14 +79,16 @@ class TEndpointListener final
IFileStoreEndpointsPtr filestoreEndpoints,
IFileSystemLoopFactoryPtr loopFactory,
THandleOpsQueueConfig handleOpsQueueConfig,
TWriteBackCacheConfig writeBackCacheConfig)
TWriteBackCacheConfig writeBackCacheConfig,
TDirectoryHandlesStorageConfig directoryHandlesStorageConfig)
: Logging(std::move(logging))
, Timer(std::move(timer))
, Scheduler(std::move(scheduler))
, FileStoreEndpoints(std::move(filestoreEndpoints))
, LoopFactory(std::move(loopFactory))
, HandleOpsQueueConfig(std::move(handleOpsQueueConfig))
, WriteBackCacheConfig(std::move(writeBackCacheConfig))
, DirectoryHandlesStorageConfig(std::move(directoryHandlesStorageConfig))
{
Log = Logging->CreateLog("NFS_VHOST");
}
Expand Down Expand Up @@ -137,6 +140,8 @@ class TEndpointListener final
WriteBackCacheConfig.FlushMaxWriteRequestsCount);
protoConfig.SetWriteBackCacheFlushMaxSumWriteRequestsSize(
WriteBackCacheConfig.FlushMaxSumWriteRequestsSize);
protoConfig.SetDirectoryHandlesStoragePath(DirectoryHandlesStorageConfig.PathPrefix);
protoConfig.SetDirectoryHandlesInitialDataSize(DirectoryHandlesStorageConfig.InitialDataSize);

auto vFSConfig = std::make_shared<TVFSConfig>(std::move(protoConfig));
auto Loop = LoopFactory->Create(
Expand All @@ -158,7 +163,8 @@ IEndpointListenerPtr CreateEndpointListener(
IFileStoreEndpointsPtr filestoreEndpoints,
IFileSystemLoopFactoryPtr loopFactory,
THandleOpsQueueConfig handleOpsQueueConfig,
TWriteBackCacheConfig writeBackCacheConfig)
TWriteBackCacheConfig writeBackCacheConfig,
TDirectoryHandlesStorageConfig directoryHandlesStorageConfig)
{
return std::make_shared<TEndpointListener>(
std::move(logging),
Expand All @@ -167,7 +173,8 @@ IEndpointListenerPtr CreateEndpointListener(
std::move(filestoreEndpoints),
std::move(loopFactory),
std::move(handleOpsQueueConfig),
std::move(writeBackCacheConfig));
std::move(writeBackCacheConfig),
std::move(directoryHandlesStorageConfig));
}

} // namespace NCloud::NFileStore::NVhost
11 changes: 10 additions & 1 deletion cloud/filestore/libs/endpoint_vhost/listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,22 @@ struct TWriteBackCacheConfig

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

struct TDirectoryHandlesStorageConfig
{
TString PathPrefix;
ui64 InitialDataSize = 0;
};

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

IEndpointListenerPtr CreateEndpointListener(
ILoggingServicePtr logging,
ITimerPtr timer,
ISchedulerPtr scheduler,
IFileStoreEndpointsPtr filestoreEndpoints,
NVFS::IFileSystemLoopFactoryPtr loopFactory,
THandleOpsQueueConfig handleOpsQueueConfig,
TWriteBackCacheConfig writeBackCacheConfig);
TWriteBackCacheConfig writeBackCacheConfig,
TDirectoryHandlesStorageConfig directoryHandlesStorageConfig);

} // namespace NCloud::NFileStore::NVhost
2 changes: 2 additions & 0 deletions cloud/filestore/libs/service_local/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ namespace {
xxx(MaxFuseLoopThreads, ui32, 1 )\
xxx(ZeroCopyWriteEnabled, bool, false )\
xxx(FSyncQueueDisabled, bool, false )\
xxx(DirectoryHandlesStorageEnabled, bool, false )\
xxx(DirectoryHandlesTableSize, ui64, 100000 )\
// FILESTORE_SERVICE_CONFIG

#define FILESTORE_SERVICE_NULL_FILE_IO_CONFIG(xxx) \
Expand Down
4 changes: 4 additions & 0 deletions cloud/filestore/libs/service_local/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ class TLocalFileStoreConfig
bool GetZeroCopyWriteEnabled() const;

bool GetFSyncQueueDisabled() const;

bool GetDirectoryHandlesStorageEnabled() const;

ui64 GetDirectoryHandlesTableSize() const;
};

} // namespace NCloud::NFileStore
18 changes: 12 additions & 6 deletions cloud/filestore/libs/service_local/fs_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,21 @@ NProto::TCreateSessionResponse TLocalFileSystem::CreateSession(
features->SetAsyncHandleOperationPeriod(
Config->GetAsyncHandleOperationPeriod().MilliSeconds());
features->SetZeroCopyEnabled(Config->GetZeroCopyEnabled());
features->SetGuestPageCacheDisabled(Config->GetGuestPageCacheDisabled());
features->SetExtendedAttributesDisabled(Config->GetExtendedAttributesDisabled());
features->SetGuestPageCacheDisabled(
Config->GetGuestPageCacheDisabled());
features->SetExtendedAttributesDisabled(
Config->GetExtendedAttributesDisabled());
features->SetServerWriteBackCacheEnabled(
Config->GetServerWriteBackCacheEnabled());
features->SetMaxBackground(
Config->GetMaxBackground());
features->SetMaxFuseLoopThreads(
Config->GetMaxFuseLoopThreads());
features->SetMaxBackground(Config->GetMaxBackground());
features->SetMaxFuseLoopThreads(Config->GetMaxFuseLoopThreads());
features->SetFSyncQueueDisabled(Config->GetFSyncQueueDisabled());
features->SetDirectoryHandlesStorageEnabled(
Config->GetDirectoryHandlesStorageEnabled());
if (Config->GetDirectoryHandlesStorageEnabled()) {
features->SetDirectoryHandlesTableSize(
Config->GetDirectoryHandlesTableSize());
}
return response;
};

Expand Down
3 changes: 3 additions & 0 deletions cloud/filestore/libs/storage/core/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ using TAliases = NProto::TStorageConfig::TFilestoreAliases;
xxx(ZeroCopyWriteEnabled, bool, false )\
\
xxx(FSyncQueueDisabled, bool, false )\
\
xxx(DirectoryHandlesStorageEnabled, bool, false )\
xxx(DirectoryHandlesTableSize, ui64, 100'000 )\
// FILESTORE_STORAGE_CONFIG

#define FILESTORE_STORAGE_CONFIG_REF(xxx) \
Expand Down
3 changes: 3 additions & 0 deletions cloud/filestore/libs/storage/core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@ class TStorageConfig
bool GetZeroCopyWriteEnabled() const;

bool GetFSyncQueueDisabled() const;

bool GetDirectoryHandlesStorageEnabled() const;
ui64 GetDirectoryHandlesTableSize() const;
};

} // namespace NCloud::NFileStore::NStorage
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ void FillFeatures(
features->SetParentlessFilesOnly(config.GetParentlessFilesOnly());
features->SetAllowHandlelessIO(config.GetAllowHandlelessIO());

features->SetDirectoryHandlesStorageEnabled(
config.GetDirectoryHandlesStorageEnabled());

if (config.GetDirectoryHandlesStorageEnabled()) {
features->SetDirectoryHandlesTableSize(
config.GetDirectoryHandlesTableSize());
}

features->SetDirectoryCreationInShardsEnabled(
fileSystem.GetDirectoryCreationInShardsEnabled());

Expand Down
3 changes: 3 additions & 0 deletions cloud/filestore/libs/vfs/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ namespace {
xxx(WriteBackCacheFlushMaxWriteRequestSize, ui32, 1_MB )\
xxx(WriteBackCacheFlushMaxWriteRequestsCount, ui32, 64 )\
xxx(WriteBackCacheFlushMaxSumWriteRequestsSize, ui32, 32_MB )\
\
xxx(DirectoryHandlesStoragePath, TString, "" )\
xxx(DirectoryHandlesInitialDataSize, ui64, 1_GB )\
// FILESTORE_VFS_CONFIG

#define FILESTORE_VFS_DECLARE_CONFIG(name, type, value) \
Expand Down
3 changes: 3 additions & 0 deletions cloud/filestore/libs/vfs/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ struct TVFSConfig
ui32 GetWriteBackCacheFlushMaxWriteRequestsCount() const;
ui32 GetWriteBackCacheFlushMaxSumWriteRequestsSize() const;

TString GetDirectoryHandlesStoragePath() const;
ui64 GetDirectoryHandlesInitialDataSize() const;

bool GetGuestKeepCacheAllowed() const;

void Dump(IOutputStream& out) const;
Expand Down
4 changes: 4 additions & 0 deletions cloud/filestore/libs/vfs_fuse/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ namespace {
\
xxx(ServerWriteBackCacheEnabled, bool, false )\
\
xxx(DirectoryHandlesStorageEnabled, bool, false )\
\
xxx(DirectoryHandlesTableSize, ui64, 100'000 )\
\
xxx(GuestKeepCacheAllowed, bool, false )\
xxx(MaxBackground, ui32, 0 )\
xxx(MaxFuseLoopThreads, ui32, 1 )\
Expand Down
4 changes: 4 additions & 0 deletions cloud/filestore/libs/vfs_fuse/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ struct TFileSystemConfig

bool GetServerWriteBackCacheEnabled() const;

bool GetDirectoryHandlesStorageEnabled() const;

ui64 GetDirectoryHandlesTableSize() const;

bool GetGuestKeepCacheAllowed() const;

ui32 GetMaxBackground() const;
Expand Down
Loading
Loading