You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/02/27 20:41:00 UTC

[jira] [Work logged] (AMQ-7407) Partitioning by queue/topic chooses incorrect target

     [ https://issues.apache.org/jira/browse/AMQ-7407?focusedWorklogId=394445&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-394445 ]

ASF GitHub Bot logged work on AMQ-7407:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Feb/20 20:40
            Start Date: 27/Feb/20 20:40
    Worklog Time Spent: 10m 
      Work Description: jbonofre commented on pull request #482: [AMQ-7407] Fix best target electionfor queue/topic partitioning
URL: https://github.com/apache/activemq/pull/482
 
 
   
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 394445)
    Remaining Estimate: 0h
            Time Spent: 10m

> Partitioning by queue/topic chooses incorrect target
> ----------------------------------------------------
>
>                 Key: AMQ-7407
>                 URL: https://issues.apache.org/jira/browse/AMQ-7407
>             Project: ActiveMQ
>          Issue Type: Bug
>            Reporter: Maksym Brodin
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>             Fix For: 5.16.0, 5.15.12
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> This code always returns the latest target, instead of the best target (with the largest score)
> [https://github.com/apache/activemq/blob/master/activemq-partition/src/main/java/org/apache/activemq/partition/PartitionBroker.java#L251]
>  
> {code:java}
> // The target with largest score wins..            
> if( !targetScores.isEmpty() ) {                
>    Target bestTarget = null;                
>    int bestScore=0;                
>    for (Map.Entry<Target, Score> entry : targetScores.entrySet()) {
>      if( entry.getValue().value > bestScore ) {
>         bestTarget = entry.getKey();                    
>      }
>    }
>    return bestTarget;
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)