summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorJoseph Fernandes <josferna@redhat.com>2015-07-13 18:45:11 +0530
committerDan Lambright <dlambrig@redhat.com>2015-08-12 06:47:43 -0700
commitb5a98df6343da6229b1b102883d8e992cd4a55a5 (patch)
treeb06d3300386803208d4426cc901ac5bcf0ba52f4 /libglusterfs
parente8ea08d9a9ca9e507919c121b3a2e56fd5f580f4 (diff)
tier/libgfdb : Setting Freq counters of un-selected files to zero
Change Time Recorder increments the write/read frequency counters on a read or write of a file, if the "features.record-counters" is "on". It is the responsibility of the tiering migrator to reset these counters to zero for un-selected files to reset them to zero as frequency counters are function of promotion/Demotion cycles. If the counters are not set to zero then, 1) the counters may overflow in the DB 2) The file may be wrongly promoted or demoted. This fix will reset the freq counters of un-selected files to zero after promotion/demotion frequency. Change-Id: Ideea2c76a52d421a7e67c37fb0c823f552b3da7a BUG: 1242504 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/11648 Tested-by: Joseph Fernandes Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/gfdb/gfdb_sqlite3.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libglusterfs/src/gfdb/gfdb_sqlite3.c b/libglusterfs/src/gfdb/gfdb_sqlite3.c
index 349ff60f541..5f4a0fc94ae 100644
--- a/libglusterfs/src/gfdb/gfdb_sqlite3.c
+++ b/libglusterfs/src/gfdb/gfdb_sqlite3.c
@@ -726,6 +726,15 @@ gf_sqlite3_find_recently_changed_files(void *db_conn,
goto out;
}
+ /*Clear freq counters of un-selected data*/
+ ret = gf_sql_clear_counters(sql_conn);
+ if (ret) {
+ gf_msg (GFDB_STR_SQLITE3, GF_LOG_ERROR, 0,
+ LG_MSG_CLEAR_COUNTER_FAILED, "Failed clearing"
+ " counters!");
+ goto out;
+ }
+
ret = 0;
out:
sqlite3_finalize(prep_stmt);
@@ -811,6 +820,15 @@ gf_sqlite3_find_unchanged_for_time (void *db_conn,
goto out;
}
+ /*Clear freq counters of un-selected data*/
+ ret = gf_sql_clear_counters(sql_conn);
+ if (ret) {
+ gf_msg (GFDB_STR_SQLITE3, GF_LOG_ERROR, 0,
+ LG_MSG_CLEAR_COUNTER_FAILED, "Failed clearing"
+ " counters!");
+ goto out;
+ }
+
ret = 0;
out:
sqlite3_finalize(prep_stmt);