summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2014-04-14 12:39:36 +0000
committerVijay Bellur <vbellur@redhat.com>2014-04-21 18:58:51 -0700
commit99bfc2a2a1689da1e173cb2f8ef54d2b09ef3a5d (patch)
treed94ca0ef024113d9612c783fc17560e93d6a4e55
parent29e183b41b3c915de997464d0c137ad30559afd2 (diff)
snapshot: use volume's brick_ids for the snaps
brickinfo->brick_id was introduced to establish persistence of client xlator names and AFR chanelog attributes (http://review.gluster.org/7155). The snapshot volumes must also use the same IDs during snapshot create and restore to maintain persistence. Change-Id: I13d66d19b63520061ba9ec5f0ce661cf3b9eeafe BUG: 1066778 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/7477 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c7
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c6
2 files changed, 4 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index e19ee78..d11abee 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -2973,6 +2973,9 @@ glusterd_add_bricks_to_snap_volume (dict_t *dict, dict_t *rsp_dict,
strcpy (snap_brickinfo->hostname, original_brickinfo->hostname);
strcpy (snap_brickinfo->path, snap_brick_path);
uuid_copy (snap_brickinfo->uuid, original_brickinfo->uuid);
+ /* AFR changelog names are based on brick_id and hence the snap
+ * volume's bricks must retain the same ID */
+ strcpy (snap_brickinfo->brick_id, original_brickinfo->brick_id);
list_add_tail (&snap_brickinfo->brick_list, &snap_vol->bricks);
out:
@@ -3201,10 +3204,6 @@ glusterd_do_snap_vol (glusterd_volinfo_t *origin_vol, glusterd_snap_t *snap,
goto out;
}
- /*Update the brickid for the new brick in new volume*/
- GLUSTERD_ASSIGN_BRICKID_TO_BRICKINFO (snap_brickinfo, snap_vol,
- brick_count);
-
/* Take snapshot of the brick */
if ((uuid_compare (brickinfo->uuid, MY_UUID)) ||
(snap_brickinfo->snap_status == -1)) {
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 1822be1..bb80280 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -626,6 +626,7 @@ glusterd_brickinfo_dup (glusterd_brickinfo_t *brickinfo,
goto out;
}
}
+ strcpy (dup_brickinfo->brick_id, brickinfo->brick_id);
dup_brickinfo->status = brickinfo->status;
dup_brickinfo->snap_status = brickinfo->snap_status;
out:
@@ -678,11 +679,6 @@ glusterd_snap_volinfo_restore (dict_t *rsp_dict,
goto out;
}
- /*Update the brickid for the new brick in new volume*/
- GLUSTERD_ASSIGN_BRICKID_TO_BRICKINFO (new_brickinfo,
- new_volinfo,
- brick_count);
-
/* If the brick is not of this peer, or snapshot is missed *
* for the brick do not replace the xattr for it */
if ((!uuid_compare (brickinfo->uuid, MY_UUID)) &&