From 3263d1c4f4b7efd1a018c17e1ba4dd9245094f48 Mon Sep 17 00:00:00 2001 From: hari gowtham Date: Tue, 12 Jul 2016 16:40:28 +0530 Subject: tier : Tier as a service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tierd is implemented by separating from rebalance process. The commands affected: 1) Attach tier will trigger this process instead of old one 2) tier start and tier start force will also trigger this process. 3) volume status [tier] will show tier daemon as a process instead of task and normal tier status and tier detach status works. 4) tier stop implemented. 5) detach tier implemented separately along with new detach tier status 6) volume tier volname status will work using the changes. 7) volume set works This patch has separated the tier translator from the legacy DHT rebalance code. It now sends the RPCs from the CLI to glusterd separate to the DHT rebalance code. The daemon is now a service, similar to the snapshot daemon, and can be viewed using the volume status command. The code for the validation and commit phase are the same as the earlier tier validation code in DHT rebalance. The “brickop” phase has been changed so that the status command can use this framework. The service management framework is now used. DHT rebalance does not use this framework. This service framework takes care of : *) spawning the daemon, killing it and other such processes. *) volume set options , which are written on the volfile. *) restart and reconfigure functions. Restart is to restart the daemon at two points 1)after gluster goes down and comes up. 2) to stop detach tier. *) reconfigure is used to make immediate volfile changes. By doing this, we don’t restart the daemon. it has the code to rewrite the volfile for topological changes too (which comes into place during add and remove brick). With this patch the log, pid, and volfile are separated and put into respective directories. Change-Id: I3681d0d66894714b55aa02ca2a30ac000362a399 BUG: 1313838 Signed-off-by: hari gowtham Reviewed-on: http://review.gluster.org/13365 Smoke: Gluster Build System Tested-by: hari gowtham CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Dan Lambright Reviewed-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-sm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-sm.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-sm.c b/xlators/mgmt/glusterd/src/glusterd-sm.c index c1fb3181b90..f83e8519ad9 100644 --- a/xlators/mgmt/glusterd/src/glusterd-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-sm.c @@ -736,6 +736,15 @@ glusterd_peer_detach_cleanup (glusterd_conf_t *priv) } } + if (volinfo->type == GF_CLUSTER_TYPE_TIER) { + svc = &(volinfo->tierd.svc); + ret = svc->stop (svc, SIGTERM); + if (ret) { + gf_msg (THIS->name, GF_LOG_ERROR, 0, + GD_MSG_SVC_STOP_FAIL, "Failed " + "to stop tierd daemon service"); + } + } ret = glusterd_cleanup_snaps_for_volume (volinfo); if (ret) { gf_msg (THIS->name, GF_LOG_ERROR, 0, -- cgit