Bug 1613687

Summary: Disperse volume being created with negative redundancy value when using only 1 brick
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Jilju Joy <jijoy>
Component: disperseAssignee: Ashish Pandey <aspandey>
Status: CLOSED DUPLICATE QA Contact: Nag Pavan Chilakam <nchilaka>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rhgs-3.4CC: rhs-bugs, sankarshan, storage-qa-internal, ubansal
Target Milestone: ---Keywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-16 07:39:01 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:
Embargoed:

Description Jilju Joy 2018-08-08 07:12:39 UTC
Description of problem:
-----------------------
When using only one brick, disperse volume is being created with specified disperse count and a random negative value of redundancy count.
===========================================================

Version-Release number of selected component (if applicable):
------------------------------------------------------------
# rpm -qa|grep glusterfs
glusterfs-3.12.2-15.el7rhgs.x86_64
glusterfs-fuse-3.12.2-15.el7rhgs.x86_64
glusterfs-rdma-3.12.2-15.el7rhgs.x86_64
glusterfs-debuginfo-3.12.2-14.el7rhgs.x86_64
glusterfs-api-3.12.2-15.el7rhgs.x86_64
glusterfs-ganesha-3.12.2-15.el7rhgs.x86_64
glusterfs-client-xlators-3.12.2-15.el7rhgs.x86_64
glusterfs-server-3.12.2-15.el7rhgs.x86_64
glusterfs-geo-replication-3.12.2-15.el7rhgs.x86_64
glusterfs-cli-3.12.2-15.el7rhgs.x86_64
glusterfs-libs-3.12.2-15.el7rhgs.x86_64

=========================================================

How reproducible:
-----------------
always
=========================================================

Steps to Reproduce:
-------------------
1. Create disperse volume specifying disperse-data and using one brick. Give confirmation 'y'.
eg: 
gluster volume create test-volume disperse-data 3 transport tcp dhcp37-173.lab.eng.blr.redhat.com:/bricks/brick1/b

gluster volume create test-volume disperse-data 6 transport tcp dhcp37-173.lab.eng.blr.redhat.com:/bricks/brick1/b

#gluster volume create test-volume disperse-data 6 transport tcp dhcp37-173.lab.eng.blr.redhat.com:/bricks/brick1/b
Redundancy for this configuration is -5. Do you want to create the volume with this value ? (y/n) y
This configuration is not optimal on most workloads. Do you want to use it ? (y/n) y
volume create: test-volume: success: please start the volume to access data
==============================================================================
Actual results:
---------------
Disperse volume is created.

================================================================

Expected results:
-----------------
Even though it is warning that it is unsupported config, we must not even be allowing it to create a -ve value set as it doesnt even make any sense 

Volume type 'Disperse' should not be created with the given configuration. The operation should fail with valid error statement.

=================================================================
Additional info:


I am not seeing any logs in glusterd 
only below logs is seen in cli.log

[2018-08-08 07:11:21.147930] I [cli.c:758:main] 0-cli: Started running gluster with version 3.12.2
[2018-08-08 07:11:21.266498] I [MSGID: 101190] [event-epoll.c:613:event_dispatch_epoll_worker] 0-epoll: Started thread with index 1
[2018-08-08 07:11:21.266621] I [socket.c:2474:socket_event_handler] 0-transport: EPOLLERR - disconnecting now
[2018-08-08 07:11:24.154687] I [socket.c:2474:socket_event_handler] 0-transport: EPOLLERR - disconnecting now
[2018-08-08 07:11:26.770058] I [cli-rpc-ops.c:1170:gf_cli_create_volume_cbk] 0-cli: Received resp to create volume
[2018-08-08 07:11:26.770313] I [input.c:31:cli_batch] 0-: Exiting with: 0



Hence not submitting any sosreports/healthreports