Problem : When gluster volume remove-brick is executed with out any option, it defaults to force commit which results in data loss. Fix : remove-brick can not be executed with out explicit option, user needs to provide the option in the command line else the command will throw back an usage error. Earlier usage : volume remove-brick <VOLNAME> [replica <COUNT>] <BRICK> ... [start|stop|status|commit|force] Current usage : volume remove-brick <VOLNAME> [replica <COUNT>] <BRICK> ... <start|stop|status|commit|force> Change-Id: I2a49131f782a6c0dcd03b4dc8ebe5907999b0b49 BUG: 1077682 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/7292 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shyamsundar Ranganathan <sam.somari@gmail.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
35 lines
735 B
Bash
Executable File
35 lines
735 B
Bash
Executable File
#!/bin/bash
|
|
|
|
. $(dirname $0)/../include.rc
|
|
. $(dirname $0)/../volume.rc
|
|
|
|
cleanup;
|
|
|
|
TEST glusterd
|
|
TEST pidof glusterd
|
|
TEST $CLI volume info;
|
|
|
|
TEST $CLI volume create $V0 replica 2 stripe 2 $H0:$B0/${V0}{1,2,3,4,5,6,7,8};
|
|
|
|
|
|
EXPECT "$V0" volinfo_field $V0 'Volume Name';
|
|
EXPECT 'Created' volinfo_field $V0 'Status';
|
|
EXPECT '8' brick_count $V0
|
|
|
|
TEST $CLI volume start $V0;
|
|
EXPECT 'Started' volinfo_field $V0 'Status';
|
|
|
|
TEST $CLI volume add-brick $V0 $H0:$B0/${V0}{9,10,11,12};
|
|
EXPECT '12' brick_count $V0
|
|
|
|
TEST $CLI volume remove-brick $V0 $H0:$B0/${V0}{1,2,3,4} force;
|
|
EXPECT '8' brick_count $V0
|
|
|
|
TEST $CLI volume stop $V0;
|
|
EXPECT 'Stopped' volinfo_field $V0 'Status';
|
|
|
|
TEST $CLI volume delete $V0;
|
|
TEST ! $CLI volume info $V0;
|
|
|
|
cleanup;
|