@@ -10,6 +10,7 @@ class TTxStartTablet : public TTransactionBase<THive> {
1010 ui64 Cookie;
1111 bool External;
1212 TSideEffects SideEffects;
13+ bool Success;
1314
1415public:
1516 TTxStartTablet (TFullTabletId tabletId, const TActorId& local, ui64 cookie, bool external, THive *hive)
@@ -23,10 +24,12 @@ class TTxStartTablet : public TTransactionBase<THive> {
2324 TTxType GetTxType () const override { return NHive::TXTYPE_START_TABLET; }
2425
2526 bool Execute (TTransactionContext& txc, const TActorContext&) override {
27+ Success = false ;
2628 SideEffects.Reset (Self->SelfId ());
2729 BLOG_D (" THive::TTxStartTablet::Execute Tablet " << TabletId);
2830 TTabletInfo* tablet = Self->FindTablet (TabletId);
2931 if (tablet != nullptr ) {
32+ tablet->BootTime = TActivationContext::Now ();
3033 // finish fast-move operation
3134 if (tablet->LastNodeId != 0 && tablet->LastNodeId != Local.NodeId ()) {
3235 TNodeInfo* lastNode = Self->FindNode (tablet->LastNodeId );
@@ -65,6 +68,7 @@ class TTxStartTablet : public TTransactionBase<THive> {
6568 new TEvLocal::TEvBootTablet (*leader.TabletStorageInfo , promotableFollowerId, leader.KnownGeneration ),
6669 IEventHandle::FlagTrackDelivery | IEventHandle::FlagSubscribeOnSession,
6770 Cookie);
71+ Success = true ;
6872 return true ;
6973 } else {
7074 BLOG_W (" THive::TTxStartTablet::Execute, ignoring TEvBootTablet(" << leader.ToString () << " ) - wrong state or node" );
@@ -79,6 +83,7 @@ class TTxStartTablet : public TTransactionBase<THive> {
7983 new TEvLocal::TEvBootTablet (*follower.LeaderTablet .TabletStorageInfo , follower.Id ),
8084 IEventHandle::FlagTrackDelivery | IEventHandle::FlagSubscribeOnSession,
8185 Cookie);
86+ Success = true ;
8287 return true ;
8388 } else {
8489 BLOG_W (" THive::TTxStartTablet::Execute, ignoring TEvBootTablet(" << follower.ToString () << " ) - wrong state or node" );
@@ -108,6 +113,9 @@ class TTxStartTablet : public TTransactionBase<THive> {
108113 void Complete (const TActorContext& ctx) override {
109114 BLOG_D (" THive::TTxStartTablet::Complete Tablet " << TabletId << " SideEffects: " << SideEffects);
110115 SideEffects.Complete (ctx);
116+ if (Success) {
117+ Self->UpdateCounterTabletsStarting (+1 );
118+ }
111119 }
112120};
113121
0 commit comments