-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue-1146: load NodeRefs upon tablet load (#2241)
* issue-1146: load NodeRefs upon tablet load
- Loading branch information
Showing
20 changed files
with
542 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
cloud/filestore/libs/storage/tablet/tablet_actor_loadstate_noderefs.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
#include "tablet_actor.h" | ||
|
||
namespace NCloud::NFileStore::NStorage { | ||
|
||
using namespace NActors; | ||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
void TIndexTabletActor::LoadNodeRefs( | ||
const NActors::TActorContext& ctx, | ||
ui64 nodeId, | ||
const TString& name) | ||
{ | ||
const ui64 maxNodeRefs = Config->GetInMemoryIndexCacheLoadOnTabletStartRowsPerTx(); | ||
|
||
LOG_INFO( | ||
ctx, | ||
TFileStoreComponents::TABLET, | ||
"%s LoadNodeRefs iteration started (nodeId: %lu, name: %s, " | ||
"maxNodeRefs: %lu)", | ||
LogTag.c_str(), | ||
nodeId, | ||
name.c_str(), | ||
maxNodeRefs); | ||
|
||
ExecuteTx<TLoadNodeRefs>( | ||
ctx, | ||
nodeId, | ||
name, | ||
maxNodeRefs); | ||
} | ||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
bool TIndexTabletActor::ValidateTx_LoadNodeRefs( | ||
const TActorContext& ctx, | ||
TTxIndexTablet::TLoadNodeRefs& args) | ||
{ | ||
LOG_INFO( | ||
ctx, | ||
TFileStoreComponents::TABLET, | ||
"%s LoadingNodeRefs (nodeId: %lu, name: %s, maxNodeRefs: %lu)", | ||
LogTag.c_str(), | ||
args.NodeId, | ||
args.Cookie.c_str(), | ||
args.MaxNodeRefs); | ||
return true; | ||
} | ||
|
||
bool TIndexTabletActor::PrepareTx_LoadNodeRefs( | ||
const TActorContext& ctx, | ||
IIndexTabletDatabase& db, | ||
TTxIndexTablet::TLoadNodeRefs& args) | ||
{ | ||
TVector<TIndexTabletDatabase::TNodeRef> nodeRefs; | ||
|
||
bool ready = db.ReadNodeRefs( | ||
args.NodeId, | ||
args.Cookie, | ||
args.MaxNodeRefs, | ||
nodeRefs, | ||
args.NextNodeId, | ||
args.NextCookie); | ||
|
||
LOG_INFO( | ||
ctx, | ||
TFileStoreComponents::TABLET, | ||
"%s LoadingNodeRefs (nodeId: %lu, name: %s, maxNodeRefs: %lu), read " | ||
"%lu nodeRefs: %s", | ||
LogTag.c_str(), | ||
args.NodeId, | ||
args.Cookie.c_str(), | ||
args.MaxNodeRefs, | ||
nodeRefs.size(), | ||
ready ? "finished" : "restarted"); | ||
|
||
return ready; | ||
} | ||
|
||
void TIndexTabletActor::CompleteTx_LoadNodeRefs( | ||
const TActorContext& ctx, | ||
TTxIndexTablet::TLoadNodeRefs& args) | ||
{ | ||
LOG_INFO( | ||
ctx, | ||
TFileStoreComponents::TABLET, | ||
"%s LoadNodeRefs iteration completed, next nodeId: %lu, next cookie: " | ||
"%s", | ||
LogTag.c_str(), | ||
args.NextNodeId, | ||
args.NextCookie.c_str()); | ||
|
||
if (args.NextCookie || args.NextNodeId) { | ||
LoadNodeRefs(ctx, args.NextNodeId, args.NextCookie); | ||
} else { | ||
LOG_INFO( | ||
ctx, | ||
TFileStoreComponents::TABLET, | ||
"%s LoadNodeRefs completed", | ||
LogTag.c_str()); | ||
|
||
MarkNodeRefsLoadComplete(); | ||
} | ||
} | ||
|
||
} // namespace NCloud::NFileStore::NStorage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.