Bug 1098093

Summary: [SNAPSHOT]: setting the -ve values in snapshot config should result in proper message
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Rahul Hinduja <rhinduja>
Component: snapshotAssignee: Nagaprasad Sathyanarayana <nsathyan>
Status: CLOSED ERRATA QA Contact: Rahul Hinduja <rhinduja>
Severity: low Docs Contact:
Priority: low    
Version: rhgs-3.0CC: asengupt, nsathyan, rhs-bugs, rjoseph, senaik, smohan, storage-qa-internal, vagarwal
Target Milestone: ---   
Target Release: RHGS 3.1.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: SNAPSHOT
Fixed In Version: glusterfs-3.7.0-3.el6rhs Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-29 04:31:40 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:    
Bug Blocks: 1084409, 1202842, 1223636    

Description Rahul Hinduja 2014-05-15 09:54:07 UTC
Description of problem:
=======================

When we set a negative(-ve) value of snapshot config snap-max-soft-limit or snap-max-hard-limit for example(-110 OR -5), the output shows that the value can not be set to greater than 100. Mathematically -110 < 100 , the message should be corrected to reflect that the -ve values are not allowed, or only positive integer is allowed, or the best would be to show the range (min-max).

For example:
============

[root@snapshot09 ~]# gluster snapshot config snap-max-soft-limit -110
snap-max-soft-limit value cannot be more than 100
Usage: snapshot config [volname] [snap-max-hard-limit <count>] [snap-max-soft-limit <percent>]
[root@snapshot09 ~]# gluster snapshot config snap-max-hard-limit -257
snap-max-hard-limit value cannot be more than 256
Usage: snapshot config [volname] [snap-max-hard-limit <count>] [snap-max-soft-limit <percent>]
[root@snapshot09 ~]# 


[root@snapshot09 ~]# gluster snapshot config snap-max-soft-limit -5
snap-max-soft-limit value cannot be more than 100
Usage: snapshot config [volname] [snap-max-hard-limit <count>] [snap-max-soft-limit <percent>]
[root@snapshot09 ~]# gluster snapshot config snap-max-hard-limit -5
snap-max-hard-limit value cannot be more than 256
Usage: snapshot config [volname] [snap-max-hard-limit <count>] [snap-max-soft-limit <percent>]
[root@snapshot09 ~]# 


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

glusterfs-3.6.0.1-1.el6rhs.x86_64


How reproducible:
=================
5/5


Steps to Reproduce:
===================
1. Set the snap-max-soft-limit to -5
2. Set the snap-max-hard-limit to -5


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

[root@snapshot09 ~]# gluster snapshot config snap-max-soft-limit -5
snap-max-soft-limit value cannot be more than 100
Usage: snapshot config [volname] [snap-max-hard-limit <count>] [snap-max-soft-limit <percent>]
[root@snapshot09 ~]# gluster snapshot config snap-max-hard-limit -5
snap-max-hard-limit value cannot be more than 256
Usage: snapshot config [volname] [snap-max-hard-limit <count>] [snap-max-soft-limit <percent>]
[root@snapshot09 ~]# 


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

The message should be corrected to reflect that the -ve values are not allowed, or only positive integer is allowed, or the best would be to show the range (min-max).

Comment 2 Sachin Pandit 2014-05-23 05:03:26 UTC
A patch which fixes this bug has been posted upstream.

Comment 6 senaik 2015-06-11 14:04:04 UTC
Version : glusterfs-3.7.1-1.el6rhs.x86_64

 gluster snapshot config vol0 snap-max-hard-limit -5
Please enter an integer value greater than zero for snap-max-hard-limit
Usage: snapshot config [volname] ([snap-max-hard-limit <count>] [snap-max-soft-limit <percent>]) | ([auto-delete <enable|disable>])| ([activate-on-create <enable|disable>])

gluster snapshot config snap-max-soft-limit -5
Please enter an integer value greater than zero for snap-max-soft-limit
Usage: snapshot config [volname] ([snap-max-hard-limit <count>] [snap-max-soft-limit <percent>]) | ([auto-delete <enable|disable>])| ([activate-on-create <enable|disable>])

gluster snapshot config snap-max-hard-limit -5
Please enter an integer value greater than zero for snap-max-hard-limit
Usage: snapshot config [volname] ([snap-max-hard-limit <count>] [snap-max-soft-limit <percent>]) | ([auto-delete <enable|disable>])| ([activate-on-create <enable|disable>])

Marking the bug 'Verified'

Comment 9 errata-xmlrpc 2015-07-29 04:31:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-1495.html