Bug 1294969 - Large system file distribution is broken
Summary: Large system file distribution is broken
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: distribute
Version: 3.7.7
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Raghavendra G
QA Contact:
URL:
Whiteboard:
Depends On: 1281946 1282751
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-31 11:08 UTC by Sakshi
Modified: 2016-08-01 01:22 UTC (History)
11 users (show)

Fixed In Version: glusterfs-3.7.7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1282751
Environment:
Last Closed: 2016-04-19 07:52:20 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Sakshi 2015-12-31 11:08:11 UTC
+++ This bug was initially created as a clone of Bug #1282751 +++

+++ This bug was initially created as a clone of Bug #1281946 +++


DHT layout computation uses a count of 1MB chunks to denote the size of a single brick. When totaling these chunks up the int32 value overflows, and causes incorrect chunk computation, giving rise to overflowing layout every few bricks (the above layout sort order would be slightly incorrect when viewed from DHT dev eyes, as it should be sorted based on subvolume name as it is a fresh layout).

The function being referred to where this overflow occurs is: dht_selfheal_layout_new_directory
 - total_size here overflows when adding chunks from each brick pair
 - hence chunk becomes a larger value, as a result we do not end up with disjoint layout ranges

To fix the issue, this computation needs to be fixed to handle total chunks beyond 32 bit integer. Looking at possible solutions here.


> 
> To fix the issue, this computation needs to be fixed to handle total chunks
> beyond 32 bit integer. Looking at possible solutions here.

Won't using an unsigned 64 bit type for variables total_size, chunks (and relevant variables) fix the issue? With 64 bit, we can handle around 17179869184.0 PB, which should be sufficient.

Currently the max size is 0xffffffff. With the increase in the total size would be need to increase the maz size as well?

--- Additional comment from Vijay Bellur on 2015-11-17 05:45:46 EST ---

REVIEW: http://review.gluster.org/12597 (dht: changing variable type to avoid overflow) posted (#1) for review on master by Sakshi Bansal

--- Additional comment from Shyamsundar on 2015-11-17 10:26:51 EST ---

@Sakshi, Please open up initial Description, or provide a summary of the initial description that is not private.

--- Additional comment from Vijay Bellur on 2015-11-17 13:20:19 EST ---

REVIEW: http://review.gluster.org/12597 (dht: changing variable type to avoid overflow) posted (#2) for review on master by Sakshi Bansal

--- Additional comment from Vijay Bellur on 2015-11-17 23:42:54 EST ---

REVIEW: http://review.gluster.org/12597 (dht: changing variable type to avoid overflow) posted (#3) for review on master by Sakshi Bansal

--- Additional comment from Vijay Bellur on 2015-11-18 04:16:18 EST ---

REVIEW: https://review.gluster.org/12597 (dht: changing variable type to avoid overflow) posted (#4) for review on master by Sakshi Bansal

--- Additional comment from Vijay Bellur on 2015-11-18 05:54:16 EST ---

REVIEW: http://review.gluster.org/12597 (dht: changing variable type to avoid overflow) posted (#5) for review on master by Sakshi Bansal

--- Additional comment from Vijay Bellur on 2015-11-23 05:20:24 EST ---

REVIEW: http://review.gluster.org/12597 (dht: changing variable type to avoid overflow) posted (#6) for review on master by Raghavendra G (rgowdapp)

--- Additional comment from Vijay Bellur on 2015-11-26 10:59:04 EST ---

REVIEW: http://review.gluster.org/12597 (dht : changing variable type to avoid overflow) posted (#7) for review on master by Sakshi Bansal

--- Additional comment from Vijay Bellur on 2015-11-27 00:04:31 EST ---

