nanorth commented on code in PR #2287:
URL:
https://github.com/apache/incubator-pegasus/pull/2287#discussion_r2361949834
##########
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:
In the case of traffic switching, there is no direct relationship between
the partition counts of the old and new tables. I think as long as respCount is
valid (a power of 2 and >= 4), it should be fine. We don't really care about
oldCount in this scenario.
--
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]