diff options
author | Amar Tumballi <amar@kadalu.io> | 2020-02-04 23:02:51 +0530 |
---|---|---|
committer | Rinku Kothiya <rkothiya@redhat.com> | 2020-02-17 09:52:06 +0000 |
commit | 8b45b798a1fec498cdad36c79c5976b607bb1be9 (patch) | |
tree | 9782ad1767f70b390ffcb5a57deb29189d25e68a /xlators/mgmt/glusterd/src | |
parent | 965503fc2d32d562c7956d4935f9c00768ed4e13 (diff) |
volgen: make thin-arbiter name unique in 'pending-xattr' option
Thin-arbiter module makes use of 'pending-xattr' name for the translator
as the filename which gets created in thin-arbiter node. By making this
unique, we can host single thin-arbiter node for multiple clusters.
Updates: #763
Change-Id: Ib3c732e7e04e6dba229e71ae3e64f1f3cb6d794d
Signed-off-by: Amar Tumballi <amar@kadalu.io>
(cherry picked from commit 8db8202f716fd24c8c52f8ee5f66e169310dc9b1)
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 8243548f881..19542e90208 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -3705,6 +3705,8 @@ set_afr_pending_xattrs_option(volgen_graph_t *graph, * for client xlators in volfile. * ta client xlator indexes are - 2, 5, 8 depending on the index of * subvol. e.g- For first subvol ta client xlator id is volname-ta-2 + * For pending-xattr, ta name would be + * 'volname-ta-2.{{volume-uuid}}' from GD_OP_VERSION_7_3. */ ta_brick_index = 0; if (volinfo->thin_arbiter_count == 1) { @@ -3717,8 +3719,16 @@ set_afr_pending_xattrs_option(volgen_graph_t *graph, } ta_brick_index++; } - - strncat(ptr, ta_brick->brick_id, strlen(ta_brick->brick_id)); + if (conf->op_version < GD_OP_VERSION_7_3) { + strncat(ptr, ta_brick->brick_id, + strlen(ta_brick->brick_id)); + } else { + char ta_volname[PATH_MAX] = ""; + int len = snprintf(ta_volname, PATH_MAX, "%s.%s", + ta_brick->brick_id, + uuid_utoa(volinfo->volume_id)); + strncat(ptr, ta_volname, len); + } } ret = xlator_set_fixed_option(afr_xlators_list[index++], |