COMMIT: http://review.gluster.org/12597 committed in master by Raghavendra G (rgowdapp) 
------
commit 6b315b87d80cf681b976d78b444c761fc3a1caa7
Author: Sakshi Bansal <sabansal>
Date:   Tue Nov 17 15:11:40 2015 +0530

    dht : changing variable type to avoid overflow
    
    For layout computation we find total size of the cluster
    and store it in an unsigned 32 bit variable. For large
    clusters this value may overflow which leads to wrong
    computations and for some bricks the layout may overflow.
    Hence using unsigned 64 bit to handle large values.
    
    Change-Id: I7c3ba26ea2c4158065ea9e74705a7ede1b6759c7
    BUG: 1282751
    Signed-off-by: Sakshi Bansal <sabansal>
    Reviewed-on: http://review.gluster.org/12597
    Reviewed-by: Susant Palai <spalai>
    Tested-by: NetBSD Build System <jenkins.org>
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Raghavendra G <rgowdapp>

Comment 1 Vijay Bellur 2015-12-31 11:18:33 UTC
REVIEW: http://review.gluster.org/13127 (dht : changing variable type to avoid overflow) posted (#1) for review on release-3.7 by Sakshi Bansal

Comment 2 Vijay Bellur 2016-01-04 07:27:24 UTC
REVIEW: http://review.gluster.org/13127 (dht : changing variable type to avoid overflow) posted (#2) for review on release-3.7 by Raghavendra G (rgowdapp)

Comment 3 Vijay Bellur 2016-01-23 05:19:54 UTC
REVIEW: http://review.gluster.org/13127 (dht : changing variable type to avoid overflow) posted (#3) for review on release-3.7 by Pranith Kumar Karampuri (pkarampu)

Comment 4 Vijay Bellur 2016-01-27 02:45:27 UTC
REVIEW: http://review.gluster.org/13127 (dht : changing variable type to avoid overflow) posted (#4) for review on release-3.7 by Pranith Kumar Karampuri (pkarampu)

Comment 5 Vijay Bellur 2016-01-28 14:18:47 UTC
REVIEW: http://review.gluster.org/13127 (dht : changing variable type to avoid overflow) posted (#5) for review on release-3.7 by Pranith Kumar Karampuri (pkarampu)

Comment 6 Vijay Bellur 2016-01-29 08:42:58 UTC
COMMIT: http://review.gluster.org/13127 committed in release-3.7 by Pranith Kumar Karampuri (pkarampu) 
------
commit 93a7c2a0c36a2ac21c6fff23cb30d6ca784a7995
Author: Sakshi Bansal <sabansal>
Date:   Tue Nov 17 15:11:40 2015 +0530

    dht : changing variable type to avoid overflow
    
    For layout computation we find total size of the cluster
    and store it in an unsigned 32 bit variable. For large
    clusters this value may overflow which leads to wrong
    computations and for some bricks the layout may overflow.
    Hence using unsigned 64 bit to handle large values.
    
    > Backport of http://review.gluster.org/12597
    
    > Change-Id: I7c3ba26ea2c4158065ea9e74705a7ede1b6759c7
    > BUG: 1282751
    > Signed-off-by: Sakshi Bansal <sabansal>
    > Reviewed-on: http://review.gluster.org/12597
    > Reviewed-by: Susant Palai <spalai>
    > Tested-by: NetBSD Build System <jenkins.org>
    > Tested-by: Gluster Build System <jenkins.com>
    > Reviewed-by: Raghavendra G <rgowdapp>
    
    BUG: 1294969
    Change-Id: Ia66587c6ae4aa3a25b3ac73920b514c1d3c4c2cb
    Signed-off-by: Sakshi Bansal <sabansal>
    Reviewed-on: http://review.gluster.org/13127
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>
    Tested-by: Pranith Kumar Karampuri <pkarampu>
    Smoke: Gluster Build System <jenkins.com>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.com>

Comment 7 Kaushal 2016-04-19 07:52:20 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.7, please open a new bug report.

glusterfs-3.7.7 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] https://www.gluster.org/pipermail/gluster-users/2016-February/025292.html
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user


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