Bug 786006

Summary: glusterd friend/op sm could be used even before its initialisation
Product: [Community] GlusterFS Reporter: krishnan parthasarathi <kparthas>
Component: glusterdAssignee: krishnan parthasarathi <kparthas>
Status: CLOSED CURRENTRELEASE QA Contact: amainkar
Severity: medium Docs Contact:
Priority: unspecified    
Version: mainlineCC: gluster-bugs, nsathyan, tuxdna
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
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:32:08 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: 3.3qa44 Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 817967    

Description krishnan parthasarathi 2012-01-31 01:36:39 EST
Description of problem:
glusterd sequence of initialisation operations can lead to use of glusterd_[friend/op]_sm before their respective initialisations.

One possible sequence of operations that can result in a crash is as follows,
- glusterd attempts to restore all the peers.
- One of the peer's ip/hostname is unreachable.
- glusterd receives a disconnect from that peer before restore phase is complete. This can result in 'moving' of the friend_sm.
But friend_sm initialisation is yet to happen.

Version-Release number of selected component (if applicable):
master, release-3.2 (corresponding git branches that are affected)

How reproducible:
Inconsistent. It depends on how soon the non-blocking socket returns with an unreachable/unresolvable hostname/ip of peer.

Steps to Reproduce:
1. Create a trusted pool with more than one peers. 
2. One of the peers' hostname/ip must be unreachable/unresolvable.
3. 
  
Actual results:
glusterd should not crash.

Expected results:
glusterd crashes.

Additional info:
Comment 1 krishnan parthasarathi 2012-02-06 08:36:30 EST
*** Bug 787516 has been marked as a duplicate of this bug. ***
Comment 2 Anand Avati 2012-02-07 12:45:14 EST
CHANGE: http://review.gluster.com/2725 (glusterd: Initialised op_sm/friend_sm before cluster restore.) merged in master by Vijay Bellur (vijay@gluster.com)