Bug 764030 (GLUSTER-2298) - removing the last pair of bricks from a volume results in inconsistency
Summary: removing the last pair of bricks from a volume results in inconsistency
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-2298
Product: GlusterFS
Classification: Community
Component: glusterd
Version: mainline
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Pranith Kumar K
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-19 06:19 UTC by Raghavendra G
Modified: 2015-12-01 16:45 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: RTNR
Mount Type: fuse
Documentation: DNR
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Junaid 2011-01-19 03:39:02 UTC
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 06:19:53 UTC
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-27 04:42:19 UTC
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-18 02:59:58 UTC
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.