Bug 1282751 - Large system file distribution is broken
Large system file distribution is broken
Status: CLOSED CURRENTRELEASE
Product: GlusterFS
Classification: Community
Component: distribute (Show other bugs)
mainline
All Linux
high Severity high
: ---
: ---
Assigned To: Sakshi
: ZStream
Depends On: 1281946
Blocks: 1294969
  Show dependency treegraph
 
Reported: 2015-11-17 05:36 EST by Sakshi
Modified: 2016-07-31 21:22 EDT (History)
11 users (show)

See Also:
Fixed In Version: glusterfs-3.8rc2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1281946
: 1294969 (view as bug list)
Environment:
Last Closed: 2016-06-16 09:44:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sakshi 2015-11-17 05:36:00 EST
+++ 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?
Comment 1 Vijay Bellur 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
Comment 2 Shyamsundar 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.
Comment 3 Vijay Bellur 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
Comment 4 Vijay Bellur 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
Comment 5 Vijay Bellur 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
Comment 6 Vijay Bellur 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
Comment 7 Vijay Bellur 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@redhat.com)
Comment 8 Vijay Bellur 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
Comment 9 Vijay Bellur 2015-11-27 00:04:31 EST
COMMIT: http://review.gluster.org/12597 committed in master by Raghavendra G (rgowdapp@redhat.com) 
------
commit 6b315b87d80cf681b976d78b444c761fc3a1caa7
Author: Sakshi Bansal <sabansal@redhat.com>
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@redhat.com>
    Reviewed-on: http://review.gluster.org/12597
    Reviewed-by: Susant Palai <spalai@redhat.com>
    Tested-by: NetBSD Build System <jenkins@build.gluster.org>
    Tested-by: Gluster Build System <jenkins@build.gluster.com>
    Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Comment 10 Niels de Vos 2016-06-16 09:44:42 EDT
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.8.0, please open a new bug report.

glusterfs-3.8.0 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] http://blog.gluster.org/2016/06/glusterfs-3-8-released/
[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.