Frun1na commented on code in PR #4581:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/4581#discussion_r4056355317


##########
server/src/main/java/org/apache/rocketmq/studio/provider/apache/RocketMQAdminClientImpl.java:
##########
@@ -359,11 +361,11 @@ public TopicVO updateTopic(String instanceId, TopicVO 
topic) {
                 // Preserve the existing queue counts when the update request 
does not change them,
                 // matching the perm semantics below; defaulting to 8 would 
silently resize the
                 // topic on partial updates (e.g. perm or remark only).
-                int writeQueues = topic.getWriteQueues() > 0
+                int writeQueues = topic.getWriteQueues() != null && 
topic.getWriteQueues() >= 0
                         ? topic.getWriteQueues()
                         : existing != null && existing.getWriteQueueNums() != 
null
                                 && existing.getWriteQueueNums() > 0 ? 
existing.getWriteQueueNums() : 8;

Review Comment:
   Good catch — the fallback would indeed have undone a stored drained state on 
the next partial update. Both occurrences now accept a stored zero (`>= 0`), 
covered by a regression test 
(`updateTopicPreservesStoredZeroQueueCountsWhenOmitted`) asserting that an 
update omitting the counts keeps stored write=0/read=8.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to