Bug 765590 (GLUSTER-3858)

Summary: glusterd crashes with addbrick for stripe
Product: [Community] GlusterFS Reporter: shishir gowda <sgowda>
Component: glusterdAssignee: krishnan parthasarathi <kparthas>
Status: CLOSED CURRENTRELEASE QA Contact: shylesh <shmohan>
Severity: medium Docs Contact:
Priority: medium    
Version: pre-releaseCC: gluster-bugs, kaushal, nsathyan
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-3.4.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-24 13:29:58 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 817967    

Description shishir gowda 2011-12-08 05:42:47 EST
steps to reproduce
1. create a stripe vol
2. addbrick and specify stripe count change

root@shishirng:/gluster/glusterfs# gluster
gluster> volume info 
No volumes present
gluster> volume create new stripe 2 sng:/export/dir1 sng:/export/dir2
Creation of volume new has been successful. Please start the volume to access data.
gluster> volume add-brick new stripe 3 sng:/export/dir3


Program terminated with signal 8, Arithmetic exception.
#0  0x00007f6783e1e534 in add_brick_at_right_order (brickinfo=0xed2710, volinfo=0x7fff0c6239e0, count=0, stripe_cnt=3, replica_cnt=0)
    at glusterd-brick-ops.c:64
64	                idx = ((count / ((stripe_cnt * volinfo->replica_count) -

(gdb) bt
#0  0x00007f6783e1e534 in add_brick_at_right_order (brickinfo=0xed2710, volinfo=0x7fff0c6239e0, count=0, stripe_cnt=3, replica_cnt=0)
    at glusterd-brick-ops.c:64
#1  0x00007f6783e1fd2a in glusterd_handle_add_brick (req=0x7f6783cec02c) at glusterd-brick-ops.c:523
#2  0x00007f6786aff1ef in rpcsvc_handle_rpc_call (svc=0xec6ec0, trans=0xeca790, msg=0xec7ca0) at rpcsvc.c:507
#3  0x00007f6786aff56c in rpcsvc_notify (trans=0xeca790, mydata=0xec6ec0, event=RPC_TRANSPORT_MSG_RECEIVED, data=0xec7ca0) at rpcsvc.c:603
#4  0x00007f6786b0518c in rpc_transport_notify (this=0xeca790, event=RPC_TRANSPORT_MSG_RECEIVED, data=0xec7ca0) at rpc-transport.c:498
#5  0x00007f6783ae02e7 in socket_event_poll_in (this=0xeca790) at socket.c:1675
#6  0x00007f6783ae0850 in socket_event_handler (fd=5, idx=1, data=0xeca790, poll_in=1, poll_out=0, poll_err=0) at socket.c:1790
#7  0x00007f6786d59b04 in event_dispatch_epoll_handler (event_pool=0xec0500, events=0xec9b70, i=0) at event.c:794
#8  0x00007f6786d59d17 in event_dispatch_epoll (event_pool=0xec0500) at event.c:856
#9  0x00007f6786d5a08a in event_dispatch (event_pool=0xec0500) at event.c:956
#10 0x0000000000407d1e in main (argc=1, argv=0x7fff0c624398) at glusterfsd.c:1601
(gdb) f 0
#0  0x00007f6783e1e534 in add_brick_at_right_order (brickinfo=0xed2710, volinfo=0x7fff0c6239e0, count=0, stripe_cnt=3, replica_cnt=0)
    at glusterd-brick-ops.c:64
64	                idx = ((count / ((stripe_cnt * volinfo->replica_count) -
(gdb) l
59	                   (count + volinfo->dist_leaf_count);
60	                */
61	
62	                sub_cnt = volinfo->dist_leaf_count;
63	
64	                idx = ((count / ((stripe_cnt * volinfo->replica_count) -
65	                                 sub_cnt)) * sub_cnt) +
66	                        (count + sub_cnt);
67	
68	                goto insert_brick;
(gdb) p volinfo->replica_count
$4 = 0
(gdb) p count
$5 = 0
(gdb) p volinfo->dist_leaf_count
$6 = 0
(gdb) p stripe_cnt
$7 = 3
(gdb)
Comment 1 krishnan parthasarathi 2011-12-20 04:14:40 EST
CHANGE: http://review.gluster.com/804 should fix this issue as well.
Comment 2 Kaushal 2012-05-29 07:01:45 EDT
Checked on release-3.3. glusterd no longer crashes.
Performed the following and got the output shown.

gluster> volume info
No volumes present
gluster> volume create test stripe 2 arch:/export/test1 arch:/export/test2
Creation of volume test has been successful. Please start the volume to access data.
gluster> volume add-brick test stripe 3 arch:/export/test3
Changing the 'stripe count' of the volume is not a supported feature. In some cases it may result in data loss on the volume. Also there may be issues with regular filesystem operations on the volume after the change. Do you really want to continue with 'stripe' count option ?  (y/n) y
Add Brick successful
gluster>