summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2015-06-12 17:13:05 +0530
committerRajesh Joseph <rjoseph@redhat.com>2015-06-22 02:02:00 -0700
commit63f038645abae3ebf03dfe128e6dad7a4310d5ae (patch)
treee3b4359e609e4e802f04f787b2257c271a319cf7 /xlators/mgmt/glusterd/src/glusterd-utils.c
parentdebdd42c699abf1e7620763b650bff7d03104eda (diff)
glusterd/uss/snapshot: Intialise snapdsvc after volfiles are created
Backport of http://review.gluster.org/11227/ snapd svc should be initialised only after all relevant volfiles and directories are created. Change-Id: I96770cfc0b350599cd60ff74f5ecec08145c3105 BUG: 1232883 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/11291 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 988e316aa08..bf879cf0895 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -3764,14 +3764,6 @@ glusterd_import_friend_volume (dict_t *peer_data, size_t count)
goto out;
}
- ret = glusterd_snapdsvc_init (new_volinfo);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- GD_MSG_SNAPD_INIT_FAIL, "Failed to initialize "
- "snapdsvc for volume %s", new_volinfo->volname);
- goto out;
- }
-
ret = glusterd_volinfo_find (new_volinfo->volname, &old_volinfo);
if (0 == ret) {
/* snapdsvc initialization of old_volinfo is also required here
@@ -3799,6 +3791,19 @@ glusterd_import_friend_volume (dict_t *peer_data, size_t count)
}
ret = glusterd_store_volinfo (new_volinfo, GLUSTERD_VOLINFO_VER_AC_NONE);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR, "Failed to store "
+ "volinfo for volume %s", new_volinfo->volname);
+ goto out;
+ }
+
+ ret = glusterd_snapdsvc_init (new_volinfo);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR, "Failed to initialize "
+ "snapdsvc for volume %s", new_volinfo->volname);
+ goto out;
+ }
+
ret = glusterd_create_volfiles_and_notify_services (new_volinfo);
if (ret)
goto out;