You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by ganeshmurthy <gi...@git.apache.org> on 2016/05/13 20:13:02 UTC

[GitHub] qpid-dispatch pull request: DISPATCH-335 - Added code to balance l...

GitHub user ganeshmurthy opened a pull request:

    https://github.com/apache/qpid-dispatch/pull/74

    DISPATCH-335 - Added code to balance link routes over remote routers

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ganeshmurthy/qpid-dispatch DISPATCH-335

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/qpid-dispatch/pull/74.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #74
    
----
commit 45e0f7723bf46dfaa1ff299ffd0943368e970fd6
Author: Ganesh Murthy <gm...@redhat.com>
Date:   2016-05-13T20:11:48Z

    DISPATCH-335 - Added code to balance link routes over remote routers

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] qpid-dispatch pull request: DISPATCH-335 - Added code to balance l...

Posted by ted-ross <gi...@git.apache.org>.
Github user ted-ross commented on a diff in the pull request:

    https://github.com/apache/qpid-dispatch/pull/74#discussion_r63245326
  
    --- Diff: src/router_core/forwarder.c ---
    @@ -559,20 +559,34 @@ bool qdr_forward_link_balanced_CT(qdr_core_t     *core,
             //
             // Look for a next-hop we can use to forward the link-attach.
             //
    -        int         router_bit;
             qdr_node_t *next_node;
     
    -        if (qd_bitmask_first_set(addr->rnodes, &router_bit)) {
    -            qdr_node_t *rnode = core->routers_by_mask_bit[router_bit];
    -            if (rnode) {
    -                if (rnode->next_hop)
    -                    next_node = rnode->next_hop;
    -                else
    -                    next_node = rnode;
    +        if (addr->cost_epoch != core->cost_epoch) {
    +            addr->next_remote = -1;
    +            addr->cost_epoch  = core->cost_epoch;
    +        }
     
    -                if (next_node && next_node->peer_data_link)
    -                    conn = next_node->peer_data_link->conn;
    -            }
    +        if (addr->next_remote < 0) {
    +            qd_bitmask_first_set(addr->rnodes, &addr->next_remote);
    --- End diff --
    
    You removed the check of the return value of qd_bitmask_first_set.  If there is no bit set in the mask, bad things will happen.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] qpid-dispatch pull request: DISPATCH-335 - Added code to balance l...

Posted by ganeshmurthy <gi...@git.apache.org>.
Github user ganeshmurthy commented on a diff in the pull request:

    https://github.com/apache/qpid-dispatch/pull/74#discussion_r63246808
  
    --- Diff: src/router_core/forwarder.c ---
    @@ -559,20 +559,34 @@ bool qdr_forward_link_balanced_CT(qdr_core_t     *core,
             //
             // Look for a next-hop we can use to forward the link-attach.
             //
    -        int         router_bit;
             qdr_node_t *next_node;
     
    -        if (qd_bitmask_first_set(addr->rnodes, &router_bit)) {
    -            qdr_node_t *rnode = core->routers_by_mask_bit[router_bit];
    -            if (rnode) {
    -                if (rnode->next_hop)
    -                    next_node = rnode->next_hop;
    -                else
    -                    next_node = rnode;
    +        if (addr->cost_epoch != core->cost_epoch) {
    +            addr->next_remote = -1;
    +            addr->cost_epoch  = core->cost_epoch;
    +        }
     
    -                if (next_node && next_node->peer_data_link)
    -                    conn = next_node->peer_data_link->conn;
    -            }
    +        if (addr->next_remote < 0) {
    +            qd_bitmask_first_set(addr->rnodes, &addr->next_remote);
    --- End diff --
    
    How about I check addr->next_remote >= 0 like below
    
            qdr_node_t *next_node;
    
            if (addr->cost_epoch != core->cost_epoch) {
                addr->next_remote = -1;
                addr->cost_epoch  = core->cost_epoch;
            }
    
            if (addr->next_remote < 0) {
                qd_bitmask_first_set(addr->rnodes, &addr->next_remote);
            }
            
            if (addr->next_remote >= 0) {
    
                qdr_node_t *rnode = core->routers_by_mask_bit[addr->next_remote];
        
                if (rnode) {
                    //
                    // Advance the addr->next_remote so there will be link balance across containers
                    //
                    _qdbm_next(addr->rnodes, &addr->next_remote);
                    if (addr->next_remote == -1)
                        qd_bitmask_first_set(addr->rnodes, &addr->next_remote);
        
                    if (rnode->next_hop)
                        next_node = rnode->next_hop;
                    else
                        next_node = rnode;
        
                    if (next_node && next_node->peer_data_link)
                        conn = next_node->peer_data_link->conn;
                }
            }


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] qpid-dispatch pull request: DISPATCH-335 - Added code to balance l...

Posted by ganeshmurthy <gi...@git.apache.org>.
Github user ganeshmurthy closed the pull request at:

    https://github.com/apache/qpid-dispatch/pull/74


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org