summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-pmap.c
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2010-09-22 05:21:28 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-22 07:44:04 -0700
commit2915e10dd0ffe529ddf747451051cf9924c708f3 (patch)
tree449f4daeb8cc0c8eeab7ef1a789d44644d2b11b9 /xlators/mgmt/glusterd/src/glusterd-pmap.c
parent3225d7ccf599e726012fb2d32fe3cc68b979e0ea (diff)
Restart all bricks which are down when glusterd comes up
This is only done is the volume is started. Signed-off-by: shishir gowda <shishirng@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1562 (insufficient consistency check on start of glusterd) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1562
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-pmap.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-pmap.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-pmap.c b/xlators/mgmt/glusterd/src/glusterd-pmap.c
index aaa6ed131..1e72b694b 100644
--- a/xlators/mgmt/glusterd/src/glusterd-pmap.c
+++ b/xlators/mgmt/glusterd/src/glusterd-pmap.c
@@ -399,6 +399,8 @@ gluster_pmap_signin (rpcsvc_request_t *req)
{
pmap_signin_req args = {0,};
pmap_signin_rsp rsp = {0,};
+ glusterd_brickinfo_t *brickinfo = NULL;
+ int ret = -1;
if (xdr_to_glusterfs_req (req, &args, xdr_to_pmap_signin_req)) {
req->rpc_err = GARBAGE_ARGS;
@@ -408,6 +410,11 @@ gluster_pmap_signin (rpcsvc_request_t *req)
rsp.op_ret = pmap_registry_bind (THIS, args.port, args.brick,
GF_PMAP_PORT_BRICKSERVER, req->trans);
+ ret = glusterd_get_brickinfo (THIS, args.brick, args.port, _gf_true,
+ &brickinfo);
+ if (!ret)
+ glusterd_set_brick_status (brickinfo, GF_BRICK_STARTED);
+
fail:
glusterd_submit_reply (req, &rsp, NULL, 0, NULL,
(gd_serialize_t)xdr_from_pmap_signin_rsp);
@@ -424,7 +431,8 @@ gluster_pmap_signout (rpcsvc_request_t *req)
{
pmap_signout_req args = {0,};
pmap_signout_rsp rsp = {0,};
-
+ int ret = -1;
+ glusterd_brickinfo_t *brickinfo = NULL;
if (xdr_to_glusterfs_req (req, &args, xdr_to_pmap_signout_req)) {
//failed to decode msg;
@@ -435,6 +443,11 @@ gluster_pmap_signout (rpcsvc_request_t *req)
rsp.op_ret = pmap_registry_remove (THIS, args.port, args.brick,
GF_PMAP_PORT_BRICKSERVER, req->trans);
+ ret = glusterd_get_brickinfo (THIS, args.brick, args.port, _gf_true,
+ &brickinfo);
+ if (!ret)
+ glusterd_set_brick_status (brickinfo, GF_BRICK_STOPPED);
+
fail:
glusterd_submit_reply (req, &rsp, NULL, 0, NULL,
(gd_serialize_t)xdr_from_pmap_signout_rsp);
@@ -444,7 +457,6 @@ fail:
return 0;
}
-
rpcsvc_actor_t gluster_pmap_actors[] = {
[GF_PMAP_NULL] = {"NULL", GF_HNDSK_NULL, NULL, NULL, NULL },
[GF_PMAP_PORTBYBRICK] = {"PORTBYBRICK", GF_PMAP_PORTBYBRICK,