diff --git a/cloud/filestore/apps/client/lib/create_session.cpp b/cloud/filestore/apps/client/lib/create_session.cpp index 6e6bd95dc40..63323ac9960 100644 --- a/cloud/filestore/apps/client/lib/create_session.cpp +++ b/cloud/filestore/apps/client/lib/create_session.cpp @@ -50,7 +50,7 @@ class TCreateSessionCommand final request->MutableHeaders()->SetClientId(ClientId); request->MutableHeaders()->SetSessionSeqNo(SeqNo); - TCallContextPtr ctx = MakeIntrusive(); + TCallContextPtr ctx = MakeIntrusive(FileSystemId); auto response = WaitFor(Client->CreateSession(ctx, std::move(request))); CheckResponse(response); Print(response, JsonOutput); diff --git a/cloud/filestore/apps/client/lib/destroy_session.cpp b/cloud/filestore/apps/client/lib/destroy_session.cpp index 9106744e9b2..5ed69251421 100644 --- a/cloud/filestore/apps/client/lib/destroy_session.cpp +++ b/cloud/filestore/apps/client/lib/destroy_session.cpp @@ -50,7 +50,7 @@ class TDestroySessionCommand final request->MutableHeaders()->SetClientId(ClientId); request->MutableHeaders()->SetSessionSeqNo(SeqNo); - TCallContextPtr ctx = MakeIntrusive(); + TCallContextPtr ctx = MakeIntrusive(FileSystemId); auto response = WaitFor(Client->DestroySession(ctx, std::move(request))); CheckResponse(response); Print(response, JsonOutput); diff --git a/cloud/filestore/apps/client/lib/forced_compaction.cpp b/cloud/filestore/apps/client/lib/forced_compaction.cpp index 34612715cd8..7db01e0b8bb 100644 --- a/cloud/filestore/apps/client/lib/forced_compaction.cpp +++ b/cloud/filestore/apps/client/lib/forced_compaction.cpp @@ -38,7 +38,7 @@ class TForcedCompactionCommand final STORAGE_DEBUG("Sending ExecuteAction request"); const auto requestId = GetRequestId(*request); auto result = WaitFor(Client->ExecuteAction( - MakeIntrusive(requestId), + MakeIntrusive(FileSystemId, requestId), std::move(request))); STORAGE_DEBUG("Received ExecuteAction response"); diff --git a/cloud/filestore/libs/service_local/fs_session.cpp b/cloud/filestore/libs/service_local/fs_session.cpp index d66d9d811f0..e4742e9783c 100644 --- a/cloud/filestore/libs/service_local/fs_session.cpp +++ b/cloud/filestore/libs/service_local/fs_session.cpp @@ -19,6 +19,26 @@ NProto::TCreateSessionResponse TLocalFileSystem::CreateSession( TWriteGuard guard(SessionsLock); auto session = FindSession(clientId, sessionId, sessionSeqNo); + + const auto makeResponse = [&sessionSeqNo, this](const TSessionPtr& session) + { + NProto::TCreateSessionResponse response; + session->GetInfo(*response.MutableSession(), sessionSeqNo); + + *response.MutableFileStore() = Store; + + auto* features = response.MutableFileStore()->MutableFeatures(); + features->SetDirectIoEnabled(Config->GetDirectIoEnabled()); + features->SetDirectIoAlign(Config->GetDirectIoAlign()); + features->SetGuestWritebackCacheEnabled( + Config->GetGuestWritebackCacheEnabled()); + features->SetAsyncDestroyHandleEnabled( + Config->GetAsyncDestroyHandleEnabled()); + features->SetAsyncHandleOperationPeriod( + Config->GetAsyncHandleOperationPeriod().MilliSeconds()); + return response; + }; + if (session) { if (session->ClientId != clientId) { return TErrorResponse(E_FS_INVALID_SESSION, TStringBuilder() @@ -27,9 +47,7 @@ NProto::TCreateSessionResponse TLocalFileSystem::CreateSession( session->AddSubSession(sessionSeqNo, readOnly); - NProto::TCreateSessionResponse response; - session->GetInfo(*response.MutableSession(), sessionSeqNo); - return response; + return makeResponse(session); } if (sessionId) { @@ -41,9 +59,7 @@ NProto::TCreateSessionResponse TLocalFileSystem::CreateSession( if (it != SessionsByClient.end()) { (*it->second)->AddSubSession(sessionSeqNo, readOnly); - NProto::TCreateSessionResponse response; - (*it->second)->GetInfo(*response.MutableSession(), sessionSeqNo); - return response; + return makeResponse(*it->second); } auto clientSessionStatePath = StatePath / ("client_" + clientId); @@ -71,22 +87,7 @@ NProto::TCreateSessionResponse TLocalFileSystem::CreateSession( SessionsById.emplace(session->SessionId, SessionsList.begin()); Y_ABORT_UNLESS(inserted2); - NProto::TCreateSessionResponse response; - session->GetInfo(*response.MutableSession(), sessionSeqNo); - - *response.MutableFileStore() = Store; - - auto* features = response.MutableFileStore()->MutableFeatures(); - features->SetDirectIoEnabled(Config->GetDirectIoEnabled()); - features->SetDirectIoAlign(Config->GetDirectIoAlign()); - features->SetGuestWritebackCacheEnabled( - Config->GetGuestWritebackCacheEnabled()); - features->SetAsyncDestroyHandleEnabled( - Config->GetAsyncDestroyHandleEnabled()); - features->SetAsyncHandleOperationPeriod( - Config->GetAsyncHandleOperationPeriod().MilliSeconds()); - - return response; + return makeResponse(session); } NProto::TPingSessionResponse TLocalFileSystem::PingSession( diff --git a/cloud/filestore/tools/testing/loadtest/lib/request_data.cpp b/cloud/filestore/tools/testing/loadtest/lib/request_data.cpp index 9141cc9c7df..383ba2cdb25 100644 --- a/cloud/filestore/tools/testing/loadtest/lib/request_data.cpp +++ b/cloud/filestore/tools/testing/loadtest/lib/request_data.cpp @@ -597,6 +597,7 @@ class TDataRequestGenerator final TIntrusivePtr CreateCallContext() { return MakeIntrusive( + FileSystemId, LastRequestId.fetch_add(1, std::memory_order_relaxed)); } diff --git a/cloud/filestore/tools/testing/loadtest/lib/request_index.cpp b/cloud/filestore/tools/testing/loadtest/lib/request_index.cpp index ecd569f0bde..eead13ce7a9 100644 --- a/cloud/filestore/tools/testing/loadtest/lib/request_index.cpp +++ b/cloud/filestore/tools/testing/loadtest/lib/request_index.cpp @@ -653,7 +653,7 @@ class TIndexRequestGenerator final TIntrusivePtr CreateCallContext() { - return MakeIntrusive(AtomicIncrement(LastRequestId)); + return MakeIntrusive(FileSystemId, AtomicIncrement(LastRequestId)); } };