From 9e6ea80dfff1146e33f0ffac353772bc8a216789 Mon Sep 17 00:00:00 2001
From: chrislu <chris.lu@gmail.com>
Date: Sun, 28 Jan 2024 14:27:52 -0800
Subject: [PATCH] read existing topic conf

---
 weed/mq/broker/broker_grpc_configure.go | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/weed/mq/broker/broker_grpc_configure.go b/weed/mq/broker/broker_grpc_configure.go
index 9b6cf9d2a..318e2f6da 100644
--- a/weed/mq/broker/broker_grpc_configure.go
+++ b/weed/mq/broker/broker_grpc_configure.go
@@ -30,16 +30,17 @@ func (b *MessageQueueBroker) ConfigureTopic(ctx context.Context, request *mq_pb.
 	}
 
 	t := topic.FromPbTopic(request.Topic)
-	resp, err = b.readTopicConfFromFiler(t)
-	if err != nil {
+	var readErr error
+	resp, readErr = b.readTopicConfFromFiler(t)
+	if readErr != nil {
 		glog.V(0).Infof("read topic %s conf: %v", request.Topic, err)
 	} else {
-		err = b.ensureTopicActiveAssignments(t, resp)
+		readErr = b.ensureTopicActiveAssignments(t, resp)
 		// no need to assign directly.
 		// The added or updated assignees will read from filer directly.
 		// The gone assignees will die by themselves.
 	}
-	if err == nil && len(resp.BrokerPartitionAssignments) == int(request.PartitionCount) {
+	if readErr == nil && len(resp.BrokerPartitionAssignments) == int(request.PartitionCount) {
 		glog.V(0).Infof("existing topic partitions %d: %+v", len(resp.BrokerPartitionAssignments), resp.BrokerPartitionAssignments)
 	} else {
 		if resp!=nil && len(resp.BrokerPartitionAssignments) > 0 {