Bug 1039992

Summary: 'gluster volume remove-brick' command fails with different error messages when the order of bricks being removed is different
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Shruti Sampat <ssampat>
Component: glusterfsAssignee: Ravishankar N <ravishankar>
Status: CLOSED ERRATA QA Contact: Shruti Sampat <ssampat>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.1CC: dpati, dtsang, grajaiya, knarra, mmahoney, pprakash, ravishankar, rhs-bugs, sdharane, vagarwal, vbellur
Target Milestone: ---Keywords: Reopened, ZStream
Target Release: RHGS 2.1.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.4.0.50rhs-1 Doc Type: Bug Fix
Doc Text:
Cause: Validation of the list of bricks to be removed was done strictly in the order in which they were listed in the volume information. Consequence: If the bricks to be removed were given in a random order in the CLI, the operation would fail with different error messages. Fix: Make the validation of bricks agnostic to the order in which they were listed in the CLI. Result: Consistent actions/error messages no matter in what order the bricks are given at the CLI.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-25 08:08:05 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: 1040408    
Bug Blocks:    

Description Shruti Sampat 2013-12-10 13:24:04 UTC
Description of problem:
------------------------

When trying to reduce the replica count of a distribute-replicate volume by removing one brick each from all the replica groups, the command fails with different error messages if the brick being removed are specified in different order. For example - 

[root@localhost ~]# gluster volume info disrep-vol
 
Volume Name: disrep-vol
Type: Distributed-Replicate
Volume ID: 33334784-2f07-4d34-a768-046b72011ed2
Status: Created
Number of Bricks: 2 x 3 = 6
Transport-type: tcp
Bricks:
Brick1: 10.70.37.109:/tmp/br1
Brick2: 10.70.37.120:/tmp/br2
Brick3: 10.70.37.177:/tmp/br3
Brick4: 10.70.37.182:/tmp/br4
Brick5: 10.70.37.109:/tmp/br5
Brick6: 10.70.37.120:/tmp/br6

Consider the following commands - 

[root@localhost ~]# gluster volume remove-brick disrep-vol replica 2 10.70.37.109:/tmp/br1 10.70.37.182:/tmp/br4 force
Removing brick(s) can result in data loss. Do you want to Continue? (y/n) y
volume remove-brick commit force: failed: Reducing replica count of volume is disallowed in glusterfs 3.4.0.47.1u2rhs

[root@localhost ~]# gluster volume remove-brick disrep-vol replica 2 10.70.37.182:/tmp/br4 10.70.37.109:/tmp/br1 force
Removing brick(s) can result in data loss. Do you want to Continue? (y/n) y
volume remove-brick commit force: failed: Bricks are from same subvol

The command should always fail with the correct error message.

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

How reproducible:
Always

Steps to Reproduce:
1. From a 2x3 distribute-replicate volume, remove one brick from each replica set, by listing the bricks in the same order as volume info list them. It fails with the message that the operation is disallowed.
2. Now remove the same bricks but with the bricks interchanged in order.

Actual results:
It fails with the wrong error message.

Expected results:
The command should fail with the correct error message always.

Additional info:

Comment 2 Vivek Agarwal 2013-12-11 08:29:18 UTC
Per bug triage 12/11, removing from corbett list

Comment 3 Ravishankar N 2013-12-16 05:24:55 UTC
Downstream patch : https://code.engineering.redhat.com/gerrit/#/c/17469/

Comment 4 Dusmant 2013-12-16 08:13:32 UTC
It's required by RHSC, but not a huge blocker. Considering it's already fixed, it will be good to be in Corbett.

Comment 5 Gowrishankar Rajaiyan 2013-12-17 04:43:47 UTC
Priority: unspecified; severity: medium; does not fall in MUST FIX bucket for Corbett (including both RHS and RHSC) and hence qa_ack-

Feel free to raise the blocker flag with enough comment in case I have missed anything here and we can triage again.

Comment 6 RHEL Program Management 2013-12-17 04:46:31 UTC
Quality Engineering Management has reviewed and declined this request.
You may appeal this decision by reopening this request.

Comment 7 Gowrishankar Rajaiyan 2013-12-17 05:29:39 UTC
Reverting to state of the bug, "Status: MODIFIED"

Comment 8 Gowrishankar Rajaiyan 2013-12-19 06:24:50 UTC
Please set priority.

Comment 9 Shruti Sampat 2013-12-20 10:45:55 UTC
Verified as fixed in glusterfs 3.4.0.50rhs. Tried removing bricks ordered in different ways, the operation failed with the same error message - 

volume remove-brick commit force: failed: Reducing replica count of volume is disallowed in glusterfs 3.4.0.50rhs

Comment 11 errata-xmlrpc 2014-02-25 08:08:05 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.

http://rhn.redhat.com/errata/RHEA-2014-0208.html