File tree 2 files changed +34
-3
lines changed
ydb/core/statistics/aggregator
2 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -227,14 +227,19 @@ struct TStatisticsAggregator::TTxInit : public TTxBase {
227
227
ui64 ownerId = rowset.GetValue <Schema::ForceTraversalTables::OwnerId>();
228
228
ui64 localPathId = rowset.GetValue <Schema::ForceTraversalTables::LocalPathId>();
229
229
TString columnTags = rowset.GetValue <Schema::ForceTraversalTables::ColumnTags>();
230
- ui64 status = rowset.GetValue <Schema::ForceTraversalTables::Status>();
230
+ TForceTraversalTable::EStatus status = (TForceTraversalTable::EStatus)rowset.GetValue <Schema::ForceTraversalTables::Status>();
231
+
232
+ if (status == TForceTraversalTable::EStatus::AnalyzeStarted) {
233
+ // Resent TEvAnalyzeTable to shards
234
+ status = TForceTraversalTable::EStatus::None;
235
+ }
231
236
232
237
auto pathId = TPathId (ownerId, localPathId);
233
238
234
239
TForceTraversalTable operationTable {
235
240
.PathId = pathId,
236
241
.ColumnTags = columnTags,
237
- .Status = (TForceTraversalTable::EStatus) status,
242
+ .Status = status,
238
243
};
239
244
auto forceTraversalOperation = Self->ForceTraversalOperation (operationId);
240
245
if (!forceTraversalOperation) {
@@ -270,7 +275,7 @@ struct TStatisticsAggregator::TTxInit : public TTxBase {
270
275
271
276
Self->InitializeStatisticsTable ();
272
277
273
- if (Self->TraversalPathId ) {
278
+ if (Self->TraversalPathId && Self-> TraversalStartKey ) {
274
279
Self->NavigateType = ENavigateType::Traversal;
275
280
Self->NavigatePathId = Self->TraversalPathId ;
276
281
Self->Navigate ();
Original file line number Diff line number Diff line change @@ -117,6 +117,32 @@ Y_UNIT_TEST_SUITE(AnalyzeColumnshard) {
117
117
UNIT_ASSERT (!response2);
118
118
}
119
119
120
+ Y_UNIT_TEST (AnalyzeRebootSa) {
121
+ TTestEnv env (1 , 1 );
122
+ auto & runtime = *env.GetServer ().GetRuntime ();
123
+ auto tableInfo = CreateDatabaseTables (env, 1 , 1 )[0 ];
124
+
125
+ auto sender = runtime.AllocateEdgeActor ();
126
+
127
+ bool eventSeen = false ;
128
+ auto observer = runtime.AddObserver <TEvStatistics::TEvAnalyzeTableResponse>([&](auto &) {
129
+ if (!eventSeen) {
130
+ RebootTablet (runtime, tableInfo.SaTabletId , sender);
131
+ eventSeen = true ;
132
+ }
133
+ });
134
+
135
+ auto analyzeRequest1 = MakeAnalyzeRequest ({tableInfo.PathId });
136
+ runtime.SendToPipe (tableInfo.SaTabletId , sender, analyzeRequest1.release ());
137
+
138
+ runtime.WaitFor (" blocked 1st TEvAnalyzeTableResponse event" , [&]{ return eventSeen; });
139
+
140
+ auto analyzeRequest2 = MakeAnalyzeRequest ({tableInfo.PathId });
141
+ runtime.SendToPipe (tableInfo.SaTabletId , sender, analyzeRequest2.release ());
142
+
143
+ runtime.GrabEdgeEventRethrow <TEvStatistics::TEvAnalyzeResponse>(sender);
144
+ }
145
+
120
146
}
121
147
122
148
} // NStat
You can’t perform that action at this time.
0 commit comments