Description of problem: ======================= When we try to delete a non-existing snap, it should gracefully fail with error "does not exist". Currently it is failing as: [root@inception ~]# gluster snapshot delete snap1 Deleting snap will erase all the information about the snap. Do you still want to continue? (y/n) y snapshot delete: failed: snap snap1 might not be in an usable state. Snapshot command failed [root@inception ~]# This is a regression bug, it used to gracefully fail. The message "might not be in an usable state" only makes sense when a delete is started for an existing snap and for some reason delete fails to delete a snap and we print this message that "it might not be in an usable state", because we really dont know how much the back end clean-up has happened But, if we attempt to delete a snap which doesnt exist it should fail as: [root@inception ~]# gluster snapshot delete snap1 Deleting snap will erase all the information about the snap. Do you still want to continue? (y/n) y snapshot delete: failed: snap snap1 does not exist. Snapshot command failed [root@inception ~]# Version-Release number of selected component (if applicable): ============================================================= glusterfs-3.6.0.19-1.el6rhs.x86_64 How reproducible: ================= 1/1 Steps to Reproduce: =================== 1. gluster snapshot delete <non-existing-snap> Actual results: =============== [root@inception ~]# gluster snapshot delete snap1 Deleting snap will erase all the information about the snap. Do you still want to continue? (y/n) y snapshot delete: failed: snap snap1 might not be in an usable state. Snapshot command failed [root@inception ~]# Expected results: ================== [root@inception ~]# gluster snapshot delete snap1 Deleting snap will erase all the information about the snap. Do you still want to continue? (y/n) y snapshot delete: failed: snap snap1 does not exist. Snapshot command failed [root@inception ~]#
Version : glusterfs 3.6.0.20 built on Jun 19 2014 ======= While snapshots creation in progress on a volume , if snapshot delete is executed, instead of failing with "Another Transaction is in progress" it fails with "<snap_name> might not be in an usable state for i in {1..100}; do gluster snap create snap_1_$i vol0 ; done snapshot create: success: Snap snap_1_1 created successfully snapshot create: success: Snap snap_1_2 created successfully snapshot create: success: Snap snap_1_3 created successfully snapshot create: success: Snap snap_1_4 created successfully snapshot create: success: Snap snap_1_5 created successfully gluster snapshot delete snap_1_2 Deleting snap will erase all the information about the snap. Do you still want to continue? (y/n) y snapshot delete: failed: snap snap_1_2 might not be in an usable state. Snapshot command failed ------------Part of the Log----------------------- E [glusterd-locks.c:228:glusterd_acquire_multiple_locks_per_entity] 0-management: Failed to acquire lock for vol vol0 on behalf of 1edef405-58c2-4a81-b7a3-50925c6f8035. Reversing this transaction [2014-06-20 10:57:04.097204] E [glusterd-locks.c:387:glusterd_mgmt_v3_lock_entity] 0-management: Failed to acquire all vol locks [2014-06-20 10:57:04.097226] E [glusterd-locks.c:464:glusterd_multiple_mgmt_v3_lock] 0-management: Unable to lock all vol [2014-06-20 10:57:04.097241] E [glusterd-mgmt.c:401:glusterd_mgmt_v3_initiate_lockdown] 0-management: Failed to acquire mgmt_v3 locks on localhost [2014-06-20 10:57:04.097258] E [glusterd-mgmt.c:1821:glusterd_mgmt_v3_initiate_snap_phases] 0-management: mgmt_v3 lockdown failed. [2014-06-20 10:57:04.097464] E [glusterd-mgmt.c:1311:glusterd_mgmt_v3_post_validate] (-->/usr/lib64/glusterfs/3.6.0.20/xlator/mgmt/glusterd.so(glusterd_handle_snapshot_fn+0x5fb) [0x7f8a0dde440b] (-->/usr/lib64/glusterfs/3.6.0.20/xlator/mgmt/glusterd.so(glusterd_handle_snapshot_remove+0x258) [0x7f8a0ddd7e88] (-->/usr/lib64/glusterfs/3.6.0.20/xlator/mgmt/glusterd.so(glusterd_mgmt_v3_initiate_snap_phases+0x152) [0x7f8a0ddebc32]))) 0-management: invalid argument: req_dict [2014-06-20 10:57:04.097487] E [glusterd-mgmt.c:1944:glusterd_mgmt_v3_initiate_snap_phases] 0-management: Post Validation Failed
Patch posted downstream: https://code.engineering.redhat.com/gerrit/#/c/27536/
verified with build: glusterfs-3.6.0.24-1.el6rhs.x86_64 Case 1: Deletion of non existing snap [root@inception 07July-2014]# gluster snapshot delete s1 Deleting snap will erase all the information about the snap. Do you still want to continue? (y/n) y snapshot delete: failed: Snap (s1) does not exist Snapshot command failed [root@inception 07July-2014]# Case 2: Deletion of a snapshot when creation is in progress. [root@rhs-arch-srv2 07July-2014]# gluster snapshot delete snap51 Deleting snap will erase all the information about the snap. Do you still want to continue? (y/n) y snapshot delete: failed: Another transaction is in progress Please try again after sometime. Snapshot command failed [root@rhs-arch-srv2 07July-2014]# gluster snapshot delete snap1 Deleting snap will erase all the information about the snap. Do you still want to continue? (y/n) y snapshot delete: failed: Another transaction is in progress Please try again after sometime. Snapshot command failed [root@rhs-arch-srv2 07July-2014]# Moving the bug to verified state.
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. http://rhn.redhat.com/errata/RHEA-2014-1278.html