summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtests/bugs/bug-1095097.t21
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c11
2 files changed, 29 insertions, 3 deletions
diff --git a/tests/bugs/bug-1095097.t b/tests/bugs/bug-1095097.t
new file mode 100755
index 00000000000..9f9db7a3df5
--- /dev/null
+++ b/tests/bugs/bug-1095097.t
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+
+cleanup;
+TEST glusterd;
+TEST pidof glusterd;
+TEST $CLI volume info;
+
+TEST $CLI volume create $V0 $H0:$B0/brick1 $H0:$B1/brick1;
+EXPECT 'Created' volinfo_field $V0 'Status';
+
+TEST $CLI volume start $V0;
+EXPECT 'Started' volinfo_field $V0 'Status';
+
+TEST $CLI volume profile $V0 start
+TEST $CLI volume profile $V0 info
+TEST $CLI volume replace-brick $V0 $H0:$B0/brick1 $H0:$B0/brick2 start
+TEST $CLI volume replace-brick $V0 $H0:$B0/brick1 $H0:$B0/brick2 status
+
+cleanup;
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 868a58be5b6..edafb5469ae 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -3565,6 +3565,7 @@ glusterd_op_start_rb_timer (dict_t *dict, uuid_t *txn_id)
glusterd_conf_t *priv = NULL;
int32_t ret = -1;
dict_t *rb_ctx = NULL;
+ uuid_t *rb_txn_id = NULL;
GF_ASSERT (dict);
priv = THIS->private;
@@ -3581,10 +3582,14 @@ glusterd_op_start_rb_timer (dict_t *dict, uuid_t *txn_id)
goto out;
}
+ rb_txn_id = GF_CALLOC (1, sizeof(uuid_t), gf_common_mt_uuid_t);
+ if (!rb_txn_id)
+ goto out;
+
+ uuid_copy (*rb_txn_id, *txn_id);
timeout.tv_sec = 5;
timeout.tv_nsec = 0;
-
rb_ctx = dict_copy (dict, rb_ctx);
if (!rb_ctx) {
gf_log (THIS->name, GF_LOG_ERROR, "Couldn't copy "
@@ -3594,14 +3599,14 @@ glusterd_op_start_rb_timer (dict_t *dict, uuid_t *txn_id)
}
ret = dict_set_bin (rb_ctx, "transaction_id",
- txn_id, sizeof (*txn_id));
+ rb_txn_id, sizeof (*rb_txn_id));
if (ret) {
gf_log ("", GF_LOG_ERROR,
"Failed to set transaction id.");
goto out;
} else
gf_log ("", GF_LOG_DEBUG,
- "transaction_id = %s", uuid_utoa (*txn_id));
+ "transaction_id = %s", uuid_utoa (*rb_txn_id));
priv->timer = gf_timer_call_after (THIS->ctx, timeout,
glusterd_do_replace_brick,