caigy commented on code in PR #4467:
URL: https://github.com/apache/rocketmq/pull/4467#discussion_r898620751


##########
store/src/main/java/org/apache/rocketmq/store/CommitLog.java:
##########
@@ -803,13 +802,18 @@ public CompletableFuture<PutMessageResult> 
asyncPutMessage(final MessageExtBroke
         boolean needHandleHA = needHandleHA(msg);
         int needAckNums = 1;
 
-        if (needHandleHA && 
!this.defaultMessageStore.getMessageStoreConfig().isAllAckInSyncStateSet()) {
-            int inSyncReplicas = 
Math.min(this.defaultMessageStore.getAliveReplicaNumInGroup(),
-                
this.defaultMessageStore.getHaService().inSyncSlaveNums(currOffset) + 1);
-            needAckNums = calcNeedAckNums(inSyncReplicas);
-            if (needAckNums > inSyncReplicas) {
-                // Tell the producer, don't have enough slaves to handle the 
send request
-                return CompletableFuture.completedFuture(new 
PutMessageResult(PutMessageStatus.IN_SYNC_REPLICAS_NOT_ENOUGH, null));
+        if (needHandleHA) {
+            if 
(this.defaultMessageStore.getBrokerConfig().isEnableControllerMode() && 
this.defaultMessageStore.getMessageStoreConfig().isAllAckInSyncStateSet()) {
+                // -1 means all ack in SyncStateSet
+                needAckNums = -1;

Review Comment:
   It may be better to define `-1` as a meaningful constant.



-- 
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