Bug 1601423

Summary: memory leak in get-state when geo-replication session is configured
Product: [Community] GlusterFS Reporter: Sanju <srakonde>
Component: glusterdAssignee: Sanju <srakonde>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: amukherj, aspandey, bmekala, bugs, rhs-bugs, sankarshan, sheggodu, storage-qa-internal, vbellur, vdas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-5.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1599362 Environment:
Last Closed: 2018-10-23 15:14:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1599362    
Bug Blocks:    

Comment 1 Worker Ant 2018-07-16 11:50:07 UTC
REVIEW: https://review.gluster.org/20521 (glusterd: memory leak in get-state) posted (#1) for review on master by Sanju Rakonde

Comment 2 Worker Ant 2018-07-18 14:08:58 UTC
COMMIT: https://review.gluster.org/20521 committed in master by "Atin Mukherjee" <amukherj> with a commit message- glusterd: memory leak in get-state

Problem: gluster get-state command is leaking the memory when
geo-replication session is configured.

Cause: In glusterd_print_gsync_status(), we are trying to get
reference to the keys of gsync_dict. The references to keys of
gsync_dict are stored status_vols[i]. status_vols[i] are
allocated with a memory of size of gf_gsync_status_t.

Solution: Need not to use a array of pointers(status_vals), using
a pointer to hold the reference to a key of gsync_dict is sufficient.

Followed the below steps for testing:
1. Configured geo-rep session
2. Ran gluster get-state command for 1000 times.

Without this patch, glusterd's memory was increasing significantly
(around 22000KB per 1000 times), with this patch it reduced (1500KB
per 1000 times)

fixes: bz#1601423
Change-Id: I361f5525d71f821bb345419ccfdc20ca288ca292
Signed-off-by: Sanju Rakonde <srakonde>

Comment 3 Shyamsundar 2018-10-23 15:14:36 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-5.0, please open a new bug report.

glusterfs-5.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] https://lists.gluster.org/pipermail/announce/2018-October/000115.html
[2] https://www.gluster.org/pipermail/gluster-users/