Skip to content

Commit

Permalink
rebase + fix review issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Deb Natkh committed Mar 28, 2024
1 parent 504fbd8 commit f142b02
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 4 deletions.
3 changes: 3 additions & 0 deletions cloud/filestore/config/storage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,7 @@ message TStorageConfig
// to release it in case of a client disconnect, this timeout is used.
optional uint32 GenerateBlobIdsReleaseCollectBarrierTimeout = 345;

// If ThreeStageWriteEnabled is true, writes that exceed this threshold
// will use the three-stage write path. Similar to WriteBlobThreshold
optional uint32 ThreeStageWriteThreshold = 346;
}
1 change: 1 addition & 0 deletions cloud/filestore/libs/storage/core/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ namespace {
\
xxx(TwoStageReadEnabled, bool, false )\
xxx(ThreeStageWriteEnabled, bool, false )\
xxx(ThreeStageWriteThreshold, ui32, 64_KB )\
xxx(EntryTimeout, TDuration, TDuration::Zero() )\
xxx(NegativeEntryTimeout, TDuration, TDuration::Zero() )\
xxx(AttrTimeout, TDuration, TDuration::Zero() )\
Expand Down
1 change: 1 addition & 0 deletions cloud/filestore/libs/storage/core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ class TStorageConfig

bool GetTwoStageReadEnabled() const;
bool GetThreeStageWriteEnabled() const;
ui32 GetThreeStageWriteThreshold() const;
TDuration GetEntryTimeout() const;
TDuration GetNegativeEntryTimeout() const;
TDuration GetAttrTimeout() const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class TWriteDataActor final: public TActorBootstrapped<TWriteDataActor>

public:
TWriteDataActor(
NProto::TWriteDataRequest request,
TRequestInfoPtr requestInfo)
NProto::TWriteDataRequest request,
TRequestInfoPtr requestInfo)
: WriteRequest(std::move(request))
, RequestInfo(std::move(requestInfo))
{}
Expand Down Expand Up @@ -326,10 +326,11 @@ void TStorageServiceActor::HandleWriteData(
ui32 blockSize = filestore.GetBlockSize();

// TODO(debnatkh): Consider supporting unaligned writes
if (msg->Record.GetOffset() % blockSize == 0 &&
if (filestore.GetFeatures().GetThreeStageWriteEnabled() &&
msg->Record.GetOffset() % blockSize == 0 &&
msg->Record.GetBuffer().Size() % blockSize == 0 &&
msg->Record.GetBuffer().Size() >
filestore.GetFeatures().GetThreeStageWriteEnabled())
filestore.GetFeatures().GetThreeStageWriteThreshold())
{
LOG_DEBUG(
ctx,
Expand Down
4 changes: 4 additions & 0 deletions cloud/filestore/libs/storage/service/service_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2050,6 +2050,10 @@ Y_UNIT_TEST_SUITE(TStorageServiceTest)
Y_UNIT_TEST(ShouldPerformThreeStageWrites)
{
TTestEnv env;
env.CreateSubDomain("nfs");

ui32 nodeIdx = env.CreateNode("nfs");


TServiceClient service(env.GetRuntime(), nodeIdx);
const TString fs = "test";
Expand Down
1 change: 1 addition & 0 deletions cloud/filestore/libs/storage/service/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ SRCS(
service_actor_readdata.cpp
service_actor_statfs.cpp
service_actor_update_stats.cpp
service_actor_writedata.cpp
service_state.cpp
)

Expand Down
1 change: 1 addition & 0 deletions cloud/filestore/public/api/protos/fs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ message TFileStoreFeatures
uint32 NegativeEntryTimeout = 3;
uint32 AttrTimeout = 4;
bool ThreeStageWriteEnabled = 5;
uint32 ThreeStageWriteThreshold = 6;
}

message TFileStore
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
TwoStageReadEnabled: true
NewCompactionEnabled: true
NewCleanupEnabled: true
TwoStageWriteEnabled: true

0 comments on commit f142b02

Please sign in to comment.