[ 
https://issues.apache.org/jira/browse/CASSANDRA-1427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12992003#comment-12992003
 ] 

Pavel Yaskevich commented on CASSANDRA-1427:
--------------------------------------------

bq. Shouldn't the pending ranges calculation include the tokens the nodes are 
moving too as well?

Yeah, I think so, I'm going to do the following:

1. Change TokenMetadata.movingEndpoints type from Set<InetAddress> to 
Set<Pair<Token, InetAddress>> which will allow us to store token where nodes is 
moving.

2. In StorageService.handleStateMoving store both new token and InetAddress of 
the moving node.

3. Add following code to calculatePendingRanges(AbstractReplicationStrategy, 
String) after bootstrapToken ranges calculation to track pending ranges of the 
moving nodes (almost the same code as for bootstrapping nodes):
{code}
for (Pair<Token, InetAddress> moving : allLeftMetadata.getMovingEndpoints())
{
   InetAddress endpoint = moving.right; // address of the moving node

   // moving.left is a new token of the endpoint
   allLeftMetadata.updateNormalToken(moving.left, endpoint);

   for (Range range : strategy.getAddressRanges(allLeftMetadata).get(endpoint))
   {
       pendingRanges.put(range, endpoint);
   }

   allLeftMetadata.removeEndpoint(endpoint);
}
{code}

What do you think?

> Optimize loadbalance/move for moves within the current range
> ------------------------------------------------------------
>
>                 Key: CASSANDRA-1427
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1427
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: Core
>    Affects Versions: 0.7 beta 1
>            Reporter: Nick Bailey
>            Assignee: Pavel Yaskevich
>             Fix For: 0.8
>
>         Attachments: CASSANDRA-1427-v2.patch, CASSANDRA-1427.patch
>
>   Original Estimate: 42h
>          Time Spent: 42h
>  Remaining Estimate: 0h
>
> Currently our move/loadbalance operations only implement case 2 of the Ruhl 
> algorithm described at 
> https://issues.apache.org/jira/browse/CASSANDRA-192#action_12713079.
> We should add functionality to optimize moves that take/give ranges to a 
> node's direct neighbors.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to