summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2010-09-07 08:53:08 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-07 08:42:22 -0700
commit1ec9ef73eedaabdc30d6b1c6200f0180118cf604 (patch)
tree808eea630f7e0abaee4c920b76e18fb281df117c /xlators
parent6066038c7bd96791143a63ed03a617c8cb7020f8 (diff)
mgmt/glusterd: resolve bricks upon restart
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1286 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1286
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c34
1 files changed, 34 insertions, 0 deletions
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
@@ -1356,6 +1356,36 @@ out:
}
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 ()
{
int ret = -1;
@@ -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;