From: Saeki Masaki <saeki.mas...@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.mas...@po.ntts.co.jp> Signed-off-by: Liu Yuan <namei.u...@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 -- sheepdog mailing list sheepdog@lists.wpkg.org http://lists.wpkg.org/mailman/listinfo/sheepdog