Hi Raj, Earlier in 4.0.0 release, we have been using the partition index. If that to be worked correctly we should persist the index for each cluster.
IMO there is a better way to execute the round-robin method as follows, The intention of round robin algorithm is to distribute the members in the partitions equally. Current method works as per the following example. Say we have 3 partitions, p1, p2, and p3 and max of each partition is 2. So according to the algorithm, it will select the first partition who has the lowest member count. Iteration1: It will select p1. Iteration2: It will select p2. Iteration3: It will select p3. Iteration4: It will select p1. Iteration5: It will select p2. .... Thanks. On Tue, Mar 3, 2015 at 10:22 PM, Rajkumar Rajaratnam <rajkum...@wso2.com> wrote: > Hi Devs, > > It seems to me that there is a bug in round-robin implementation of > partition algorithm. > > > https://github.com/apache/stratos/blob/0b7734f4c9f1444d064fec93bf9ac59a5883faf2/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/algorithm/RoundRobin.java#L43-L64 > > Shouldn't it work based on current partition index? For example, if the > most recent instance was spin up in partition-1, the next instance should > be spin up in partition-2 and so on. According to current logic what is > happening is, all the instance are spin up in partition-1. > > Please correct me If I am wrong. > > Thanks. > > -- > Rajkumar Rajaratnam > Committer & PMC Member, Apache Stratos > Software Engineer, WSO2 > > Mobile : +94777568639 > Blog : rajkumarr.com > -- -- Lahiru Sandaruwan Committer and PMC member, Apache Stratos, Senior Software Engineer, WSO2 Inc., http://wso2.com lean.enterprise.middleware email: lahi...@wso2.com blog: http://lahiruwrites.blogspot.com/ linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146