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

cherry-pick histogram debugging message and cardinality job nullptr fix #1645

Merged
merged 3 commits into from
Aug 15, 2023
Merged
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 @@ -83,22 +83,28 @@ class PerShardCardinalityBuster(dsSettings: DownsamplerSettings,
val numCouldNotDelete = AtomicInt(0)
val numCandidateKeys = AtomicInt(0)
val keysToDelete = candidateKeys.filter { pk =>
val rawSchemaId = RecordSchema.schemaID(pk.partKey, UnsafeUtils.arayOffset)
val schema = schemas(rawSchemaId)
val pkPairs = schema.partKeySchema.toStringPairs(pk.partKey, UnsafeUtils.arayOffset)
val willDelete = deleteFilter.exists { filter => // at least one filter should match
filter.forall { case (filterKey, filterValRegex) => // should match all tags in this filter
pkPairs.exists { case (pkKey, pkVal) =>
pkKey == filterKey && filterValRegex.matcher(pkVal).matches
try {
val rawSchemaId = RecordSchema.schemaID(pk.partKey, UnsafeUtils.arayOffset)
val schema = schemas(rawSchemaId)
val pkPairs = schema.partKeySchema.toStringPairs(pk.partKey, UnsafeUtils.arayOffset)
val willDelete = deleteFilter.exists { filter => // at least one filter should match
filter.forall { case (filterKey, filterValRegex) => // should match all tags in this filter
pkPairs.exists { case (pkKey, pkVal) =>
pkKey == filterKey && filterValRegex.matcher(pkVal).matches
}
}
}
if (willDelete) {
BusterContext.log.debug(s"Deleting part key $pkPairs from shard=$shard startTime=${pk.startTime} " +
s"endTime=${pk.endTime} split=$split isSimulation=$isSimulation")
}
numCandidateKeys += 1
willDelete
} catch {
case e : Exception =>
BusterContext.log.warn(s"skip busting pk=$pk because of exception $e")
false
}
if (willDelete) {
BusterContext.log.debug(s"Deleting part key $pkPairs from shard=$shard startTime=${pk.startTime} " +
s"endTime=${pk.endTime} split=$split isSimulation=$isSimulation")
}
numCandidateKeys += 1
willDelete
}
val fut = Observable.fromIteratorUnsafe(keysToDelete)
.mapParallelUnordered(numParallelDeletesPerSparkThread.getOrElse(1)) { pk =>
Expand Down
Loading