summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2014-02-25 09:17:18 +0530
committerVijay Bellur <vbellur@redhat.com>2014-03-24 04:36:02 -0700
commit17454dfea9f3c4d47fcf0b5370a6155f639c8aeb (patch)
treedebfe5a473b5973f506be8c0e8cf4cbb0f23d288 /xlators/mgmt/glusterd/src/glusterd-volume-ops.c
parent2a77659e9c25cc51fed193147ba3bfea56c5f8f9 (diff)
glusterd: persistent client xlator/ afr changelog names
-Add a unique brick-id field to glusterd_brickinfo_t -Persist the id to the brickinfo file -Use the brick-id as the client xlator name during vol create, add-brick and replace-brick operations. -For older volumes,generate the id in-memory during glusterd restore but defer writing it to the brickinfo file until the next volume set operation. -send and receive the brick-ids during peer probe. Feature page: www.gluster.org/community/documentation/index.php/Features/persistent-AFR-changelog-xattributes Related patch: http://review.gluster.org/#/c/7122 Change-Id: Ib7f1570004e33f4144476410eec2b84df4e41448 BUG: 1066778 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/7155 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-ops.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
index 4acea768662..135faa40ac5 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
@@ -1488,6 +1488,7 @@ glusterd_op_create_volume (dict_t *dict, char **op_errstr)
char *username = NULL;
char *password = NULL;
int caps = 0;
+ int brickid = 0;
char msg[1024] __attribute__((unused)) = {0, };
this = THIS;
@@ -1653,11 +1654,17 @@ glusterd_op_create_volume (dict_t *dict, char **op_errstr)
brick = strtok_r (brick_list+1, " \n", &saveptr);
caps = CAPS_BD | CAPS_THIN | CAPS_OFFLOAD_COPY | CAPS_OFFLOAD_SNAPSHOT;
+ brickid = glusterd_get_next_available_brickid (volinfo);
+ if (brickid < 0)
+ goto out;
while ( i <= count) {
ret = glusterd_brickinfo_new_from_brick (brick, &brickinfo);
if (ret)
goto out;
+ GLUSTERD_ASSIGN_BRICKID_TO_BRICKINFO (brickinfo, volinfo,
+ brickid++);
+
ret = glusterd_resolve_brick (brickinfo);
if (ret) {
gf_log (this->name, GF_LOG_ERROR, FMTSTR_RESOLVE_BRICK,