Skip to content

Commit

Permalink
quiesce, gfproxy: Implement failover across multiple gfproxy nodes
Browse files Browse the repository at this point in the history
Updates: gluster#242
Change-Id: I767e574a26e922760a7130bd209c178d74e8cf69
Signed-off-by: Poornima G <[email protected]>
  • Loading branch information
Poornima G authored and amarts committed Sep 11, 2018
1 parent d2a9c17 commit 192231e
Show file tree
Hide file tree
Showing 12 changed files with 319 additions and 83 deletions.
3 changes: 2 additions & 1 deletion libglusterfs/src/glfs-message-id.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ enum _msgid_comp {
GLFS_MSGID_COMP(NLC, 1),
GLFS_MSGID_COMP(SL, 1),
GLFS_MSGID_COMP(HAM, 1),
GLFS_MSGID_COMP(SDFS, 1),
GLFS_MSGID_COMP(SDFS, 1),
GLFS_MSGID_COMP(QUIESCE, 1),

/* --- new segments for messages goes above this line --- */

Expand Down
3 changes: 3 additions & 0 deletions libglusterfs/src/glusterfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@

#define CTR_ATTACH_TIER_LOOKUP "ctr_attach_tier_lookup"

#define CLIENT_CMD_CONNECT "trusted.glusterfs.client-connect"
#define CLIENT_CMD_DISCONNECT "trusted.glusterfs.client-disconnect"

#define GF_LOG_LRU_BUFSIZE_DEFAULT 5
#define GF_LOG_LRU_BUFSIZE_MIN 0
#define GF_LOG_LRU_BUFSIZE_MAX 20
Expand Down
2 changes: 2 additions & 0 deletions tests/basic/gfproxy.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ TEST glusterd
TEST pidof glusterd
TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{0,1,2}
TEST $CLI volume set $V0 config.gfproxyd enable
TEST $CLI volume set $V0 failover-hosts "127.0.0.1,192.168.122.215,192.168.122.90"
TEST $CLI volume set $V0 client-log-level TRACE
TEST $CLI volume start $V0

sleep 2
Expand Down
2 changes: 1 addition & 1 deletion xlators/features/quiesce/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ quiesce_la_LDFLAGS = -module $(GF_XLATOR_DEFAULT_LDFLAGS)
quiesce_la_SOURCES = quiesce.c
quiesce_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la

noinst_HEADERS = quiesce.h quiesce-mem-types.h
noinst_HEADERS = quiesce.h quiesce-mem-types.h quiesce-messages.h

AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src \
-I$(top_srcdir)/rpc/xdr/src -I$(top_builddir)/rpc/xdr/src
Expand Down
1 change: 1 addition & 0 deletions xlators/features/quiesce/src/quiesce-mem-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

enum gf_quiesce_mem_types_ {
gf_quiesce_mt_priv_t = gf_common_mt_end + 1,
gf_quiesce_mt_failover_hosts,
gf_quiesce_mt_end
};
#endif
31 changes: 31 additions & 0 deletions xlators/features/quiesce/src/quiesce-messages.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com>
* This file is part of GlusterFS.
*
* This file is licensed to you under your choice of the GNU Lesser
* General Public License, version 3 or any later version (LGPLv3 or
* later), or the GNU General Public License, version 2 (GPLv2), in all
* cases as published by the Free Software Foundation.
*/

#ifndef __QUIESCE_MESSAGES_H__
#define __QUIESCE_MESSAGES_H__

#include "glfs-message-id.h"

/* To add new message IDs, append new identifiers at the end of the list.
*
* Never remove a message ID. If it's not used anymore, you can rename it or
* leave it as it is, but not delete it. This is to prevent reutilization of
* IDs by other messages.
*
* The component name must match one of the entries defined in
* glfs-message-id.h.
*/

GLFS_MSGID(QUIESCE,
QUIESCE_MSG_INVAL_HOST,
QUIESCE_MSG_FAILOVER_FAILED
);

#endif /* __NL_CACHE_MESSAGES_H__ */
Loading

0 comments on commit 192231e

Please sign in to comment.