Skip to content

Commit

Permalink
restart glustershd on volume start/stop operation
Browse files Browse the repository at this point in the history
glustershd process needs to be restarted for every volume start/stop
operations to ensure that glustershd can run with the latest volfiles.
Currently due to the lack of client graph switch issue, a reconfigure
isn't possible for such case with out a restart.

volume set operation is still a TODO item and this PR doesn't cover
this.

Fixes: gluster#1459
Signed-off-by: Atin Mukherjee <[email protected]>
  • Loading branch information
Atin Mukherjee committed Jan 3, 2019
1 parent 5dd1254 commit bb93e80
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion plugins/glustershd/actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func (actor *shdActor) Do(v *volume.Volinfo, key string, value string, volOp xla
return err
}

err := daemon.Stop(glustershDaemon, true, logger)
err = daemon.Start(glustershDaemon, true, logger)
if err != nil && err != gderrors.ErrProcessAlreadyRunning {
return err
Expand All @@ -53,10 +54,23 @@ func (actor *shdActor) Do(v *volume.Volinfo, key string, value string, volOp xla
if err != nil && err != gderrors.ErrPidFileNotFound {
return err
}
} else {
err = volgen.ClusterVolfileToFile(v, glustershDaemon.VolfileID, "glustershd")
if err != nil {
return err
}
err := daemon.Stop(glustershDaemon, true, logger)
err = daemon.Start(glustershDaemon, true, logger)
if err != nil && err != gderrors.ErrProcessAlreadyRunning {
return err
}
}

case xlator.VolumeSet:
fallthrough
fallthrough // TODO : In case there's any option which changes
// the topology of the shd volfile, shd needs to be
// restarted, refer glusterd_shdsvc_reconfigure()
// from GD1 code
case xlator.VolumeReset:
if key != selfHealKey && key != granularEntryHealKey {
return nil
Expand Down

0 comments on commit bb93e80

Please sign in to comment.