Thanks for updating the patch, Xiaobing Zhou! There is an issue with calculating minNodeGroups:
+ int minNodeGroups = 2;
+ minNodeGroups = Math.min(minNodeGroups, numberOfReplicas);
We are expecting no replica get duplicated on the same NodeGroup (at least for VM case). This is because NodeGroup means the same locality & failure group which won't have any benefit with putting replicas more than 1. Thus, here minNodeGroups should set to numberOfReplicas directly.
Other looks good.
CC Tsz Wo Nicholas Sze.