Description of problem: In the virt-store use case, on a sharded volume the size of what is supposed to be a 15G image was observed to have grown to 17G (subsequently 21G) as seen on the mount point, as and when IO was performed within the VM's /home directory, On inspecting the file copy on the brick(s), the trusted.glusterfs.shard.file-size was found to match the size presented in the ls -lh output on the mount point. This means that something went wrong in the accounting of file size by the sharding translator. On reading code, I figured this is due to the fact that in inode write fops (particularly writev), shard translator counts the change in size by calculating the difference between the postbuf.ia_size and prebuf.ia_size for each shard where a write() was done, eventually adding up the deltas of all shards that participated in this write and incrementing the size xattr by that amount. But if the writes are on hole regions (which means the participant shard lies somewhere within the actual file size boundary) then there is no need to add its change in size to the size xattr. In other words, the deltas need to be taken into account only for writes that cross the current file size boundary. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
REVIEW: http://review.gluster.org/12017 (mgmt/glusterd: Add strict-write-ordering option to CLI) posted (#1) for review on master by Pranith Kumar Karampuri (pkarampu)
REVIEW: http://review.gluster.org/12017 (mgmt/glusterd: Add strict-write-ordering option to cli) posted (#2) for review on master by Krutika Dhananjay (kdhananj)
REVIEW: http://review.gluster.org/12020 (features/shard: Fix size update for writes at hole region) posted (#1) for review on master by Krutika Dhananjay (kdhananj)
REVIEW: http://review.gluster.org/12020 (features/shard: Fix size update for writes at hole region) posted (#2) for review on master by Krutika Dhananjay (kdhananj)
REVIEW: http://review.gluster.org/12020 (features/shard: Fix size update for writes at hole region) posted (#3) for review on master by Krutika Dhananjay (kdhananj)
REVIEW: http://review.gluster.org/12020 (features/shard: Fix size update for writes at hole region) posted (#4) for review on master by Krutika Dhananjay (kdhananj)
COMMIT: http://review.gluster.org/12020 committed in master by Pranith Kumar Karampuri (pkarampu) ------ commit d304916ddf3d6848787c3a668cc36e3395b32069 Author: Krutika Dhananjay <kdhananj> Date: Wed Aug 26 09:27:42 2015 +0530 features/shard: Fix size update for writes at hole region Change-Id: Iceccef8f3f466c7ffb9991f8eb248b81e7b80efb BUG: 1256580 Signed-off-by: Krutika Dhananjay <kdhananj> Reviewed-on: http://review.gluster.org/12020 Tested-by: NetBSD Build System <jenkins.org> Tested-by: Gluster Build System <jenkins.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu>
Fix for this BZ is already present in a GlusterFS release. You can find clone of this BZ, fixed in a GlusterFS release and closed. Hence closing this mainline BZ as well.
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