diff options
author | Dan Lambright <dlambrig@redhat.com> | 2015-02-22 11:05:58 -0500 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-03-21 09:50:29 -0700 |
commit | 20355992e8eed7d3ed78a23bc7e922d6ae94860d (patch) | |
tree | c7af71245b57d867ef83edf91dbfe69e622a478d /xlators/cluster/dht/src/tier.h | |
parent | 8aa13c8e285ad496ed7c8511ae0b735eed73ebd4 (diff) |
cluster/dht: Add tier translator.
The tier translator shares most of DHT's code. It differs in how
subvolumes are chosen for I/Os, and how file migration (cache promotion
and demotion) is managed. That different functionality is split to either
DHT or tier logic according to the "tier_methods" structure.
A cache promotion and demotion thread is created in a manner
similar to the rebalance daemon. The thread operates a timing
wheel which periodically checks for promotion and demotion candidates
(files). Candidates are queued and then migrated. Candidates must exist on
the same node as the daemon and meet other critera per caching policies.
This patch has two authors (Dan Lambright and Joseph Fernandes). Dan
did the DHT changes and Joe wrote the cache policies. The fix depends on
DHT readidr changes and the database library which have been submitted
separately. Header files in libglusterfs/src/gfdb should be reviewed in
patch 9683.
For more background and design see the feature page [1].
[1]
http://www.gluster.org/community/documentation/index.php/Features/data-classification
Change-Id: Icc26c517ccecf5c42aef039f5b9c6f7afe83e46c
BUG: 1194753
Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-on: http://review.gluster.org/9724
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/tier.h')
-rw-r--r-- | xlators/cluster/dht/src/tier.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/tier.h b/xlators/cluster/dht/src/tier.h new file mode 100644 index 00000000000..73266050a5c --- /dev/null +++ b/xlators/cluster/dht/src/tier.h @@ -0,0 +1,71 @@ +/* + Copyright (c) 2015 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 _TIER_H_ +#define _TIER_H_ + +#ifndef _CONFIG_H +#define _CONFIG_H +#include "config.h" +#endif + + +/******************************************************************************/ +/* This is from dht-rebalancer.c as we dont have dht-rebalancer.h */ +#include "dht-common.h" +#include "xlator.h" +#include <signal.h> +#include <fnmatch.h> +#include <signal.h> + +#define DEFAULT_PROMOTE_FREQ_SEC 120 +#define DEFAULT_DEMOTE_FREQ_SEC 120 + +/* + * Size of timer wheel. We would not promote or demote lesd + * frequently than this number. + */ +#define TIMER_SECS 3600 + +#include "gfdb_data_store.h" +#include <ctype.h> +#include <sys/xattr.h> +#include <sys/stat.h> + +#define DEMOTION_QFILE "/var/run/gluster/demotequeryfile" +#define PROMOTION_QFILE "/var/run/gluster/promotequeryfile" + +#define GET_QFILE_PATH(is_promotion)\ + (is_promotion) ? PROMOTION_QFILE : DEMOTION_QFILE + +typedef struct _query_cbk_args { + xlator_t *this; + gf_defrag_info_t *defrag; + FILE *queryFILE; +} query_cbk_args_t; + +int +gf_run_tier(xlator_t *this, gf_defrag_info_t *defrag); + +typedef struct _gfdb_brick_dict_info { + gfdb_time_t *time_stamp; + gf_boolean_t _gfdb_promote; + query_cbk_args_t *_query_cbk_args; +} _gfdb_brick_dict_info_t; + +typedef struct _dm_thread_args { + xlator_t *this; + gf_defrag_info_t *defrag; + dict_t *brick_list; + int freq_time; + int return_value; +} promotion_args_t, demotion_args_t; + +#endif |