From 97ce783de326b51fcba65737f07db2c314d1e218 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Thu, 6 Feb 2014 13:03:58 +0530 Subject: glusterd: Volume locks and transaction specific opinfos With this patch we are replacing the existing cluster-wide lock taken on glusterds across the cluster, with volume locks which are also taken on glusterds across the cluster, but are volume specific. So with the volume locks we are able to perform more than one gluster operation at the same time, as long as the operations are being performed on different volumes. We maintain a global list of volume-locks (using a dict for a list) where the key is the volume name, and which saves the uuid of the originator glusterd. These locks are held and released per volume transaction. In order to acheive multiple gluster operations occuring at the same time, we also separate opinfos in the op-state-machine, as a part of this patch. To do so, we generate a unique transaction-id (uuid) per gluster transaction. An opinfo is then associated with this transaction id, which is used throughout the transaction. We maintain a run-time global list(using a dict) of transaction-ids, and their respective opinfos to achieve this. Upstream Feature Page: http://www.gluster.org/community/documentation/index.php/Features/glusterd-volume-locks Change-Id: Iaad505a854bac8de8f83beec0357eb6cde3f7ea8 BUG: 1011470 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/5994 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- libglusterfs/src/globals.h | 1 + libglusterfs/src/mem-types.h | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/globals.h b/libglusterfs/src/globals.h index 0de03925d..16ab96268 100644 --- a/libglusterfs/src/globals.h +++ b/libglusterfs/src/globals.h @@ -32,6 +32,7 @@ #define GD_OP_VERSION_MAX 4 /* MAX VERSION is the maximum count in VME table, should keep changing with introduction of newer versions */ +#define GD_OP_VERSION_4 4 /* Op-Version 4 */ #include "xlator.h" diff --git a/libglusterfs/src/mem-types.h b/libglusterfs/src/mem-types.h index 726d38eb6..26237fecb 100644 --- a/libglusterfs/src/mem-types.h +++ b/libglusterfs/src/mem-types.h @@ -119,6 +119,9 @@ enum gf_common_mem_types_ { gf_common_mt_syncopctx = 103, gf_common_mt_iobrefs = 104, gf_common_mt_gsync_status_t = 105, - gf_common_mt_end = 106 + gf_common_mt_uuid_t = 106, + gf_common_mt_vol_lock_obj_t = 107, + gf_common_mt_txn_opinfo_obj_t = 108, + gf_common_mt_end = 109 }; #endif -- cgit