diff options
| author | Atin Mukherjee <amukherj@redhat.com> | 2014-12-12 07:21:19 +0530 |
|---|---|---|
| committer | Raghavendra Bhat <raghavendra@redhat.com> | 2015-02-26 04:00:32 -0800 |
| commit | a1d9f01b28267fc333aebc49cb81ee69dc2c24f8 (patch) | |
| tree | e8fd41b5616c8f76178d4664b877dafd2ed6ca66 /xlators/mgmt/glusterd/src/glusterd-syncop.h | |
| parent | 642355b50e792aa7b309122c871731ad887a97c0 (diff) | |
glusterd: Maintain per transaction xaction_peers list in syncop & mgmt_v3
In current implementation xaction_peers list is maintained in a global variable
(glustrd_priv_t) for syncop/mgmt_v3. This means consistency and atomicity of
peerinfo list across transactions is not guranteed when multiple syncop/mgmt_v3
transaction are going through.
We had got into a problem in mgmt_v3-locks.t which was failing spuriously, the
reason for that was two volume set operations (in two different volume) was
going through simultaneouly and both of these transaction were manipulating the
same xaction_peers structure which lead to a corrupted list. Because of which in
some cases unlock request to peer was never triggered and we end up with having
stale locks.
Solution is to maintain a per transaction local xaction_peers list for every
syncop.
Please note I've identified this problem in op-sm area as well and a separate
patch will be attempted to fix it.
Finally thanks to Krishnan Parthasarathi and Kaushal M for your constant help to
get to the root cause.
Backport URL : http://review.gluster.org/#/c/9269/
http://review.gluster.org/#/c/9422/
http://review.gluster.org/#/c/9350/
Change-Id: Ib1eaac9e5c8fc319f4e7f8d2ad965bc1357a7c63
BUG: 1176756
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/9269
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/9328
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Tested-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-syncop.h')
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-syncop.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.h b/xlators/mgmt/glusterd/src/glusterd-syncop.h index e83ea2f4c46..1944bb4e143 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.h +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.h @@ -37,11 +37,19 @@ } while (0) +#define list_for_each_local_xaction_peers(xact_peer, xact_peers_head) \ + glusterd_local_peers_t *pos = NULL; \ + for (pos = list_entry((xact_peers_head)->next, glusterd_local_peers_t,\ + op_peers_list), \ + xact_peer = pos->peerinfo; \ + &pos->op_peers_list != (xact_peers_head); \ + pos = list_entry(pos->op_peers_list.next, glusterd_local_peers_t,\ + op_peers_list), \ + xact_peer = pos->peerinfo) + int gd_syncop_submit_request (struct rpc_clnt *rpc, void *req, void *local, void *cookie, rpc_clnt_prog_t *prog, int procnum, fop_cbk_fn_t cbkfn, xdrproc_t xdrproc); - - int gd_syncop_mgmt_lock (glusterd_peerinfo_t *peerinfo, struct syncargs *arg, uuid_t my_uuid, uuid_t recv_uuid); int gd_syncop_mgmt_unlock (glusterd_peerinfo_t *peerinfo, struct syncargs *arg, @@ -59,6 +67,15 @@ gd_synctask_barrier_wait (struct syncargs *args, int count); int gd_build_peers_list (struct list_head *peers, struct list_head *xact_peers, glusterd_op_t op); + +int +gd_build_local_xaction_peers_list (struct list_head *peers, + struct list_head *xact_peers, + glusterd_op_t op); + +void +gd_cleanup_local_xaction_peers_list (struct list_head *peers); + int gd_brick_op_phase (glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict, char **op_errstr); |
