From 85173e43faba9bbedd287a4103c129e289829e1f Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Thu, 21 May 2015 19:55:02 +0530 Subject: features/bitrot: reimplement scrubbing frequency This patch reimplments existing scrub-frequency mechanism used to schedule scrubber runs. Existing mechanism uses periodic sleeps (waking up periodically on minimum granularity) and performing a number of tracking checks based on counters and sleep times. This patch does away with all the nifty counters and uses timer-wheel to schedule scrub runs. Scheduling changes are peformed by merely calculating the new expiry time and calling mod_timer() [mod_timer_pending() in some cases] making the code more debuggable and easier to follow. This also introduces "hourly" scrubbing tunable as an aid for testing scrubbing during development/testing cycle. One could also implement on-demand scrubbing with ease: by invoking mod_timer() with an expiry of one (1) second, thereby scheduling a scrub run the very next second. Change-Id: I6c7c5f0c6c9f886bf574d88c04cde14b76e60a8b BUG: 1224647 Signed-off-by: Venky Shankar Reviewed-on: http://review.gluster.org/10902 Tested-by: Gluster Build System Tested-by: NetBSD Build System --- cli/src/cli-cmd-parser.c | 3 ++- cli/src/cli-cmd-volume.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index d4c846acd0a..2390822e5df 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -4967,7 +4967,8 @@ cli_cmd_bitrot_parse (const char **words, int wordcount, dict_t **options) "scrub", NULL}; char *scrub_throt_values[] = {"lazy", "normal", "aggressive", NULL}; - char *scrub_freq_values[] = {"daily", "weekly", + char *scrub_freq_values[] = {"hourly", + "daily", "weekly", "biweekly", "monthly", NULL}; char *scrub_values[] = {"pause", "resume", diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 4cb82a70719..da6603cc1f6 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -2691,7 +2691,7 @@ struct cli_cmd volume_cmds[] = { }, {"volume bitrot {enable|disable} |\n" "volume bitrot scrub-throttle {lazy|normal|aggressive} |\n" - "volume bitrot scrub-frequency {daily|weekly|biweekly" + "volume bitrot scrub-frequency {hourly|daily|weekly|biweekly" "|monthly} |\n" "volume bitrot scrub {pause|resume}", cli_cmd_bitrot_cbk, -- cgit