From 7c23a94516c5dd21536c259f323a3cc113fdfa0d Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 6 Nov 2012 12:18:24 +0530 Subject: mgmt/glusterd: Implementation of server-side quorum Feature-page: http://www.gluster.org/community/documentation/index.php/Features/Server-quorum Change-Id: I747b222519e71022462343d2c1bcd3626e1f9c86 BUG: 839595 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/3811 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd.h | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd.h') diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h index 00a6bd163..c2041ad31 100644 --- a/xlators/mgmt/glusterd/src/glusterd.h +++ b/xlators/mgmt/glusterd/src/glusterd.h @@ -43,7 +43,14 @@ #define GLUSTERD_TR_LOG_SIZE 50 #define GLUSTERD_NAME "glusterd" #define GLUSTERD_SOCKET_LISTEN_BACKLOG 128 +#define GLUSTERD_QUORUM_TYPE_KEY "cluster.server-quorum-type" +#define GLUSTERD_QUORUM_RATIO_KEY "cluster.server-quorum-ratio" +#define GLUSTERD_GLOBAL_OPT_VERSION "global-option-version" +#define GLUSTERD_SERVER_QUORUM "server" + +struct glusterd_volinfo_; +typedef struct glusterd_volinfo_ glusterd_volinfo_t; typedef enum glusterd_op_ { GD_OP_NONE = 0, @@ -74,7 +81,6 @@ typedef enum glusterd_op_ { GD_OP_MAX, } glusterd_op_t; - struct glusterd_store_iter_ { int fd; FILE *file; @@ -86,6 +92,7 @@ typedef struct glusterd_store_iter_ glusterd_store_iter_t; struct glusterd_volgen { dict_t *dict; }; + typedef struct { struct rpc_clnt *rpc; gf_boolean_t running; @@ -108,6 +115,12 @@ typedef struct { should keep changing with introduction of newer versions */ +typedef struct { + gf_boolean_t quorum; + double quorum_ratio; + uint64_t gl_opt_version; +} gd_global_opts_t; + typedef struct { struct _volfile_ctx *volfile; pthread_mutex_t mutex; @@ -134,11 +147,11 @@ typedef struct { #endif pthread_t brick_thread; void *hooks_priv; - xlator_t *xl; /* Should be set to 'THIS' before creating thread */ - /* need for proper handshake_t */ int op_version; /* Starts with 1 for 3.3.0 */ - + xlator_t *xl; /* Should be set to 'THIS' before creating thread */ + gf_boolean_t pending_quorum_action; + dict_t *opts; } glusterd_conf_t; @@ -170,9 +183,6 @@ struct gf_defrag_brickinfo_ { int size; }; -struct glusterd_volinfo_; -typedef struct glusterd_volinfo_ glusterd_volinfo_t; - typedef int (*defrag_cbk_fn_t) (glusterd_volinfo_t *volinfo, gf_defrag_status_t status); @@ -411,6 +421,9 @@ glusterd_friend_add (const char *hoststr, int port, gf_boolean_t restore, glusterd_peerctx_args_t *args); int +glusterd_friend_rpc_create (xlator_t *this, glusterd_peerinfo_t *peerinfo, + glusterd_peerctx_args_t *args); +int glusterd_friend_remove (uuid_t uuid, char *hostname); int -- cgit