Bug 811956

Summary: [glusterfs-3.3.0qa34] - replace-brick start and commit can happen between two different bricks
Product: [Community] GlusterFS Reporter: M S Vishwanath Bhat <vbhat>
Component: glusterdAssignee: krishnan parthasarathi <kparthas>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: pre-releaseCC: amarts, gluster-bugs, mzywusko, nsathyan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.4.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-24 17:28:13 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:
Bug Depends On:    
Bug Blocks: 817967    

Description M S Vishwanath Bhat 2012-04-12 11:46:38 UTC
Description of problem:
Start the replace-brick between two-bricks say brick1 and brick2. Now I can get the proper status of the migration by specifying the wrong dest-brick (brick3). I can also commit the wrong dest-brick (brick3) and it gets reflected in the volume info and volume status. 

The volume was 2*2*2 dist-stripe-replicate.

Version-Release number of selected component (if applicable):
glusterfs-3.3.0qa34

How reproducible:
Often

Steps to Reproduce:
1. Create and start a 2*2*2 distributed-striped-replicated volume.
2. Create some data on the mountpoint, like untarring the linux kernel
3. Now start replace-brick between host1:brick1 and host2:brick2
4. Run replace-brick status for host1:brick1 and host2:brick3, it will succeed and will give proper status. ( I was running replace brick status between brick1 and brick3 in a while loop. It was giving me proper results)
5. Now run replace-brick commit between host1:brick1 and host2_brick3
  
Actual results:
Even the commit will succeed and will get reflected in volume info and volume status. Also since a new brick is committed it won't have any data in it. If the same issue is present in pure distribute volume, then it would lead to data loss.

Expected results:
replace-brick status and commit should error our and throw a message if the dest brick is different.

Additional info:
I have archived all the logs.

Comment 1 Amar Tumballi 2012-04-27 08:57:56 UTC
patch sent, reviewed @ http://review.gluster.com/3184

Comment 2 Anand Avati 2012-04-28 14:52:20 UTC
CHANGE: http://review.gluster.com/3184 (glusterd: Fail replace-brick subcmds on bricks other src/dst.) merged in master by Vijay Bellur (vijay)

Comment 3 M S Vishwanath Bhat 2012-05-14 08:23:49 UTC
With glusterfs-3.3.0qa41, Issue is resolved. 


[root@QA-30 ~]# gluster v rep hosdu 172.17.251.69:/data/bricks/hosdu_brick1 172.17.251.68:/data/bricks/hosdu_brick3 start
replace-brick started successfully
[root@QA-30 ~]# gluster v rep hosdu 172.17.251.69:/data/bricks/hosdu_brick1 172.17.251.68:/data/bricks/hosdu_brick3 status
Number of files migrated = 518       Current file= /kernel-source/linux-3.3/Documentation/block/writeback_cache_control.txt
[root@QA-30 ~]# gluster v rep hosdu 172.17.251.69:/data/bricks/hosdu_brick1 172.17.251.68:/data/bricks/hosdu_brick3 status
Number of files migrated = 40451        Migration complete 
[root@QA-30 ~]# gluster v rep hosdu 172.17.251.69:/data/bricks/hosdu_brick1 172.17.251.69:/data/bricks/hosdu_brick3 commit
Incorrect source or destination brick
[root@QA-30 ~]# gluster v rep hosdu 172.17.251.69:/data/bricks/hosdu_brick1 172.17.251.68:/data/bricks/hosdu_brick4 commit
Incorrect source or destination brick
[root@QA-30 ~]# gluster v rep hosdu 172.17.251.69:/data/bricks/hosdu_brick1 172.17.251.68:/data/bricks/hosdu_brick4 status
Incorrect source or destination brick
[root@QA-30 ~]# 
[root@QA-30 ~]# gluster v rep hosdu 172.17.251.69:/data/bricks/hosdu_brick2 172.17.251.68:/data/bricks/hosdu_brick3 status
brick: 172.17.251.69:/data/bricks/hosdu_brick2 does not exist in volume: hosdu
[root@QA-30 ~]# gluster v rep hosdu 172.17.251.69:/data/bricks/hosdu_brick1 172.17.251.68:/data/bricks/hosdu_brick3 status
Number of files migrated = 40451        Migration complete 
[root@QA-30 ~]# gluster v rep hosdu 172.17.251.69:/data/bricks/hosdu_brick1 172.17.251.68:/data/bricks/hosdu_brick3 commit
replace-brick commit successful
[root@QA-30 ~]#