From 1ec9ef73eedaabdc30d6b1c6200f0180118cf604 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 7 Sep 2010 08:53:08 +0000 Subject: mgmt/glusterd: resolve bricks upon restart Signed-off-by: Pranith Kumar K Signed-off-by: Vijay Bellur BUG: 1286 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1286 --- xlators/mgmt/glusterd/src/glusterd-store.c | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index 4c45912c127..89208a9fcc7 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -1355,6 +1355,36 @@ out: return ret; } +int32_t +glusterd_resolve_all_bricks (xlator_t *this) +{ + int32_t ret = 0; + glusterd_conf_t *priv = NULL; + glusterd_volinfo_t *volinfo = NULL; + glusterd_brickinfo_t *brickinfo = NULL; + + GF_ASSERT (this); + priv = this->private; + + GF_ASSERT (priv); + + list_for_each_entry (volinfo, &priv->volumes, vol_list) { + list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) { + ret = glusterd_resolve_brick (brickinfo); + if (ret) { + gf_log ("glusterd", GF_LOG_ERROR, + "resolve brick failed in restore"); + goto out; + } + } + } + +out: + gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret); + + return ret; +} + int32_t glusterd_restore () { @@ -1372,6 +1402,10 @@ glusterd_restore () if (ret) goto out; + ret = glusterd_resolve_all_bricks (this); + if (ret) + goto out; + out: gf_log ("", GF_LOG_DEBUG, "Returning %d", ret); return ret; -- cgit