Bug 1221623 - glusterd: add brick command should re-use the port for listening which is freed by remove-brick.
Summary: glusterd: add brick command should re-use the port for listening which is fre...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: glusterd
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Atin Mukherjee
QA Contact: SATHEESARAN
URL:
Whiteboard:
Depends On:
Blocks: 1263090 1264290 1369766
TreeView+ depends on / blocked
 
Reported: 2015-05-14 12:59 UTC by Gaurav Kumar Garg
Modified: 2017-03-08 08:17 UTC (History)
3 users (show)

Fixed In Version: 3.10
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1263090 1369766 (view as bug list)
Environment:
Last Closed: 2017-03-08 08:17:40 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Gaurav Kumar Garg 2015-05-14 12:59:19 UTC
Description of problem:

If volume having 4 brick then listening port for that brick will be 49152-49155.
if user perform any remove-brick operation then one of the brick port from 49152-49155 will free (port on which user performing remove brick operation).
after this if user perform add-brick operation then glusterd will assign port after 49155, it is not reusing the port which is freed by remove-brick operation.


Version-Release number of selected component (if applicable):

Mainline

How reproducible:

Always 

Steps to Reproduce:
1. Create and start volume having 2 or more than 2 brick.
2. perform remove-brick operation on any brick.
3. execute gluster volume status command.
3. perform add-brick operation.
4. execute gluster volume status command.


you will see that the brick which you have recently added will use new port.



Actual results:

 brick which you have recently added will use new port

Expected results:

we should re-use the port which is free by remove-brick command.

