Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(metering) Tenant metering in one region and removing unused data structures for cluster V2 #1683

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ private[coordinator] final class ShardManager(settings: FilodbSettings,
private val _coordinators = new mutable.LinkedHashMap[Address, ActorRef]
private val _errorShardReassignedAt = new mutable.HashMap[DatasetRef, mutable.HashMap[Int, Long]]

// TODO move to startup-v2
private val _tenantIngestionMeteringOpt =
if (settings.config.getBoolean("shard-key-level-ingestion-metrics-enabled")) {
val inst = TenantIngestionMetering(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ private[filodb] final class NewNodeCoordinatorActor(memStore: TimeSeriesStore,
private val ingestionActors = new mutable.HashMap[DatasetRef, ActorRef]
private val queryActors = new mutable.HashMap[DatasetRef, ActorRef]
private val localShardMaps = new mutable.HashMap[DatasetRef, ShardMapper]
private val shardsOnThisNode = new mutable.HashMap[DatasetRef, Seq[Int]]
private val ingestionConfigs = new mutable.HashMap[DatasetRef, IngestionConfig]()
private val shardStats = new mutable.HashMap[DatasetRef, ShardHealthStats]()

Expand Down Expand Up @@ -94,7 +93,6 @@ private[filodb] final class NewNodeCoordinatorActor(memStore: TimeSeriesStore,
val mapper = localShardMaps(dataset.ref)
val shardsToStart = clusterDiscovery.shardsForLocalhost(ic.numShards)
shardsToStart.foreach(sh => updateFromShardEvent(ShardAssignmentStarted(dataset.ref, sh, self)))
shardsOnThisNode.put(dataset.ref, shardsToStart)
ingestionActors(dataset.ref) ! ShardIngestionState(0, dataset.ref, mapper)
}

Expand Down Expand Up @@ -151,12 +149,14 @@ private[filodb] final class NewNodeCoordinatorActor(memStore: TimeSeriesStore,
}

private def startTenantIngestionMetering(): Unit = {
logger.info(s"Starting tenant level ingestion cardinality metering...")
val inst = TenantIngestionMetering(
settings,
dsIterProducer = () => { localShardMaps.keysIterator },
coordActorProducer = () => self)
inst.schedulePeriodicPublishJob()
if (settings.config.getBoolean("shard-key-level-ingestion-metrics-enabled")) {
logger.info(s"Starting tenant level ingestion cardinality metering...")
val inst = TenantIngestionMetering(
settings,
dsIterProducer = () => { localShardMaps.keysIterator },
coordActorProducer = () => self)
inst.schedulePeriodicPublishJob()
}
}

def queryHandlers: Receive = LoggingReceive {
Expand Down
Loading