Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
25 changes: 23 additions & 2 deletions cloud/filestore/libs/vfs_fuse/fs_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ struct TBootstrap
ISchedulerPtr scheduler = CreateScheduler(),
const NProto::TFileStoreFeatures& featuresConfig = {},
ui32 handleOpsQueueSize = 1000,
ui32 writeBackCacheAutomaticFlushPeriodMs = 1000)
ui32 writeBackCacheAutomaticFlushPeriodMs = 1000,
ui64 writeBackCacheCapacity = 1024*1024 + 1024)
: Logging(CreateLoggingService("console", { TLOG_RESOURCES }))
, Scheduler{std::move(scheduler)}
, Timer{std::move(timer)}
Expand Down Expand Up @@ -166,7 +167,7 @@ struct TBootstrap
if (featuresConfig.GetServerWriteBackCacheEnabled()) {
proto.SetWriteBackCachePath(TempDir.Path() / "WriteBackCache");
// minimum possible capacity
proto.SetWriteBackCacheCapacity(1024*1024 + 1024);
proto.SetWriteBackCacheCapacity(writeBackCacheCapacity);
proto.SetWriteBackCacheAutomaticFlushPeriod(
writeBackCacheAutomaticFlushPeriodMs);
}
Expand Down Expand Up @@ -2430,6 +2431,26 @@ Y_UNIT_TEST_SUITE(TFileSystemTest)

UNIT_ASSERT_VALUES_EQUAL(2, errorCounter->Val());
}

Y_UNIT_TEST(ShouldSupportWriteBackCacheCapacity4GiB)
{
NProto::TFileStoreFeatures features;
features.SetServerWriteBackCacheEnabled(true);

TBootstrap bootstrap(
CreateWallClockTimer(),
CreateScheduler(),
features,
1000,
1000,
4_GB + 1); // writeBackCacheCapacity

// Narrowing ui64 to ui32 will result in verification failure
bootstrap.Start();
Y_DEFER {
bootstrap.Stop();
};
}
}

} // namespace NCloud::NFileStore::NFuse
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class TWriteBackCache::TImpl final
ITimerPtr timer,
IWriteBackCacheStatsPtr stats,
const TString& filePath,
ui32 capacityBytes,
ui64 capacityBytes,
TFlushConfig flushConfig)
: Session(std::move(session))
, Scheduler(std::move(scheduler))
Expand Down Expand Up @@ -1289,7 +1289,7 @@ TWriteBackCache::TWriteBackCache(
ITimerPtr timer,
IWriteBackCacheStatsPtr stats,
const TString& filePath,
ui32 capacityBytes,
ui64 capacityBytes,
TDuration automaticFlushPeriod,
TDuration flushRetryPeriod,
ui32 maxWriteRequestSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TWriteBackCache final
ITimerPtr timer,
IWriteBackCacheStatsPtr stats,
const TString& filePath,
ui32 capacityBytes,
ui64 capacityBytes,
TDuration automaticFlushPeriod,
TDuration flushRetryPeriod,
ui32 maxWriteRequestSize,
Expand Down
Loading