acelyc111 commented on code in PR #2287:
URL: 
https://github.com/apache/incubator-pegasus/pull/2287#discussion_r2361817285


##########
go-client/pegasus/table_connector.go:
##########
@@ -283,15 +283,16 @@ func (p *pegasusTableConnector) updateConf(ctx 
context.Context) error {
        return nil
 }
 
-func isPartitionValid(oldCount int, respCount int) bool {
-       return oldCount == 0 || oldCount == respCount || oldCount*2 == 
respCount || oldCount == respCount*2
+func isPartitionValid(respCount int) bool {
+       // Check if respCount is greater than or equal to 4 and is a power of 2
+       return respCount >= 4 && (respCount&(respCount-1)) == 0

Review Comment:
   How about checking respCount/oldCount is power of 2?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to