@@ -10,6 +10,7 @@ class TTxStartTablet : public TTransactionBase<THive> {
10
10
ui64 Cookie;
11
11
bool External;
12
12
TSideEffects SideEffects;
13
+ bool Success;
13
14
14
15
public:
15
16
TTxStartTablet (TFullTabletId tabletId, const TActorId& local, ui64 cookie, bool external, THive *hive)
@@ -23,10 +24,12 @@ class TTxStartTablet : public TTransactionBase<THive> {
23
24
TTxType GetTxType () const override { return NHive::TXTYPE_START_TABLET; }
24
25
25
26
bool Execute (TTransactionContext& txc, const TActorContext&) override {
27
+ Success = false ;
26
28
SideEffects.Reset (Self->SelfId ());
27
29
BLOG_D (" THive::TTxStartTablet::Execute Tablet " << TabletId);
28
30
TTabletInfo* tablet = Self->FindTablet (TabletId);
29
31
if (tablet != nullptr ) {
32
+ tablet->BootTime = TActivationContext::Now ();
30
33
// finish fast-move operation
31
34
if (tablet->LastNodeId != 0 && tablet->LastNodeId != Local.NodeId ()) {
32
35
TNodeInfo* lastNode = Self->FindNode (tablet->LastNodeId );
@@ -65,6 +68,7 @@ class TTxStartTablet : public TTransactionBase<THive> {
65
68
new TEvLocal::TEvBootTablet (*leader.TabletStorageInfo , promotableFollowerId, leader.KnownGeneration ),
66
69
IEventHandle::FlagTrackDelivery | IEventHandle::FlagSubscribeOnSession,
67
70
Cookie);
71
+ Success = true ;
68
72
return true ;
69
73
} else {
70
74
BLOG_W (" THive::TTxStartTablet::Execute, ignoring TEvBootTablet(" << leader.ToString () << " ) - wrong state or node" );
@@ -79,6 +83,7 @@ class TTxStartTablet : public TTransactionBase<THive> {
79
83
new TEvLocal::TEvBootTablet (*follower.LeaderTablet .TabletStorageInfo , follower.Id ),
80
84
IEventHandle::FlagTrackDelivery | IEventHandle::FlagSubscribeOnSession,
81
85
Cookie);
86
+ Success = true ;
82
87
return true ;
83
88
} else {
84
89
BLOG_W (" THive::TTxStartTablet::Execute, ignoring TEvBootTablet(" << follower.ToString () << " ) - wrong state or node" );
@@ -108,6 +113,9 @@ class TTxStartTablet : public TTransactionBase<THive> {
108
113
void Complete (const TActorContext& ctx) override {
109
114
BLOG_D (" THive::TTxStartTablet::Complete Tablet " << TabletId << " SideEffects: " << SideEffects);
110
115
SideEffects.Complete (ctx);
116
+ if (Success) {
117
+ Self->UpdateCounterTabletsStarting (+1 );
118
+ }
111
119
}
112
120
};
113
121
0 commit comments