@@ -126,8 +126,8 @@ class TTxUpdateSchema: public TTransactionBase<TColumnShard> {
126126};
127127
128128bool TTxUpdateSchema::Execute (TTransactionContext& txc, const TActorContext&) {
129- NActors::TLogContextGuard gLogging =
130- NActors::TLogContextBuilder::Build (NKikimrServices::TX_COLUMNSHARD)( " tablet_id " , Self-> TabletID ())( " event " , " initialize_shard " );
129+ NActors::TLogContextGuard gLogging = NActors::TLogContextBuilder::Build (NKikimrServices::TX_COLUMNSHARD)( " tablet_id " , Self-> TabletID ())(
130+ " process " , " TTxUpdateSchema::Execute " );
131131 ACFL_INFO (" step" , " TTxUpdateSchema.Execute_Start" )(" details" , Self->NormalizerController .DebugString ());
132132
133133 while (!Self->NormalizerController .IsNormalizationFinished ()) {
@@ -153,6 +153,8 @@ bool TTxUpdateSchema::Execute(TTransactionContext& txc, const TActorContext&) {
153153}
154154
155155void TTxUpdateSchema::Complete (const TActorContext& ctx) {
156+ NActors::TLogContextGuard gLogging =
157+ NActors::TLogContextBuilder::Build (NKikimrServices::TX_COLUMNSHARD)(" tablet_id" , Self->TabletID ())(" process" , " TTxUpdateSchema::Complete" );
156158 AFL_INFO (NKikimrServices::TX_COLUMNSHARD)(" step" , " TTxUpdateSchema.Complete" );
157159 Self->Counters .GetCSCounters ().Initialization .OnTxUpdateSchemaFinished (TMonotonic::Now () - StartInstant);
158160 if (NormalizerTasks.empty ()) {
@@ -185,32 +187,34 @@ class TTxApplyNormalizer: public TTransactionBase<TColumnShard> {
185187 }
186188
187189private:
190+ bool NormalizerFinished = false ;
188191 NOlap::INormalizerChanges::TPtr Changes;
189192};
190193
191194bool TTxApplyNormalizer::Execute (TTransactionContext& txc, const TActorContext&) {
192195 NActors::TLogContextGuard gLogging =
193- NActors::TLogContextBuilder::Build (NKikimrServices::TX_COLUMNSHARD)(" tablet_id" , Self->TabletID ())(" event" , " initialize_shard " );
196+ NActors::TLogContextBuilder::Build (NKikimrServices::TX_COLUMNSHARD)(" tablet_id" , Self->TabletID ())(" event" , " TTxApplyNormalizer::Execute " );
194197 AFL_INFO (NKikimrServices::TX_COLUMNSHARD)(" step" , " TTxApplyNormalizer.Execute" )(" details" , Self->NormalizerController .DebugString ());
195198 if (!Changes->ApplyOnExecute (txc, Self->NormalizerController )) {
196199 return false ;
197200 }
198201
199- if (Self->NormalizerController .GetNormalizer ()->GetActiveTasksCount () == 1 ) {
202+ if (Self->NormalizerController .GetNormalizer ()->DecActiveCounters () == 0 ) {
203+ NormalizerFinished = true ;
200204 NIceDb::TNiceDb db (txc.DB );
201205 Self->NormalizerController .OnNormalizerFinished (db);
202206 }
203207 return true ;
204208}
205209
206210void TTxApplyNormalizer::Complete (const TActorContext& ctx) {
207- AFL_INFO (NKikimrServices::TX_COLUMNSHARD)(" step" , " TTxApplyNormalizer.Complete" )(" tablet_id" , Self->TabletID ())(" event" , " initialize_shard" );
211+ NActors::TLogContextGuard gLogging = NActors::TLogContextBuilder::Build (NKikimrServices::TX_COLUMNSHARD)(" tablet_id" , Self->TabletID ())(
212+ " event" , " TTxApplyNormalizer::Complete" );
208213 AFL_VERIFY (!Self->NormalizerController .IsNormalizationFinished ())(" details" , Self->NormalizerController .DebugString ());
209- AFL_WARN (NKikimrServices::TX_COLUMNSHARD)(" tablet_id " , Self-> TabletID ())( " event" , " apply_normalizer_changes" )(
214+ AFL_WARN (NKikimrServices::TX_COLUMNSHARD)(" event" , " apply_normalizer_changes" )(
210215 " details" , Self->NormalizerController .DebugString ())(" size" , Changes->GetSize ());
211216 Changes->ApplyOnComplete (Self->NormalizerController );
212- Self->NormalizerController .GetNormalizer ()->OnResultReady ();
213- if (Self->NormalizerController .GetNormalizer ()->HasActiveTasks ()) {
217+ if (!NormalizerFinished) {
214218 return ;
215219 }
216220
@@ -240,6 +244,8 @@ class TTxInitSchema: public TTransactionBase<TColumnShard> {
240244};
241245
242246bool TTxInitSchema::Execute (TTransactionContext& txc, const TActorContext&) {
247+ NActors::TLogContextGuard gLogging = NActors::TLogContextBuilder::Build (NKikimrServices::TX_COLUMNSHARD)(" tablet_id" , Self->TabletID ())(
248+ " process" , " TTxInitSchema::Execute" );
243249 LOG_S_DEBUG (" TxInitSchema.Execute at tablet " << Self->TabletID ());
244250
245251 const bool isFirstRun = txc.DB .GetScheme ().IsEmpty ();
@@ -286,6 +292,8 @@ bool TTxInitSchema::Execute(TTransactionContext& txc, const TActorContext&) {
286292}
287293
288294void TTxInitSchema::Complete (const TActorContext& ctx) {
295+ NActors::TLogContextGuard gLogging =
296+ NActors::TLogContextBuilder::Build (NKikimrServices::TX_COLUMNSHARD)(" tablet_id" , Self->TabletID ())(" process" , " TTxInitSchema::Complete" );
289297 Self->Counters .GetCSCounters ().Initialization .OnTxInitSchemaFinished (TMonotonic::Now () - StartInstant);
290298 LOG_S_DEBUG (" TxInitSchema.Complete at tablet " << Self->TabletID (););
291299 Self->Execute (new TTxUpdateSchema (Self), ctx);
0 commit comments