Bug 1040694

Summary: rest api: Able to delete bricks while brick migration is occuring
Product: Red Hat Gluster Storage Reporter: Dustin Tsang <dtsang>
Component: rhsc-sdkAssignee: Shubhendu Tripathi <shtripat>
Status: CLOSED NOTABUG QA Contact: Dustin Tsang <dtsang>
Severity: high Docs Contact:
Priority: unspecified    
Version: 2.1CC: dpati, dtsang, knarra, mmahoney, mmccune, pprakash, rhs-bugs, ssampat
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-13 11:22:41 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:

Description Dustin Tsang 2013-12-11 22:27:24 UTC
Description of problem:

Brick Deletion is successful while brick migration is in progress.
Brick deletion should be prevented from happening while migration is in progress.

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

How reproducible:
100% of the time

Steps to Reproduce:
1. create a distributed volume
2. populate volume with data so that every brick has data
3. via rest api start migration on 2 bricks
4. using collection brick delete the 2 bricks in step 3
 (DELETE /api/cluster/:id/glustervolume/:id/bricks)

Actual results:
deletion is successful

Expected results:
deletion should have failed, bricks should still be part of the volume.


Additional info:

Comment 1 Dusmant 2013-12-12 09:59:08 UTC
If the migration is already completed on those two bricks, then deletion should succeed. 

Dustin, can you confirm, whether migration was completed on those two bricks, before you fired the delete API on them?

Comment 3 Dustin Tsang 2013-12-12 23:14:23 UTC
Running gluster vol status showed that rebalance was in progress before deletion had occurred.

Comment 4 Shubhendu Tripathi 2013-12-13 11:22:41 UTC
Dustin,
   This is an expected behaviour, because the REST API is using the Force option by default. So, i am moving the bug to CLOSED state, 

This is what the Gluster team told us...

'remove-brick commit[force]' will remove the specified brick(s) even if there is an ongoing rebalance. Remove-brick has checks to prevent this, but the force option will cause the checks to be overridden. This is unsafe behavior IMO, but it is what is happening now.