From 1a7cf012d2717454d2f83949cd7aa0c462ae1b3d Mon Sep 17 00:00:00 2001 From: karthik-us Date: Wed, 25 Oct 2017 12:42:23 +0530 Subject: cluster/afr: Print heal info split-brain output in stream fashion Problem: When we trigger the heal info split-brain command the o/p is not streamed as it is received, but dumped at the end for all the bricks together. This gives a perception that the command is hung. Fix: When we get a split brain entry while crawling throught the pending heal entries, flush that immediately so that it prints the output in a stream fashion and doesn't look like the cli is hung. Change-Id: I7547e86b83202d66616749b8b31d4d0dff0abf07 BUG: 1514419 Signed-off-by: karthik-us (cherry picked from commit 05f9c13f4d69e4113f5a851f4097ef35ba3f33b2) --- heal/src/glfs-heal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c index 27a9624db9e..13f888f8b2c 100644 --- a/heal/src/glfs-heal.c +++ b/heal/src/glfs-heal.c @@ -120,6 +120,7 @@ void glfsh_print_hr_spb_status (char *path, uuid_t gfid, char *status) { printf ("%s\n", path); + fflush (stdout); return; } @@ -133,6 +134,8 @@ void glfsh_print_hr_heal_status (char *path, uuid_t gfid, char *status) { printf ("%s%s\n", path, status); + fflush (stdout); + return; } #if (HAVE_LIB_XML) -- cgit