+++ 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?
REVIEW: http://review.gluster.org/12597 (dht: changing variable type to avoid overflow) posted (#1) for review on master by Sakshi Bansal
@Sakshi, Please open up initial Description, or provide a summary of the initial description that is not private.
REVIEW: http://review.gluster.org/12597 (dht: changing variable type to avoid overflow) posted (#2) for review on master by Sakshi Bansal
REVIEW: http://review.gluster.org/12597 (dht: changing variable type to avoid overflow) posted (#3) for review on master by Sakshi Bansal
REVIEW: https://review.gluster.org/12597 (dht: changing variable type to avoid overflow) posted (#4) for review on master by Sakshi Bansal
REVIEW: http://review.gluster.org/12597 (dht: changing variable type to avoid overflow) posted (#5) for review on master by Sakshi Bansal
REVIEW: http://review.gluster.org/12597 (dht: changing variable type to avoid overflow) posted (#6) for review on master by Raghavendra G (rgowdapp)
REVIEW: http://review.gluster.org/12597 (dht : changing variable type to avoid overflow) posted (#7) for review on master by Sakshi Bansal
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>
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