Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1087203

Summary: [SNAPSHOT]: gluster snapshot config should only accept the decimal numeric value
Product: [Community] GlusterFS Reporter: Sachin Pandit <spandit>
Component: glusterdAssignee: Sachin Pandit <spandit>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs, gluster-bugs, nsathyan, rhinduja, spandit, vbellur
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: SNAPSHOT
Fixed In Version: glusterfs-3.6.0beta1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1084413 Environment:
Last Closed: 2014-11-11 08:29:58 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: 1084413    
Bug Blocks:    

Comment 1 Sachin Pandit 2014-04-15 06:55:29 UTC
Snapshot config has few more minor issues, which are listed below:

1) Output correction in gluster snapshot config snap-max-soft-limit

Actual results:
===============
[root@snapshot-09 ~]# gluster snapshot config snap-max-soft-limit 101
Changing snapshot-max-soft-limit will lead to deletion of snapshots if they exceed the new limit.
Do you want to continue? (y/n) y
Snapshot Config : failed: Invalid snap-max-soft-limit 0. Expected range 0 - 100
Snapshot command failed
[root@snapshot-09 ~]# 


Expected results:
=================

[root@snapshot-09 ~]# gluster snapshot config snap-max-soft-limit 101
Changing snapshot-max-soft-limit will lead to deletion of snapshots if they exceed the new limit.
Do you want to continue? (y/n) y
Snapshot Config : failed: Invalid snap-max-soft-limit 0. Expected range 1 - 100
Snapshot command failed
[root@snapshot-09 ~]#

------------------------------------------------------------------------------
------------------------------------------------------------------------------

2) Setting the config value to alphanumeric values should not be allowed.

Actual results:
===============
Config set is successful


Expected results:
=================
Config set should fail with proper message to use only numeric value.

-------------------------------------------------------------------------------
-------------------------------------------------------------------------------

3) setting the soft limit to greater than 100% displays that "Invalid snap-max-soft-limit 0"

Actual results:
===============

[root@snapshot-09 ~]# gluster snapshot config snap-max-soft-limit 110
Changing snapshot-max-soft-limit will lead to deletion of snapshots if they exceed the new limit.
Do you want to continue? (y/n) y
Snapshot Config : failed: Invalid snap-max-soft-limit 0. Expected range 0 - 100
Snapshot command failed


Expected results:
=================

[root@snapshot-09 ~]# gluster snapshot config snap-max-soft-limit 110
Changing snapshot-max-soft-limit will lead to deletion of snapshots if they exceed the new limit.
Do you want to continue? (y/n) y
Snapshot Config : failed: Invalid snap-max-soft-limit 110. Expected range 0 - 100
Snapshot command failed.

-------------------------------------------------------------------------------
-------------------------------------------------------------------------------

4) Setting greater than allowed snap-max-hard-limit output needs to have space in between

Actual results:
===============
Snapshot Config : failed: Invalid snap-max-hard-limit300. Expected range 0 - 75

Expected results:
=================
Snapshot Config : failed: Invalid snap-max-hard-limit 300. Expected range 0 - 75

--------------------------------------------------------------------------------

Comment 2 Anand Avati 2014-04-15 07:18:08 UTC
REVIEW: http://review.gluster.org/7457 (snapshot/config : Fix for bug which states gluster snapshot config command should only accept the decimal numeric value.) posted (#3) for review on master by Sachin Pandit (spandit)

Comment 3 Anand Avati 2014-04-22 16:27:15 UTC
REVIEW: http://review.gluster.org/7457 (snapshot/config : Fix for bug which states gluster snapshot config command should only accept the decimal numeric value.) posted (#4) for review on master by Sachin Pandit (spandit)

Comment 4 Anand Avati 2014-04-22 16:46:33 UTC
REVIEW: http://review.gluster.org/7457 (snapshot/config : Fix for bug which states gluster snapshot config command should only accept the decimal numeric value.) posted (#5) for review on master by Sachin Pandit (spandit)

Comment 5 Anand Avati 2014-04-29 04:26:16 UTC
REVIEW: http://review.gluster.org/7457 (snapshot/config : Fix for bug which states gluster snapshot config command should only accept the decimal numeric value.) posted (#6) for review on master by Sachin Pandit (spandit)

Comment 6 Anand Avati 2014-04-29 07:19:26 UTC
REVIEW: http://review.gluster.org/7457 (snapshot/config : Fix for bug which states gluster snapshot config command should only accept the decimal numeric value.) posted (#7) for review on master by Sachin Pandit (spandit)

Comment 7 Anand Avati 2014-04-29 08:23:34 UTC
REVIEW: http://review.gluster.org/7457 (snapshot/config : Fix for bug which states gluster snapshot config command should only accept the decimal numeric value.) posted (#8) for review on master by Sachin Pandit (spandit)

Comment 8 Anand Avati 2014-04-30 05:02:09 UTC
COMMIT: http://review.gluster.org/7457 committed in master by Vijay Bellur (vbellur) 
------
commit e2034a84d284c37ade9f49be1589e3f53321bb23
Author: Sachin Pandit <spandit>
Date:   Thu Apr 3 10:00:04 2014 +0530

    snapshot/config : Fix for bug which states gluster snapshot config
    command should only accept the decimal numeric value.
    
    Syntax : gluster snapshot config [volname]
                                     [snap-max-hard-limit <count>]
                                     [snap-max-soft-limit <percentage>]
    
    Problem : Snapshot config used to consider the alphanumeric value
    staring with digit as an integer (Example: "9abc" is converted to "9").
    
    Solution : Refined the code to check if the entered value is numeric.
    
    This patch also fixes some of the minor problems related to snapshot
    config.
    1) Output correction in gluster snapshot config snap-max-soft-limit.
    2) setting the soft limit to greater than 100% displays that "Invalid
    snap-max-soft-limit 0". The error message used to display "zero" in
    the output, Changed this to display relevant value.
    3) Setting greater than allowed snap-max-hard-limit output needs to
    have space in between.
    
    Change-Id: Ie7c7045722fe57b2b3c50c873664b67c28eb3853
    BUG: 1087203
    Signed-off-by: Sachin Pandit <spandit>
    Reviewed-on: http://review.gluster.org/7457
    Reviewed-by: Vijaikumar Mallikarjuna <vmallika>
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Vijay Bellur <vbellur>

Comment 11 Niels de Vos 2014-09-22 12:38:04 UTC
A beta release for GlusterFS 3.6.0 has been released. Please verify if the release solves this bug report for you. In case the glusterfs-3.6.0beta1 release does not have a resolution for this issue, leave a comment in this bug and move the status to ASSIGNED. If this release fixes the problem for you, leave a note and change the status to VERIFIED.

Packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update (possibly an "updates-testing" repository) infrastructure for your distribution.

[1] http://supercolony.gluster.org/pipermail/gluster-users/2014-September/018836.html
[2] http://supercolony.gluster.org/pipermail/gluster-users/

Comment 12 Niels de Vos 2014-11-11 08:29:58 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.6.1, please reopen this bug report.

glusterfs-3.6.1 has been announced [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://supercolony.gluster.org/pipermail/gluster-users/2014-November/019410.html
[2] http://supercolony.gluster.org/mailman/listinfo/gluster-users