Bug 1114015

Summary: [SNAPSHOT]: setting config valuses doesn't delete the already created snapshots,but wrongly warns the user that it might delete
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Rahul Hinduja <rhinduja>
Component: snapshotAssignee: Joseph Elwin Fernandes <josferna>
Status: CLOSED ERRATA QA Contact: Rahul Hinduja <rhinduja>
Severity: low Docs Contact:
Priority: medium    
Version: rhgs-3.0CC: asengupt, asriram, josferna, rhs-bugs, rjoseph, sankarshan, senaik, 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:
: 1116263 (view as bug list) Environment:
Last Closed: 2015-07-29 04:32:56 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: 1087818, 1116263, 1202842, 1223636    

Description Rahul Hinduja 2014-06-27 13:03:39 UTC
Description of problem:
=======================

When a snapshot config values are changed than we are currently warning a user that it might delete the already created snapshots if they exceed the new limit. This is not a correct behaviour we are not deleting snapshots with the change in config.

[root@snapshot13 ~]# gluster snapshot list
snap3
snap4
test
test1
[root@snapshot13 ~]# gluster snapshot config snap-max-hard-limit 3
Changing snapshot-max-hard-limit will lead to deletion of snapshots if they exceed the new limit.
Do you want to continue? (y/n) y
snapshot config: System for snap-max-hard-limit set successfully
[root@snapshot13 ~]# gluster snapshot list
snap3
snap4
test
test1
[root@snapshot13 ~]# gluster snapshot config 

Snapshot System Configuration:
snap-max-hard-limit : 3
snap-max-soft-limit : 20%
auto-delete : disable

Snapshot Volume Configuration:

Volume : vol0
snap-max-hard-limit : 256
Effective snap-max-hard-limit : 3
Effective snap-max-soft-limit : 0 (20%)

Volume : vol2
snap-max-hard-limit : 256
Effective snap-max-hard-limit : 3
Effective snap-max-soft-limit : 0 (20%)

Volume : vol4
snap-max-hard-limit : 256
Effective snap-max-hard-limit : 3
Effective snap-max-soft-limit : 0 (20%)
[root@snapshot13 ~]# 



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

glusterfs-3.6.0.22-1.el6rhs.x86_64



How reproducible:
=================
1/1


Steps to Reproduce:
===================
1. Change a config value to lesser than already created snaps


Actual results:
===============
[root@snapshot13 ~]# gluster snapshot config snap-max-hard-limit 3
Changing snapshot-max-hard-limit will lead to deletion of snapshots if they exceed the new limit.
Do you want to continue? (y/n) y
snapshot config: System for snap-max-hard-limit set successfully
[root@snapshot13 ~]#


Expected results:
=================
It should not warn a user because it doesn't actually delete the snaps

Comment 2 Joseph Elwin Fernandes 2014-07-04 06:24:28 UTC
Upstream patch

REVIEW: http://review.gluster.org/8236 (glusterd/snapshot: Fix CLI msg for snap limit set) posted (#1) for review on master by Joseph Fernandes (josferna)

Comment 4 senaik 2015-06-23 07:52:33 UTC
Version : glusterfs-3.7.1-4.el6rhs.x86_64

Changing  the config value to less than already created snapshots does not warn the user that it might delete the already created snapshots if they exceed the new limit. 
It prints the below message : Changing snapshot-max-hard-limit will limit the creation of new snapshots if they exceed the new limit.

1) create 8 snapshots for volume 
gluster snapshot list vol1 
S1_GMT-2015.06.23-07.43.54
S2_GMT-2015.06.23-07.44.05
S3_GMT-2015.06.23-07.44.17
S1_GMT-2015.06.23-07.46.10
S2_GMT-2015.06.23-07.46.22
S3_GMT-2015.06.23-07.46.35
S4_GMT-2015.06.23-07.46.47
S5_GMT-2015.06.23-07.47.00

2) set snapshot hard limit to 3 
gluster snapshot config snap-max-hard-limit 3
Changing snapshot-max-hard-limit will limit the creation of new snapshots if they exceed the new limit.
Do you want to continue? (y/n) y
snapshot config: snap-max-hard-limit for System set successfully

[root@inception scripts]# gluster snapshot list vol1 
S1_GMT-2015.06.23-07.43.54
S2_GMT-2015.06.23-07.44.05
S3_GMT-2015.06.23-07.44.17
S1_GMT-2015.06.23-07.46.10
S2_GMT-2015.06.23-07.46.22
S3_GMT-2015.06.23-07.46.35
S4_GMT-2015.06.23-07.46.47
S5_GMT-2015.06.23-07.47.00

Marking the bug 'Verified'

Comment 6 errata-xmlrpc 2015-07-29 04:32:56 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