Description of problem: If the user does not add proper number of bricks to an add-brick operation, then it should suggest valid number of bricks that can be added, like before. Example: root@Dagobah:~/nfs/hearya# gluster volume info str Volume Name: str Type: Distributed-Stripe Status: Started Number of Bricks: 2 x 2 = 4 Transport-type: tcp Bricks: Brick1: dagobah:/data/export20 Brick2: dagobah:/data/export21 Brick3: dagobah:/data/export22 Brick4: dagobah:/data/export23 root@Dagobah:~/nfs/hearya# gluster volume add-brick Usage: volume add-brick <VOLNAME> [<stripe|replica> <COUNT>] <NEW-BRICK> ... root@Dagobah:~/nfs/hearya# gluster volume add-brick str replica 2 dagobah:/data/export24 Operation failed root@Dagobah:~/nfs/hearya# gluster volume add-brick str replica 2 dagobah:/data/export24 dagobah:/data/export25 Operation failed root@Dagobah:~/nfs/hearya# gluster volume add-brick str replica 2 dagobah:/data/export24 dagobah:/data/export25 dagobah:/data/export26 Operation failed root@Dagobah:~/nfs/hearya# gluster volume add-brick str replica 2 dagobah:/data/export24 dagobah:/data/export25 dagobah:/data/export26 dagobah:/data/export27 Add Brick successful root@Dagobah:~/nfs/hearya# gluster volume info str Volume Name: str Type: Distributed-Striped-Replicate Status: Started Number of Bricks: 2 x 2 x 2 = 8 Transport-type: tcp Bricks: Brick1: dagobah:/data/export20 Brick2: dagobah:/data/export24 Brick3: dagobah:/data/export21 Brick4: dagobah:/data/export25 Brick5: dagobah:/data/export22 Brick6: dagobah:/data/export26 Brick7: dagobah:/data/export23 Brick8: dagobah:/data/export27 Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
CHANGE: http://review.gluster.com/3032 (glusterd: add-brick: give proper reason in few error cases) merged in master by Vijay Bellur (vijay)
Verified against master 3c5aed7d8226e50296c6a7106e0d59682732e9b5 gives proper error message.