Comment 1 Anand Avati 2015-05-14 13:06:27 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: newly added brick should use the port which is freed by remove-brick) posted (#1) for review on master by Gaurav Kumar Garg (ggarg)

Comment 2 Anand Avati 2015-05-15 13:54:15 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: newly added brick should use the port which is freed by remove-brick) posted (#2) for review on master by Gaurav Kumar Garg (ggarg)

Comment 3 Anand Avati 2015-08-11 13:13:37 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: newly added brick should use the port which is freed by remove-brick) posted (#3) for review on master by Gaurav Kumar Garg (ggarg)

Comment 4 Vijay Bellur 2015-09-11 08:35:05 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: newly added brick should use the port which is freed by remove-brick) posted (#4) for review on master by Gaurav Kumar Garg (ggarg)

Comment 5 Vijay Bellur 2015-09-18 07:03:16 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: newly added brick should use the port which is freed by remove-brick) posted (#5) for review on master by Gaurav Kumar Garg (ggarg)

Comment 6 Vijay Bellur 2016-03-17 08:27:07 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: newly added brick should use the port which is freed by remove-brick) posted (#6) for review on master by Gaurav Kumar Garg (ggarg)

Comment 7 Vijay Bellur 2016-03-22 05:58:16 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: allocate new port from base port instead of last allocated port) posted (#7) for review on master by Gaurav Kumar Garg (ggarg)

Comment 8 Vijay Bellur 2016-03-23 07:37:32 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: allocate new port from base port instead of last allocated port) posted (#8) for review on master by Gaurav Kumar Garg (ggarg)

Comment 9 Vijay Bellur 2016-03-28 03:52:25 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: reuse a freed up port in portmap) posted (#9) for review on master by Gaurav Kumar Garg (ggarg)

Comment 10 Mike McCune 2016-03-28 22:38:41 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 11 Vijay Bellur 2016-03-30 06:25:35 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: reuse a freed up port in portmap) posted (#10) for review on master by Gaurav Kumar Garg (ggarg)

Comment 12 Vijay Bellur 2016-04-01 10:19:19 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: reuse a freed up port in portmap) posted (#11) for review on master by Gaurav Kumar Garg (ggarg)

Comment 13 Vijay Bellur 2016-04-01 11:05:35 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: reuse a freed up port in portmap) posted (#12) for review on master by Gaurav Kumar Garg (ggarg)

Comment 14 Vijay Bellur 2016-04-04 07:01:35 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: reuse a freed up port in portmap) posted (#13) for review on master by Gaurav Kumar Garg (ggarg)

Comment 15 Vijay Bellur 2016-04-04 09:45:20 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: reuse a freed up port in portmap) posted (#14) for review on master by Gaurav Kumar Garg (ggarg)

Comment 16 Vijay Bellur 2016-04-04 12:45:31 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: reuse a freed up port in portmap) posted (#15) for review on master by Gaurav Kumar Garg (ggarg)

Comment 17 Vijay Bellur 2016-04-07 08:47:51 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: reuse a freed up port in portmap) posted (#16) for review on master by Gaurav Kumar Garg (ggarg)

Comment 18 Vijay Bellur 2016-04-07 08:50:06 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: reuse a freed up port in portmap) posted (#17) for review on master by Gaurav Kumar Garg (ggarg)

Comment 19 Vijay Bellur 2016-04-19 14:55:23 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: reuse a freed up port in portmap) posted (#18) for review on master by Atin Mukherjee (amukherj)

Comment 20 Vijay Bellur 2016-04-19 20:18:31 UTC
REVIEW: http://review.gluster.org/10785 (glusterd: reuse a freed up port from portmap table) posted (#19) for review on master by Atin Mukherjee (amukherj)

Comment 23 Vijay Bellur 2016-07-18 12:31:07 UTC
REVIEW: http://review.gluster.org/14939 (glusterd: search for free port from base_port) posted (#2) for review on master by Atin Mukherjee (amukherj)

Comment 24 Vijay Bellur 2016-07-18 12:56:02 UTC
COMMIT: http://review.gluster.org/14939 committed in master by Jeff Darcy (jdarcy) 
------
commit 7abed939a7cc61880aed7547f12ace80e6128170
Author: Atin Mukherjee <amukherj>
Date:   Mon Jul 18 12:54:38 2016 +0530

    glusterd: search for free port from base_port
    
    When a volume is deleted, the freed up ports are never considered for further
    allocation since pmap_registry_alloc () always starts scanning from last_alloc.
    So in use cases where gluster volumes are frequently created and deleted
    managing ports become nightmare as for every new volume creation ports need to
    be opened up by the admin based on the volume topology.
    
    Solution: Instead of scanning from last_alloc, pmap_registry_alloc () always
    starts from base_port now. What that means is glusterd will always try to find
    out the ports which have been freed from earlier volumes and reallocate them for
    the newer ones. There could be possibilities that when a volume is stopped and
    started back their brick ports are changed which is completely acceptible IMHO.
    
    Change-Id: I99ccc11732b6a75527fcb6abafaf249ed02b3b78
    BUG: 1221623
    Signed-off-by: Atin Mukherjee <amukherj>
    Reviewed-on: http://review.gluster.org/14939
    CentOS-regression: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Reviewed-by: Jeff Darcy <jdarcy>
    Smoke: Gluster Build System <jenkins.org>

Comment 25 Atin Mukherjee 2016-07-26 11:27:31 UTC
We'd need one more patch to get this issue completely resolved. Moving this bug to POST state.

Comment 26 Vijay Bellur 2016-07-26 11:28:20 UTC
REVIEW: http://review.gluster.org/15005 (glusterd: Mark brick port leased before starting the bricks) posted (#2) for review on master by Atin Mukherjee (amukherj)

Comment 27 Vijay Bellur 2016-07-26 11:29:16 UTC
REVIEW: http://review.gluster.org/15005 (glusterd: Mark brick port leased before starting the bricks) posted (#3) for review on master by Atin Mukherjee (amukherj)

Comment 28 Vijay Bellur 2016-07-26 12:56:20 UTC
REVIEW: http://review.gluster.org/15005 (glusterd: Mark brick port leased before starting the bricks) posted (#4) for review on master by Atin Mukherjee (amukherj)

Comment 29 Vijay Bellur 2016-07-26 14:02:16 UTC
REVIEW: http://review.gluster.org/15005 (glusterd: Mark brick port leased before starting the bricks) posted (#5) for review on master by Atin Mukherjee (amukherj)

Comment 30 Vijay Bellur 2016-07-26 14:02:53 UTC
REVIEW: http://review.gluster.org/15005 (glusterd: Mark brick port leased before starting the bricks) posted (#6) for review on master by Atin Mukherjee (amukherj)

Comment 31 Vijay Bellur 2016-07-27 13:43:16 UTC
REVIEW: http://review.gluster.org/15005 (glusterd: clean up old port and allocate new one on every restart) posted (#7) for review on master by Atin Mukherjee (amukherj)

Comment 32 Vijay Bellur 2016-07-28 04:37:33 UTC
REVIEW: http://review.gluster.org/15005 (glusterd: clean up old port and allocate new one on every restart) posted (#8) for review on master by Atin Mukherjee (amukherj)

Comment 33 Vijay Bellur 2016-08-04 04:43:38 UTC
COMMIT: http://review.gluster.org/15005 committed in master by Atin Mukherjee (amukherj) 
------
commit c3dee6d35326c6495591eb5bbf7f52f64031e2c4
Author: Atin Mukherjee <amukherj>
Date:   Mon Jul 25 19:09:08 2016 +0530

    glusterd: clean up old port and allocate new one on every restart
    
    GlusterD as of now was blindly assuming that the brick port which was already
    allocated would be available to be reused and that assumption is absolutely
    wrong.
    
    Solution : On first attempt, we thought GlusterD should check if the already
    allocated brick ports are free, if not allocate new port and pass it to the
    daemon. But with that approach there is a possibility that if PMAP_SIGNOUT is
    missed out, the stale port will be given back to the clients where connection
    will keep on failing. Now given the port allocation always start from base_port,
    if everytime a new port has to be allocated for the daemons, the port range will
    still be under control. So this fix tries to clean up old port using
    pmap_registry_remove () if any and then goes for pmap_registry_alloc ()
    
    Change-Id: If54a055d01ab0cbc06589dc1191d8fc52eb2c84f
    BUG: 1221623
    Signed-off-by: Atin Mukherjee <amukherj>
    Reviewed-on: http://review.gluster.org/15005
    Smoke: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Avra Sengupta <asengupt>


Note You need to log in before you can comment on or make changes to this bug.