From fe03b1b5228d421f2b9e6903a728aa76866166f1 Mon Sep 17 00:00:00 2001 From: chrislu Date: Fri, 1 Mar 2024 05:59:40 -0800 Subject: [PATCH] handle single broker case --- weed/mq/pub_balancer/allocate.go | 20 ++++++++++++++++++-- weed/mq/pub_balancer/allocate_test.go | 19 +++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/weed/mq/pub_balancer/allocate.go b/weed/mq/pub_balancer/allocate.go index 12d83d01a..1dd1ef9d8 100644 --- a/weed/mq/pub_balancer/allocate.go +++ b/weed/mq/pub_balancer/allocate.go @@ -126,14 +126,30 @@ func EnsureAssignmentsToActiveBrokers(activeBrokers cmap.ConcurrentMap[string, * i++ hasChanges = true } + + hasEmptyFollowers := false j := 0 for ; j