diff --git a/cloud/filestore/tools/testing/loadtest/lib/request_replay.cpp b/cloud/filestore/tools/testing/loadtest/lib/request_replay.cpp index 1a91666bc9..911685bc2f 100644 --- a/cloud/filestore/tools/testing/loadtest/lib/request_replay.cpp +++ b/cloud/filestore/tools/testing/loadtest/lib/request_replay.cpp @@ -173,9 +173,8 @@ IReplayRequestGenerator::ExecuteNextRequest() RequestName(request.GetRequestType()).c_str(), request.ShortDebugString().Quote().c_str()); - if (const auto future = ProcessRequest(request); - future.Initialized()) - { + const auto future = ProcessRequest(request); + if (future.Initialized()) { return future; } } diff --git a/cloud/filestore/tools/testing/loadtest/lib/request_replay_fs.cpp b/cloud/filestore/tools/testing/loadtest/lib/request_replay_fs.cpp index 04ee466c1e..8ae7408f7a 100644 --- a/cloud/filestore/tools/testing/loadtest/lib/request_replay_fs.cpp +++ b/cloud/filestore/tools/testing/loadtest/lib/request_replay_fs.cpp @@ -1,7 +1,7 @@ /* -TODO: +TODO(#1733): create file/dir modes -create handle modes (now rw) +create handle modes (now only rw) compare log and actual result ( S_OK E_FS_NOENT ...) read/write with multiranges (now only first processed) */ @@ -51,7 +51,7 @@ class TReplayRequestGeneratorFs final // Map between log and actual local fs node id's THashMap NodesLogToLocal{{RootNodeId, RootNodeId}}; - // Relative to local root path of node. Dirs ends with / + // Full path of node THashMap NodePath; // Collected info for log node id's @@ -68,6 +68,7 @@ class TReplayRequestGeneratorFs final THashMap OpenHandles; const TString LostName = "__lost__"; + const TString UnknownNodeNamePrefix = "_nodeid_"; public: TReplayRequestGeneratorFs( @@ -187,16 +188,17 @@ class TReplayRequestGeneratorFs final { auto parentPath = PathByNode(NodeIdMapped(it->second.ParentLog)); - if (parentPath.IsDefined() && parent) { + if (!parentPath.IsDefined() && parent != InvalidNodeId) { parentPath = PathByNode(parent); } - if (parentPath.IsDefined()) { - parentPath = PathByNode(RootNodeId) / LostName / "_nodeid_" + - ToString(it->second.ParentLog); + if (!parentPath.IsDefined()) { + parentPath = + PathByNode(RootNodeId) / LostName / UnknownNodeNamePrefix + + ToString(it->second.ParentLog); } const auto name = parentPath / (it->second.Name.empty() - ? "_nodeid_" + ToString(nodeIdLog) + ? UnknownNodeNamePrefix + ToString(nodeIdLog) : it->second.Name); const auto nodeId = MakeDirectoryRecursive(name); NodePath[nodeId] = name; @@ -261,14 +263,15 @@ class TReplayRequestGeneratorFs final } if (parentNode == InvalidNodeId) { - STORAGE_ERROR( - "Create handle %lu fail: no parent=%lu", - logRequest.GetNodeInfo().GetHandle(), - logRequest.GetNodeInfo().GetParentNodeId()); return MakeFuture(TCompletedRequest{ NProto::ACTION_CREATE_HANDLE, Started, - MakeError(E_FAIL, "cancelled")}); + MakeError( + E_FAIL, + Sprintf( + "Create handle %lu fail: no parent=%lu", + logRequest.GetNodeInfo().GetHandle(), + logRequest.GetNodeInfo().GetParentNodeId()))}); } auto nodeName = logRequest.GetNodeInfo().GetNodeName(); @@ -573,7 +576,7 @@ class TReplayRequestGeneratorFs final break; } case NProto::E_LINK_NODE: { - // {"TimestampMcs":1727703903595285,"DurationMcs":2432,"RequestType":26,"ErrorCode":0,"NodeInfo":{"NewParentNodeId":267,"NewNodeName":"pack-ebe666445578da0c6157f4172ad581cd731742ec.idx","Mode":292,"Type":3,"NodeId":274,"Size":245792}} + // {"TimestampMcs":1000000000000000,"DurationMcs":2432,"RequestType":26,"ErrorCode":0,"NodeInfo":{"NewParentNodeId":267,"NewNodeName":"name.ext","Mode":292,"Type":3,"NodeId":274,"Size":245792}} const auto targetNode = NodeIdMapped(logRequest.GetNodeInfo().GetNodeId()); @@ -605,7 +608,6 @@ class TReplayRequestGeneratorFs final nodeid = TFileStat{fullName}.INode; } - // CreateIfMissing(PathByNode()) if (nodeid) { NodesLogToLocal[logRequest.GetNodeInfo().GetNodeId()] = nodeid; NodePath[nodeid] = PathByNode(parentNode) /