From 96af474045c9ba5ab74ca76daa823d91a0a0c610 Mon Sep 17 00:00:00 2001 From: Joseph Fernandes Date: Thu, 27 Aug 2015 17:23:07 +0530 Subject: tier/ctr: Solving DB Lock issue due to write contention from db connections Problem: The DB on the brick is been accessed by CTR, for write and tier migrator, for read and write. The write from tier migrator is reseting the heat counters after a cycle. Since we are using sqlite, two connections trying to write would cause a db lock contention. As a result CTR used to fail to update the db. Solution: Using the same db connection of CTR for reseting the heat counters. 1) Introducted a new IPC FOP for CTR 2) After the query do a ipc syncop to the underlying client xlator associated to the brick. 3) CTR in brick will catch the IPC FOP and cleat the heat counters. Change-Id: I53306bfc08dcdba479deb4ccc154896521336150 BUG: 1260730 Signed-off-by: Joseph Fernandes Reviewed-on: http://review.gluster.org/12031 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Dan Lambright Tested-by: Dan Lambright --- xlators/cluster/dht/src/tier.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/dht/src/tier.h') diff --git a/xlators/cluster/dht/src/tier.h b/xlators/cluster/dht/src/tier.h index 88fb7844dad..76ff27d5932 100644 --- a/xlators/cluster/dht/src/tier.h +++ b/xlators/cluster/dht/src/tier.h @@ -31,6 +31,7 @@ #define TIMER_SECS 3600 #include "gfdb_data_store.h" +#include "gfdb_sqlite3.h" #include #include @@ -56,10 +57,16 @@ typedef struct _gfdb_brick_dict_info { query_cbk_args_t *_query_cbk_args; } _gfdb_brick_dict_info_t; +typedef struct brick_list { + xlator_t *xlator; + char *brick_db_path; + struct list_head list; +} brick_list_t; + typedef struct _dm_thread_args { xlator_t *this; gf_defrag_info_t *defrag; - dict_t *brick_list; + struct list_head *brick_list; int freq_time; int return_value; } promotion_args_t, demotion_args_t; -- cgit