[sheepdog] [PATCH stable-0.8 1/2] sheep: reduce auto recovery log
Hitoshi Mitake
mitake.hitoshi at gmail.com
Thu Jun 12 15:26:05 CEST 2014
From: Saeki Masaki <saeki.masaki at po.ntts.co.jp>
Currently, auto recovery process produces one log message per one object.
The log messages consume too large disk space when a cluster has many
objects. This patch reduces the disk consumption by printing progress in a
style of percentage. The existing message is logged in debug level.
Signed-off-by: Saeki Masaki <saeki.masaki at po.ntts.co.jp>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
sheep/recovery.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/sheep/recovery.c b/sheep/recovery.c
index d8ba77b..2f13962 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -858,8 +858,11 @@ static void recover_object_main(struct work *work)
wakeup_requests_on_oid(row->oid);
rinfo->done++;
- sd_info("object %"PRIx64" is recovered (%"PRIu64"/%"PRIu64")", row->oid,
- rinfo->done, rinfo->count);
+ if (!(rinfo->done % (rinfo->count/100)))
+ sd_info("object recovery progress %3.0lf%% ",
+ (double)rinfo->done / rinfo->count * 100);
+ sd_debug("object %"PRIx64" is recovered (%"PRIu64"/%"PRIu64")",
+ row->oid, rinfo->done, rinfo->count);
if (rinfo->done < rinfo->count) {
recover_next_object(rinfo);
--
1.9.1
More information about the sheepdog
mailing list