Patchwork [BUG:1498] peer status returns duplicate peer info on restart

login
register
Submitter shishir gowda
Date 2010-09-01 10:43:29
Message ID <20100901104329.GA8819@dev.gluster.com>
Download mbox | patch
Permalink /patch/4453/
State Accepted
Headers show

Comments

shishir gowda - 2010-09-01 10:43:29
removing the peerinfo file for hostname once peerinfo is stored
 in the uuid file name.

Signed-off-by: shishir gowda <shishirng@gluster.com>
---
 xlators/mgmt/glusterd/src/glusterd-handler.c |    2 +-
 xlators/mgmt/glusterd/src/glusterd-store.c   |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 4816a07..1e6ab9c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -1130,7 +1130,7 @@  brick_validation:
                                     hostname) && !strcmp(brickinfo->path,
                                     tmpbrkinfo->path))) {
                                         snprintf(err_str, 1048, "Brick %s already"
-                                                "in use", brick);
+                                                " in use", brick);
                                         gf_log ("glusterd", GF_LOG_ERROR, "%s",
                                                 err_str);
                                         err_ret = 1;
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index 122cb73..5f65cf1 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -1184,6 +1184,7 @@  glusterd_store_update_peerinfo (glusterd_peerinfo_t *peerinfo)
                         gf_log ("", GF_LOG_DEBUG, "Destroying store handle");
                         glusterd_store_handle_destroy (peerinfo->shandle);
                         peerinfo->shandle = NULL;
+                        ret = remove (hostname_path);
                 }
         }