Skip to content

Adding some extra logs to test autothrottle #429

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
11 changes: 9 additions & 2 deletions cmd/autothrottle/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,10 @@ func main() {
// the Kafka topic throttled replicas list. This minimizes
// state that must be propagated through the cluster.
if topicsReplicatingNow.isSubSet(topicsReplicatingPreviously) {
log.Println("No new reassigning topics to throttle, disable topic updates")
throttleManager.DisableTopicUpdates()
} else {
log.Println("New reassigning topics to throttle, enable topic updates")
throttleManager.EnableTopicUpdates()
// Unset any previously stored throttle rates. This is done to avoid a
// scenario that results in autothrottle being unaware of externally
Expand Down Expand Up @@ -334,6 +336,8 @@ func main() {
// TODO(jamie): is there a scenario where we should exclude topics
// have also have a reassignment? We're discovering topics here by
// reverse lookup of brokers that are not reassignment participants.
log.Println("There are broker overrides")
log.Print(throttleManager.GetBrokerOverrides())
var err error
otl, err := throttleManager.GetTopicsWithThrottledBrokers()
if err != nil {
Expand All @@ -344,15 +348,18 @@ func main() {

// Determine whether we need to propagate topic throttle replica
// list configs. If the brokers with overrides remains the same,
// we don't need to need to update those configs.
// we don't need to update those configs.
var brokersThrottledNow = newSet()
for broker := range activeOverrideBrokers {
brokersThrottledNow.add(strconv.Itoa(broker))
}

log.Printf("BrokersThrottledNow: %v", brokersThrottledNow)
log.Printf("BrokersThrottledPreviously: %v", brokersThrottledPreviously)
if brokersThrottledNow.equal(brokersThrottledPreviously) {
log.Println("No new brokers to throttle, disable topic updates")
throttleManager.DisableOverrideTopicUpdates()
} else {
log.Println("New brokers to throttle, enable topic updates")
throttleManager.EnableOverrideTopicUpdates()
}

Expand Down