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 --- libglusterfs/src/gfdb/gfdb_data_store_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libglusterfs/src/gfdb/gfdb_data_store_types.h') diff --git a/libglusterfs/src/gfdb/gfdb_data_store_types.h b/libglusterfs/src/gfdb/gfdb_data_store_types.h index f44c4872c5b..2d3c5ede99c 100644 --- a/libglusterfs/src/gfdb/gfdb_data_store_types.h +++ b/libglusterfs/src/gfdb/gfdb_data_store_types.h @@ -649,6 +649,7 @@ typedef int gf_boolean_t _clear_counters); +typedef int (*gfdb_clear_files_heat_t)(void *db_conn); /*Data structure holding all the above plugin function pointers*/ @@ -664,10 +665,9 @@ typedef struct gfdb_db_operations { find_unchanged_for_time_freq_op; gfdb_find_recently_changed_files_freq_t find_recently_changed_files_freq_op; + gfdb_clear_files_heat_t clear_files_heat_op; } gfdb_db_operations_t; - - /******************************************************************************* * * Database connection object: This objected is maitained by libgfdb for each -- cgit