Bug 1357760 - Geo-rep silently ignores config parser errors
Summary: Geo-rep silently ignores config parser errors
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: geo-replication
Version: 3.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Aravinda VK
QA Contact:
URL:
Whiteboard:
Depends On: 1349273
Blocks: 1357759
TreeView+ depends on / blocked
 
Reported: 2016-07-19 05:55 UTC by Aravinda VK
Modified: 2016-09-16 18:27 UTC (History)
1 user (show)

Fixed In Version: glusterfs-3.8.4
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1349273
Environment:
Last Closed: 2016-09-16 18:27:59 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Aravinda VK 2016-07-19 05:55:28 UTC
+++ This bug was initially created as a clone of Bug #1349273 +++

Description of problem:
If Session config or Template config not found, Geo-rep will silently ignore and causes other problems like wrong mount params, wrong paths etc.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Create Geo-rep session
2. Move Template config file and session config file from /var/lib/glusterd/geo-replication
3. Start Geo-replication

Actual results:
Geo-rep will not fail, but substitute wrong config values when used. 
(We can observe wrong Mount parameters, ps -ax | grep gsyncd | grep glusterfs)

Expected results:
Geo-rep should go to Faulty if unable to read config file.

--- Additional comment from Vijay Bellur on 2016-06-23 02:41:14 EDT ---

REVIEW: http://review.gluster.org/14777 (geo-rep: Handle Config parser errors) posted (#1) for review on master by Aravinda VK (avishwan)

--- Additional comment from Vijay Bellur on 2016-06-23 05:32:25 EDT ---

REVIEW: http://review.gluster.org/14777 (geo-rep: Handle Config parser errors) posted (#2) for review on master by Aravinda VK (avishwan)

--- Additional comment from Vijay Bellur on 2016-07-11 03:12:59 EDT ---

REVIEW: http://review.gluster.org/14777 (geo-rep: Handle Config parser errors) posted (#3) for review on master by Aravinda VK (avishwan)

--- Additional comment from Vijay Bellur on 2016-07-12 08:09:44 EDT ---

COMMIT: http://review.gluster.org/14777 committed in master by Jeff Darcy (jdarcy) 
------
commit d94bf608b16b82f2c8f8588a96459cb746773b32
Author: Aravinda VK <avishwan>
Date:   Thu Jun 23 11:53:36 2016 +0530

    geo-rep: Handle Config parser errors
    
    Python ConfigParser lib has two methods, readfp and read, it should
    be used as follows.
    
        readfp(open("defaults.conf"))
        read("custom.conf")
    
    ConfigParser.read(path) ignores any file errors, which is intentional
    since errors are handled while loading default config.
    
    Geo-rep uses only one config file(Session config in Master side and
    Template config on Slave side) so we should use readfp to avoid
    skipping OS errors.
    
    config.read is retained in case of `--config-set-rx` where glusterd
    creates new template config file.
    
    BUG: 1349273
    Change-Id: I15a14d3743facd7b8c7af0edc70fdefaa43efd04
    Signed-off-by: Aravinda VK <avishwan>
    Reviewed-on: http://review.gluster.org/14777
    Smoke: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Jeff Darcy <jdarcy>

Comment 1 Vijay Bellur 2016-07-19 05:57:26 UTC
REVIEW: http://review.gluster.org/14947 (geo-rep: Handle Config parser errors) posted (#1) for review on release-3.8 by Aravinda VK (avishwan)

Comment 2 Vijay Bellur 2016-08-02 10:55:39 UTC
REVIEW: http://review.gluster.org/14947 (geo-rep: Handle Config parser errors) posted (#2) for review on release-3.8 by Aravinda VK (avishwan)

Comment 3 Vijay Bellur 2016-08-05 08:23:13 UTC
REVIEW: http://review.gluster.org/14947 (geo-rep: Handle Config parser errors) posted (#3) for review on release-3.8 by Aravinda VK (avishwan)

Comment 4 Worker Ant 2016-09-01 05:58:27 UTC
COMMIT: http://review.gluster.org/14947 committed in release-3.8 by Aravinda VK (avishwan) 
------
commit 26b4f38176d15f996b809511ce1adf5f0ea8234e
Author: Aravinda VK <avishwan>
Date:   Thu Jun 23 11:53:36 2016 +0530

    geo-rep: Handle Config parser errors
    
    Python ConfigParser lib has two methods, readfp and read, it should
    be used as follows.
    
        readfp(open("defaults.conf"))
        read("custom.conf")
    
    ConfigParser.read(path) ignores any file errors, which is intentional
    since errors are handled while loading default config.
    
    Geo-rep uses only one config file(Session config in Master side and
    Template config on Slave side) so we should use readfp to avoid
    skipping OS errors.
    
    config.read is retained in case of `--config-set-rx` where glusterd
    creates new template config file.
    
    > Signed-off-by: Aravinda VK <avishwan>
    > Reviewed-on: http://review.gluster.org/14777
    > Smoke: Gluster Build System <jenkins.org>
    > NetBSD-regression: NetBSD Build System <jenkins.org>
    > CentOS-regression: Gluster Build System <jenkins.org>
    > Reviewed-by: Jeff Darcy <jdarcy>
    
    (cherry picked from commit d94bf608b16b82f2c8f8588a96459cb746773b32)
    
    BUG: 1357760
    Change-Id: I15a14d3743facd7b8c7af0edc70fdefaa43efd04
    Signed-off-by: Aravinda VK <avishwan>
    Reviewed-on: http://review.gluster.org/14947
    CentOS-regression: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Smoke: Gluster Build System <jenkins.org>
    Reviewed-by: Atin Mukherjee <amukherj>

Comment 5 Niels de Vos 2016-09-12 05:39:03 UTC
All 3.8.x bugs are now reported against version 3.8 (without .x). For more information, see http://www.gluster.org/pipermail/gluster-devel/2016-September/050859.html

Comment 6 Niels de Vos 2016-09-16 18:27:59 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.8.4, please open a new bug report.

glusterfs-3.8.4 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/announce/2016-September/000060.html
[2] https://www.gluster.org/pipermail/gluster-users/


Note You need to log in before you can comment on or make changes to this bug.