Bug 764030 - (GLUSTER-2298) removing the last pair of bricks from a volume results in inconsistency
removing the last pair of bricks from a volume results in inconsistency
Status: CLOSED CURRENTRELEASE
Product: GlusterFS
Classification: Community
Component: glusterd (Show other bugs)
mainline
All Linux
low Severity low
: ---
: ---
Assigned To: Pranith Kumar K
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-19 01:19 EST by Raghavendra G
Modified: 2015-12-01 11:45 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: RTNR
Mount Type: fuse
Documentation: DNR
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Junaid 2011-01-18 22:39:02 EST
A work around for this can be that - If the brick count is equal the count of the bricks to be removed, then we can report an error saying this is not a permitted command, a better option is to delete the volume.
Comment 1 Raghavendra G 2011-01-19 01:19:53 EST
gluster> volume info

Volume Name: repl
Type: Distributed-Replicate
Status: Started
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: booradley:/home/export/9
Brick2: booradley:/home/export/10
Brick3: booradley:/home/export/11
Brick4: booradley:/home/export/12
gluster> volume remove-brick repl booradley:/home/export/9 booradley:/home/export/10
Removing brick(s) can result in data loss. Do you want to Continue? (y/n) y
Remove Brick successful
gluster> volume remove-brick repl booradley:/home/export/12 booradley:/home/export/11
Removing brick(s) can result in data loss. Do you want to Continue? (y/n) y
Remove Brick unsuccessful

gluster> volume info

Volume Name: repl
Type: Replicate
Status: Started
Number of Bricks: 0
Transport-type: tcp

Please note that, even though cli reported remove-brick as unsuccessful, number of bricks is zero. Also, as expected no glusterfs server processes were started. But looking at glusterfs client volume file, it still consisted of a replicate setup of two clients. Probably we should just indicate the user that since these were the last pair of bricks remaining, it does not make sense to remove them and hence the operation is not permissible.

gluster> volume add-brick repl booradley:/home/export/5 booradley:/home/export/6/
Add Brick successful
gluster> volume info

Volume Name: repl
Type: Replicate
Status: Started
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: booradley:/home/export/5
Brick2: booradley:/home/export/6

regards,
Raghavendra.
Comment 2 Anand Avati 2011-01-26 23:42:19 EST
PATCH: http://patches.gluster.com/patch/5995 in master (mgmt/glusterd: error out if remove-brick comes for final bricks)
Comment 3 Raghavendra Bhat 2011-02-17 21:59:58 EST
It is fixed. If the last bricks are tried to be removed, it gives an error if the last bricks of the volume are tried to be removed.




root@bigbang:/home/raghu# gluster volume remove-brick mirror bigbang:/e/glusterfs/export/export bigbang:/e/glusterfs/export/export1
Removing brick(s) can result in data loss. Do you want to Continue? (y/n) y
Remove Brick successful
root@bigbang:/home/raghu# gluster volume info

Volume Name: mirror
Type: Replicate
Status: Started
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: bigbang:/d/glusterfs/export/export
Brick2: bigbang:/d/glusterfs/export/export1


root@bigbang:/home/raghu# gluster volume remove-brick mirror bigbang:/d/glusterfs/export/export bigbang:/d/glusterfs/export/export1
Removing brick(s) can result in data loss. Do you want to Continue? (y/n) y
Deleting all the bricks of the volume is not allowed

Note You need to log in before you can comment on or make changes to this bug.