summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd.h
diff options
context:
space:
mode:
authorhari gowtham <hgowtham@redhat.com>2016-07-12 16:40:28 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-01-16 20:49:47 -0800
commit3263d1c4f4b7efd1a018c17e1ba4dd9245094f48 (patch)
treedc1ca7a0236244ccd4dc4d8cd157afe8e543f6f7 /xlators/mgmt/glusterd/src/glusterd.h
parent514522d12e15e5632a0ff89785618b37dad7f5dd (diff)
tier : Tier as a service
tierd is implemented by separating from rebalance process. The commands affected: 1) Attach tier will trigger this process instead of old one 2) tier start and tier start force will also trigger this process. 3) volume status [tier] will show tier daemon as a process instead of task and normal tier status and tier detach status works. 4) tier stop implemented. 5) detach tier implemented separately along with new detach tier status 6) volume tier volname status will work using the changes. 7) volume set works This patch has separated the tier translator from the legacy DHT rebalance code. It now sends the RPCs from the CLI to glusterd separate to the DHT rebalance code. The daemon is now a service, similar to the snapshot daemon, and can be viewed using the volume status command. The code for the validation and commit phase are the same as the earlier tier validation code in DHT rebalance. The “brickop” phase has been changed so that the status command can use this framework. The service management framework is now used. DHT rebalance does not use this framework. This service framework takes care of : *) spawning the daemon, killing it and other such processes. *) volume set options , which are written on the volfile. *) restart and reconfigure functions. Restart is to restart the daemon at two points 1)after gluster goes down and comes up. 2) to stop detach tier. *) reconfigure is used to make immediate volfile changes. By doing this, we don’t restart the daemon. it has the code to rewrite the volfile for topological changes too (which comes into place during add and remove brick). With this patch the log, pid, and volfile are separated and put into respective directories. Change-Id: I3681d0d66894714b55aa02ca2a30ac000362a399 BUG: 1313838 Signed-off-by: hari gowtham <hgowtham@redhat.com> Reviewed-on: http://review.gluster.org/13365 Smoke: Gluster Build System <jenkins@build.gluster.org> Tested-by: hari gowtham <hari.gowtham005@gmail.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h44
1 files changed, 43 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index 9d3d867e64c..e6a4d8b65a8 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -28,6 +28,7 @@
#include "rpcsvc.h"
#include "glusterd-sm.h"
#include "glusterd-snapd-svc.h"
+#include "glusterd-tierd-svc.h"
#include "glusterd-bitd-svc.h"
#include "glusterd1-xdr.h"
#include "protocol-common.h"
@@ -125,6 +126,11 @@ typedef enum glusterd_op_ {
GD_OP_SCRUB_ONDEMAND,
GD_OP_RESET_BRICK,
GD_OP_MAX_OPVERSION,
+ GD_OP_TIER_START_STOP,
+ GD_OP_TIER_STATUS,
+ GD_OP_DETACH_TIER_STATUS,
+ GD_OP_DETACH_NOT_STARTED,
+ GD_OP_REMOVE_TIER_BRICK,
GD_OP_MAX,
} glusterd_op_t;
@@ -300,7 +306,6 @@ struct glusterd_bitrot_scrub_ {
typedef struct glusterd_bitrot_scrub_ glusterd_bitrot_scrub_t;
-
struct glusterd_rebalance_ {
gf_defrag_status_t defrag_status;
uint64_t rebalance_files;
@@ -354,6 +359,7 @@ struct glusterd_volinfo_ {
glusterd_snap_t *snapshot;
uuid_t restored_from_snap;
gd_tier_info_t tier_info;
+ gf_boolean_t is_tier_enabled;
char parent_volname[GD_VOLUME_NAME_MAX];
/* In case of a snap volume
i.e (is_snap_volume == TRUE) this
@@ -410,6 +416,8 @@ struct glusterd_volinfo_ {
/* Bitrot scrub status*/
glusterd_bitrot_scrub_t bitrot_scrub;
+ glusterd_rebalance_t tier;
+
int version;
uint32_t quota_conf_version;
uint32_t cksum;
@@ -438,6 +446,7 @@ struct glusterd_volinfo_ {
gd_quorum_status_t quorum_status;
glusterd_snapdsvc_t snapd;
+ glusterd_tierdsvc_t tierd;
int32_t quota_xattr_version;
};
@@ -489,6 +498,7 @@ typedef enum gd_node_type_ {
GD_NODE_SNAPD,
GD_NODE_BITD,
GD_NODE_SCRUB,
+ GD_NODE_TIERD
} gd_node_type;
typedef enum missed_snap_stat {
@@ -574,6 +584,17 @@ typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args);
snprintf (path, PATH_MAX, "%s/vols/%s", priv->workdir, \
volinfo->volname); \
}
+#define GLUSTERD_GET_TIER_DIR(path, volinfo, priv) do { \
+ snprintf (path, PATH_MAX, "%s/tier/%s", priv->workdir, \
+ volinfo->volname); \
+ } while (0)
+
+#define GLUSTERD_GET_TIER_PID_FILE(path, volinfo, priv) do { \
+ char tier_path[PATH_MAX]; \
+ GLUSTERD_GET_TIER_DIR(tier_path, volinfo, priv); \
+ snprintf (path, PATH_MAX, "%s/run/%s-tierd.pid", tier_path,\
+ volinfo->volname); \
+ } while (0)
#define GLUSTERD_GET_SNAP_DIR(path, snap, priv) \
snprintf (path, PATH_MAX, "%s/snaps/%s", priv->workdir, \
@@ -895,6 +916,9 @@ int
glusterd_handle_add_brick (rpcsvc_request_t *req);
int
+glusterd_handle_tier (rpcsvc_request_t *req);
+
+int
glusterd_handle_attach_tier (rpcsvc_request_t *req);
int
@@ -912,6 +936,15 @@ glusterd_handle_log_rotate (rpcsvc_request_t *req);
int
glusterd_handle_sync_volume (rpcsvc_request_t *req);
+int
+glusterd_defrag_start_validate (glusterd_volinfo_t *volinfo, char *op_errstr,
+ size_t len, glusterd_op_t op);
+
+int
+glusterd_rebalance_cmd_validate (int cmd, char *volname,
+ glusterd_volinfo_t **volinfo,
+ char *op_errstr, size_t len);
+
int32_t
glusterd_log_filename (rpcsvc_request_t *req, dict_t *dict);
@@ -1207,7 +1240,16 @@ glusterd_should_i_stop_bitd ();
int
glusterd_remove_brick_migrate_cbk (glusterd_volinfo_t *volinfo,
gf_defrag_status_t status);
+/* tier */
int
__glusterd_handle_reset_brick (rpcsvc_request_t *req);
+int glusterd_op_stage_tier (dict_t *dict, char **op_errstr, dict_t *rsp_dict);
+int glusterd_op_tier_start_stop (dict_t *dict, char **op_errstr,
+ dict_t *rsp_dict);
+int glusterd_op_remove_tier_brick (dict_t *dict, char **op_errstr,
+ dict_t *rsp_dict);
+int
+glusterd_tier_prevalidate (dict_t *dict, char **op_errstr,
+ dict_t *rsp_dict, uint32_t *op_errno);
#endif