@@ -453,7 +453,7 @@ void TExecutor::Active(const TActorContext &ctx) {
453
453
CompactionLogic = THolder<TCompactionLogic>(new TCompactionLogic (MemTableMemoryConsumersCollection.Get (), Logger.Get (), Broker.Get (), this , loadedState->Comp ,
454
454
Sprintf (" tablet-%" PRIu64, Owner->TabletID ())));
455
455
DataCleanupLogic = MakeHolder<TDataCleanupLogic>(static_cast <NActors::IActorOps*>(this ), this , Owner, Logger.Get (), GcLogic.Get ());
456
- LogicRedo->InstallCounters (Counters.Get (), nullptr );
456
+ LogicRedo->InstallCounters (Counters.Get (), AppTxCounters );
457
457
458
458
ResourceMetrics = MakeHolder<NMetrics::TResourceMetrics>(Owner->TabletID (), 0 , Launcher);
459
459
@@ -567,6 +567,9 @@ void TExecutor::FinishCancellation(TSeat* seat, bool activateMore) {
567
567
Memory->ReleaseMemory (*seat);
568
568
--Stats->TxInFly ;
569
569
Counters->Simple ()[TExecutorCounters::DB_TX_IN_FLY] = Stats->TxInFly ;
570
+ if (AppTxCounters && seat->TxType != UnknownTxType) {
571
+ AppTxCounters->TxSimple (seat->TxType , COUNTER_TT_INFLY) -= 1 ;
572
+ }
570
573
RemoveTransaction (seat->UniqID );
571
574
if (activateMore) {
572
575
PlanTransactionActivation ();
@@ -1746,6 +1749,9 @@ ui64 TExecutor::DoExecute(TAutoPtr<ITransaction> self, ETxMode mode) {
1746
1749
1747
1750
++Stats->TxInFly ;
1748
1751
Counters->Simple ()[TExecutorCounters::DB_TX_IN_FLY] = Stats->TxInFly ;
1752
+ if (AppTxCounters && seat->TxType != UnknownTxType) {
1753
+ AppTxCounters->TxSimple (seat->TxType , COUNTER_TT_INFLY) += 1 ;
1754
+ }
1749
1755
Counters->Cumulative ()[TExecutorCounters::TX_COUNT_ALL].Increment (1 ); // Deprecated
1750
1756
Counters->Cumulative ()[TExecutorCounters::TX_QUEUED].Increment (1 );
1751
1757
@@ -2005,7 +2011,7 @@ void TExecutor::PostponeTransaction(TSeat* seat, TPageCollectionTxEnv &env,
2005
2011
TAutoPtr<NTable::TChange> change,
2006
2012
THPTimer &bookkeepingTimer)
2007
2013
{
2008
- TTxType txType = seat->Self -> GetTxType () ;
2014
+ TTxType txType = seat->TxType ;
2009
2015
2010
2016
ui32 touchedPages = 0 ;
2011
2017
ui32 newPinnedPages = 0 ;
@@ -2164,7 +2170,7 @@ void TExecutor::PostponeTransaction(TSeat* seat, TPageCollectionTxEnv &env,
2164
2170
void TExecutor::CommitTransactionLog (std::unique_ptr<TSeat> seat, TPageCollectionTxEnv &env,
2165
2171
TAutoPtr<NTable::TChange> change, THPTimer &bookkeepingTimer) {
2166
2172
const bool isReadOnly = !(change->HasAny () || env.HasChanges ());
2167
- const TTxType txType = seat->Self -> GetTxType () ;
2173
+ const TTxType txType = seat->TxType ;
2168
2174
2169
2175
size_t touchedBlocks = PrivatePageCache->GetStats ().CurrentCacheHits ;
2170
2176
Counters->Percentile ()[TExecutorCounters::TX_PERCENTILE_TOUCHED_BLOCKS].IncrementFor (touchedBlocks);
@@ -2192,6 +2198,7 @@ void TExecutor::CommitTransactionLog(std::unique_ptr<TSeat> seat, TPageCollectio
2192
2198
const double currentExecTime = seat->CPUExecTime ;
2193
2199
2194
2200
if (isReadOnly) {
2201
+ // Note: per-tx InFly is decremented in txloglogic
2195
2202
if (Stats->IsFollower ()) {
2196
2203
// todo: extract completion counters from txloglogic
2197
2204
--Stats->TxInFly ;
@@ -3093,6 +3100,7 @@ void TExecutor::Handle(TEvTablet::TEvCommitResult::TPtr &ev, const TActorContext
3093
3100
switch (cookie) {
3094
3101
case ECommit::Redo:
3095
3102
{
3103
+ // Note: per-tx InFly is decrememnted in txloglogic
3096
3104
const ui64 confirmedTransactions = LogicRedo->Confirm (step, ctx, OwnerActorId);
3097
3105
Stats->TxInFly -= confirmedTransactions;
3098
3106
Counters->Simple ()[TExecutorCounters::DB_TX_IN_FLY] = Stats->TxInFly ;
@@ -4387,8 +4395,9 @@ void TExecutor::RegisterExternalTabletCounters(TAutoPtr<TTabletCountersBase> app
4387
4395
AppCountersBaseline = MakeHolder<TTabletCountersBase>();
4388
4396
AppCounters->RememberCurrentStateAsBaseline (*AppCountersBaseline);
4389
4397
4398
+ AppTxCounters = dynamic_cast <TTabletCountersWithTxTypes*>(AppCounters.Get ());
4399
+
4390
4400
if (LogicRedo) {
4391
- AppTxCounters = dynamic_cast <TTabletCountersWithTxTypes*>(AppCounters.Get ());
4392
4401
LogicRedo->InstallCounters (Counters.Get (), AppTxCounters);
4393
4402
}
4394
4403
}
0 commit comments