Bug 1304963

Summary: [GlusterD]: After log rotate of cmd_history.log file, the next executed gluster commands are not present in the cmd_history.log file.
Product: [Community] GlusterFS Reporter: Gaurav Kumar Garg <ggarg>
Component: glusterdAssignee: Gaurav Kumar Garg <ggarg>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.7.0CC: amukherj, bsrirama, bugs, ggarg, nlevinki, sasundar, smohan, vbellur
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: glusterd
Fixed In Version: glusterfs-3.7.9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1286959 Environment:
Last Closed: 2016-04-19 06:58:43 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: 1286959    
Bug Blocks: 1276219, 1318376    

Comment 1 Vijay Bellur 2016-02-05 05:54:28 UTC
REVIEW: http://review.gluster.org/13361 (libglusterfs: close & open cmd_history.log on log rotate) posted (#1) for review on release-3.7 by Gaurav Kumar Garg (ggarg)

Comment 2 Vijay Bellur 2016-02-18 06:19:27 UTC
REVIEW: http://review.gluster.org/13361 (libglusterfs: close & open cmd_history.log on log rotate) posted (#2) for review on release-3.7 by Gaurav Kumar Garg (ggarg)

Comment 3 Vijay Bellur 2016-02-19 10:02:08 UTC
COMMIT: http://review.gluster.org/13361 committed in release-3.7 by Niels de Vos (ndevos) 
------
commit 6b308c41dc4eddbe8b2afece14ac6ab827bc54d3
Author: Gaurav Kumar Garg <garg.gaurav52>
Date:   Tue Dec 1 14:23:08 2015 +0530

    libglusterfs: close & open cmd_history.log on log rotate
    
    This patch is backport of: http://review.gluster.org/#/c/12832/
    
    Post log rotate, cmd_history.log is not refreshed (closed & opened back)
    due to which new commands still land up in the log rotated file.
    
    Fix is to close and open cmd_history.log file upon log rotation
    
    >> Change-Id: Ie6990c9d55b0afa544bc5c84de3db49ff4b1299b
    >> BUG: 1286959
    >> Signed-off-by: Gaurav Kumar Garg <ggarg>
    >> Reviewed-on: http://review.gluster.org/12832
    >> Smoke: Gluster Build System <jenkins.com>
    >> CentOS-regression: Gluster Build System <jenkins.com>
    >> Reviewed-by: Niels de Vos <ndevos>
    >> NetBSD-regression: NetBSD Build System <jenkins.org>
    (cherry picked from commit 8fdfa0c17cf492f39e675f7502596754f6e5aeb4)
    
    Change-Id: Ie6990c9d55b0afa544bc5c84de3db49ff4b1299b
    BUG: 1304963
    Signed-off-by: Gaurav Kumar Garg <ggarg>
    Reviewed-on: http://review.gluster.org/13361
    Smoke: Gluster Build System <jenkins.com>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.com>
    Reviewed-by: Niels de Vos <ndevos>

Comment 4 Vijay Bellur 2016-03-30 04:09:41 UTC
REVIEW: http://review.gluster.org/13847 (libglusterfs: open cmd_history log file with O_APPEND and O_WRONLY) posted (#1) for review on release-3.7 by Atin Mukherjee (amukherj)

Comment 5 Vijay Bellur 2016-03-30 14:40:55 UTC
REVIEW: http://review.gluster.org/13847 (libglusterfs: open cmd_history log file with O_APPEND and O_WRONLY) posted (#2) for review on release-3.7 by Niels de Vos (ndevos)

Comment 6 Vijay Bellur 2016-03-31 07:53:49 UTC
COMMIT: http://review.gluster.org/13847 committed in release-3.7 by Kaushal M (kaushal) 
------
commit 2cd5b752c1123095acff5ce57649393ab1de7aaf
Author: Atin Mukherjee <amukherj>
Date:   Mon Mar 28 10:49:43 2016 +0530

    libglusterfs: open cmd_history log file with O_APPEND and O_WRONLY
    
    Commit 8fdfa0c introduced a fix to ensure cmd_history file is log rotated
    properly. However with this fix fdopen() is called with mode "a" on a fd which
    was not opened with O_WRONLY & O_APPEND resulting into a fdopen() failure.
    
    Fix is to open cmd_history.log file with O_CREATE|O_WRONLY|O_APPEND mode
    
    Backport of commit 207289621f6c5b75bdb80aa14ddaf72efd5eb9b1:
    > Change-Id: I75ef350560aa6d5435c78c5fd83adfde1a73bfc3
    > BUG: 1286959
    > Signed-off-by: Atin Mukherjee <amukherj>
    > Reviewed-on: http://review.gluster.org/13829
    > Smoke: Gluster Build System <jenkins.com>
    > Reviewed-by: Niels de Vos <ndevos>
    > NetBSD-regression: NetBSD Build System <jenkins.org>
    > CentOS-regression: Gluster Build System <jenkins.com>
    
    Change-Id: I75ef350560aa6d5435c78c5fd83adfde1a73bfc3
    BUG: 1304963
    Signed-off-by: Atin Mukherjee <amukherj>
    Reviewed-on: http://review.gluster.org/13847
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Reviewed-by: Niels de Vos <ndevos>
    Smoke: Gluster Build System <jenkins.com>
    CentOS-regression: Gluster Build System <jenkins.com>

Comment 7 Kaushal 2016-04-19 06:58:43 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.10, please open a new bug report.

glusterfs-3.7.10 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-April/026164.html
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 8 Kaushal 2016-04-19 07:24:46 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.9, please open a new bug report.

glusterfs-3.7.9 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-March/025922.html
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user