@@ -89,6 +89,7 @@ TColumnShard::TColumnShard(TTabletStorageInfo* info, const TActorId& tablet)
89
89
, SubscribeCounters(std::make_shared<NOlap::NResourceBroker::NSubscribe::TSubscriberCounters>())
90
90
, InsertTaskSubscription(NOlap::TInsertColumnEngineChanges::StaticTypeName(), SubscribeCounters)
91
91
, CompactTaskSubscription(NOlap::TCompactColumnEngineChanges::StaticTypeName(), SubscribeCounters)
92
+ , TTLTaskSubscription(NOlap::TTTLColumnEngineChanges::StaticTypeName(), SubscribeCounters)
92
93
, ReadCounters(" Read" )
93
94
, ScanCounters(" Scan" )
94
95
, WritesMonitor(*this )
@@ -743,21 +744,25 @@ bool TColumnShard::SetupTtl(const THashMap<ui64, NOlap::TTiering>& pathTtls, con
743
744
}
744
745
745
746
auto actualIndexInfo = TablesManager.GetPrimaryIndex ()->GetVersionedIndex ();
746
- std::shared_ptr<NOlap::TTTLColumnEngineChanges> indexChanges = TablesManager.MutablePrimaryIndex ().StartTtl (eviction, BackgroundController.GetConflictTTLPortions ());
747
+ const ui64 memoryUsageLimit = HasAppData () ? AppDataVerified ().ColumnShardConfig .GetTieringsMemoryLimit () : ((ui64)512 * 1024 * 1024 );
748
+ std::shared_ptr<NOlap::TTTLColumnEngineChanges> indexChanges = TablesManager.MutablePrimaryIndex ().StartTtl (
749
+ eviction, BackgroundController.GetConflictTTLPortions (), memoryUsageLimit);
747
750
748
751
if (!indexChanges) {
749
752
ACFL_DEBUG (" background" , " ttl" )(" skip_reason" , " no_changes" );
750
753
return false ;
751
754
}
752
-
755
+ const TString externalTaskId = indexChanges-> GetTaskIdentifier ();
753
756
const bool needWrites = indexChanges->NeedConstruction ();
754
757
ACFL_DEBUG (" background" , " ttl" )(" need_writes" , needWrites);
755
758
756
759
indexChanges->Start (*this );
757
760
auto ev = std::make_unique<TEvPrivate::TEvWriteIndex>(std::move (actualIndexInfo), indexChanges, false );
758
761
NYDBTest::TControllers::GetColumnShardController ()->OnWriteIndexStart (TabletID (), indexChanges->TypeString ());
759
762
if (needWrites) {
760
- ActorContext ().Register (new NOlap::NBlobOperations::NRead::TActor (std::make_shared<TChangesReadTask>(std::move (ev), SelfId (), TabletID (), CompactionCounters)));
763
+ NOlap::NResourceBroker::NSubscribe::ITask::StartResourceSubscription (
764
+ ResourceSubscribeActor, std::make_shared<NOlap::NBlobOperations::NRead::ITask::TReadSubscriber>(
765
+ std::make_shared<TChangesReadTask>(std::move(ev), SelfId(), TabletID(), CompactionCounters), 0, indexChanges->CalcMemoryForUsage(), externalTaskId, TTLTaskSubscription));
761
766
} else {
762
767
ev->SetPutStatus (NKikimrProto::OK);
763
768
ActorContext ().Send (SelfId (), std::move (ev));
0 commit comments