summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/gfdb/gfdb_data_store.h
diff options
context:
space:
mode:
authorJoseph Fernandes <josferna@redhat.com>2015-09-18 19:57:54 +0530
committerDan Lambright <dlambrig@redhat.com>2015-10-09 16:58:53 -0700
commit489f02879afd940d201d092720dbf13b2922b134 (patch)
tree1d29e56c9307b0f7722c757bc6d807aeed289d4d /libglusterfs/src/gfdb/gfdb_data_store.h
parentd777b2feaf55347177d6786657d68cc0547f7f73 (diff)
tier/ctr: Solution for db locks for tier migrator and ctr using sqlite version less than 3.7 i.e rhel 6.7
Problem: On RHEL 6.7, we have sqlite version 3.6.2 which doesnt support WAL journaling mode, as this journaling mode is only available in sqlite 3.7 and above. As a result we cannot have to progreses concurrently accessing sqlite, without running into db locks! Well WAL is also need for performace on CTR side. Solution: This solution is to use CTR db connection for doing queries when WAL mode is absent. i,e tier migrator will send sync_op ipc calls to CTR, which in turn will do the query and create/update the query file suggested by tier migrator. Pending: Well this solution will stop the db locks but the performance is still an issue for CTR. We are developing an in-Memory Transaction Log (iMeTaL) which will help boost the CTR performance by doing in memory udpates on the IO path and later flush the updates to the db in a batch/segment flush. Master patch: http://review.gluster.org/#/c/12191 >> Change-Id: Ie3149643ded159234b5cc6aa6cf93b9022c2f124 >> BUG: 1240577 >> Signed-off-by: Joseph Fernandes <josferna@redhat.com> >> Signed-off-by: Dan Lambright <dlambrig@redhat.com> >> Signed-off-by: Joseph Fernandes <josferna@redhat.com> >> Reviewed-on: http://review.gluster.org/12191 >> Tested-by: Gluster Build System <jenkins@build.gluster.com> >> Reviewed-by: Luis Pabon <lpabon@redhat.com> Signed-off-by: Joseph Fernandes <josferna@redhat.com> Change-Id: Ie8c7a7e9566244c104531b579126bb57fbc6e32b BUG: 1270123 Reviewed-on: http://review.gluster.org/12325 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'libglusterfs/src/gfdb/gfdb_data_store.h')
-rw-r--r--libglusterfs/src/gfdb/gfdb_data_store.h88
1 files changed, 87 insertions, 1 deletions
diff --git a/libglusterfs/src/gfdb/gfdb_data_store.h b/libglusterfs/src/gfdb/gfdb_data_store.h
index 2eb7edf1338..58a942c2d39 100644
--- a/libglusterfs/src/gfdb/gfdb_data_store.h
+++ b/libglusterfs/src/gfdb/gfdb_data_store.h
@@ -25,6 +25,42 @@
#include "gfdb_data_store_types.h"
+#define GFDB_IPC_CTR_KEY "gfdb.ipc-ctr-op"
+
+/*
+ * CTR IPC OPERATIONS
+ *
+ *
+ */
+#define GFDB_IPC_CTR_QUERY_OPS "gfdb.ipc-ctr-query-op"
+#define GFDB_IPC_CTR_CLEAR_OPS "gfdb.ipc-ctr-clear-op"
+#define GFDB_IPC_CTR_GET_DB_PARAM_OPS "gfdb.ipc-ctr-get-db-parm"
+#define GFDB_IPC_CTR_GET_DB_VERSION_OPS "gfdb.ipc-ctr-get-db-version"
+
+/*
+ * CTR IPC INPUT/OUTPUT
+ *
+ *
+ */
+#define GFDB_IPC_CTR_GET_QFILE_PATH "gfdb.ipc-ctr-get-qfile-path"
+#define GFDB_IPC_CTR_GET_QUERY_PARAMS "gfdb.ipc-ctr-get-query-parms"
+#define GFDB_IPC_CTR_RET_QUERY_COUNT "gfdb.ipc-ctr-ret-rec-count"
+#define GFDB_IPC_CTR_GET_DB_KEY "gfdb.ipc-ctr-get-params-key"
+#define GFDB_IPC_CTR_RET_DB_VERSION "gfdb.ipc-ctr-ret-db-version"
+
+/*
+ * gfdb ipc ctr params for query
+ *
+ *
+ */
+typedef struct gfdb_ipc_ctr_params {
+ gf_boolean_t is_promote;
+ int write_freq_threshold;
+ int read_freq_threshold;
+ gfdb_time_t time_stamp;
+} gfdb_ipc_ctr_params_t;
+
+
/* GFDB Connection Node:
* ~~~~~~~~~~~~~~~~~~~~
* Represents the connection to the database while using libgfdb
@@ -255,6 +291,51 @@ typedef int (*find_recently_changed_files_freq_t) (gfdb_conn_node_t *_conn_node,
int
clear_files_heat (gfdb_conn_node_t *_conn_node);
+typedef int (*clear_files_heat_t) (gfdb_conn_node_t *_conn_node);
+
+
+
+/* Libgfdb API Function: Function to extract version of the db
+ * Arguments:
+ * gfdb_conn_node_t *_conn_node : GFDB Connection node
+ * char **version : the version is extracted as a string and will be stored in
+ * this variable. The freeing of the memory should be done by
+ * the caller.
+ * Return:
+ * On success return the length of the version string that is
+ * extracted.
+ * On failure return -1
+ * */
+int
+get_db_version (gfdb_conn_node_t *_conn_node, char **version);
+
+typedef int (*get_db_version_t)(gfdb_conn_node_t *_conn_node,
+ char **version);
+
+
+/* Libgfdb API Function: Function to extract setting from the db
+ * Arguments:
+ * gfdb_conn_node_t *_conn_node : GFDB Connection node
+ * char *param_key : setting to be extracted
+ * char **param_value : the value of the setting that is
+ * extracted. This function will allocate memory
+ * to pragma_value. The caller should free the memory.
+ * Return:
+ * On success return the lenght of the pragma/setting value that is
+ * extracted.
+ * On failure return -1
+ * */
+int
+get_db_setting (gfdb_conn_node_t *_conn_node,
+ char *param_key,
+ char **param_value);
+
+typedef int (*get_db_setting_t)(gfdb_conn_node_t *db_conn,
+ char *param_key,
+ char **param_value);
+
+
+
typedef struct gfdb_methods_s {
init_db_t init_db;
fini_db_t fini_db;
@@ -262,8 +343,13 @@ typedef struct gfdb_methods_s {
find_recently_changed_files_t find_recently_changed_files;
find_unchanged_for_time_freq_t find_unchanged_for_time_freq;
find_recently_changed_files_freq_t find_recently_changed_files_freq;
+ clear_files_heat_t clear_files_heat;
+ get_db_version_t get_db_version;
+ get_db_setting_t get_db_setting;
+ /* Do not expose dbpath directly. Expose it via an */
+ /* access function: get_db_path_key(). */
char *dbpath;
- get_db_path_t get_db_path;
+ get_db_path_t get_db_path_key;
} gfdb_methods_t;
void get_gfdb_methods (gfdb_methods_t *methods);