[sheepdog] [PATCH] sheep: reduce auto recovery log
Saeki Masaki
saeki.masaki at po.ntts.co.jp
Fri Jun 6 04:30:08 CEST 2014
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>
---
sheep/recovery.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/sheep/recovery.c b/sheep/recovery.c
index a5aa750..8d87f4c 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -901,8 +901,11 @@ static void recover_object_main(struct work *work)
wakeup_requests_on_oid(row->oid);
- 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)
goto finish_recovery;
--
1.7.1
More information about the sheepdog
mailing list