Bug 1386492

Summary: [Eventing]: Volume stop is not generating the BRICK_DISCONNECT events.
Product: Red Hat Gluster Storage Reporter: Byreddy <bsrirama>
Component: glusterdAssignee: Atin Mukherjee <amukherj>
Status: CLOSED NOTABUG QA Contact: Byreddy <bsrirama>
Severity: high Docs Contact:
Priority: unspecified    
Version: rhgs-3.2CC: rhs-bugs, storage-qa-internal, vbellur
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-19 07:36:15 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:

Description Byreddy 2016-10-19 05:49:34 UTC
Description of problem:
=======================
Volume stop is not generating the BRICK_DISCONNECT events for the volume bricks

It's generating single VOLUME_STOP event.

{u'message': {u'force': u'0', u'name': u'Dis'}, u'event': u'VOLUME_STOP', u'ts': 1476854938, u'nodeid': u'50687898-88b3-4157-9f13-1c32266f83be'}


Version-Release number of selected component (if applicable):
=============================================================
glusterfs-3.8.4-2.


How reproducible:
=================
Always


Steps to Reproduce:
===================
1. Have 2 node cluster
2. Have simple distribute volume running with 3 bricks
3. Setup to capture the gluster operation events
4. Stop the running volume 

Actual results:
===============
Volume stop is not generating the BRICK_DISCONNECT events 


Expected results:
=================
Volume stop should generate the BRICK DISCONNECT events because this command will stop the running bricks.

Additional info:
================
For volume start,  we are getting the BRICK_CONNECT events, we need to get the reverse events when we stopped as well

Comment 2 Atin Mukherjee 2016-10-19 07:36:15 UTC
This is as per design. We generate brick disconnect *only* when a volume is in started state. volume stop event should be sufficient enough to pass on the message back to the upper layer indicating a change in the volume state.

<snippet>

                if (glusterd_is_brick_started (brickinfo)) // this is check I am talking about{                        
                        gf_msg (this->name, GF_LOG_INFO, 0,                         
                                GD_MSG_BRICK_DISCONNECTED,                          
                                "Brick %s:%s has disconnected from glusterd.",  
                                brickinfo->hostname, brickinfo->path);              
                        ret = get_volinfo_from_brickid (brickid, &volinfo);         
                        if (ret) {                                                  
                                gf_msg (this->name, GF_LOG_ERROR, 0,                
                                        GD_MSG_VOLINFO_GET_FAIL,                    
                                        "Failed to get volinfo from "               
                                        "brickid(%s)", brickid);                    
                                goto out;                                           
                        }                                                           
                        gf_event (EVENT_BRICK_DISCONNECTED,                         
                                  "peer=%s;volume=%s;brick=%s",                     
                                  brickinfo->hostname, volinfo->volname,            
                                  brickinfo->path);                                 
                }