a3470f
From 9c31bcd6c4234b6a9e4e04410caf98d2cd3d4946 Mon Sep 17 00:00:00 2001
a3470f
From: karthik-us <ksubrahm@redhat.com>
a3470f
Date: Fri, 17 Nov 2017 18:23:23 +0530
a3470f
Subject: [PATCH 083/128] cluster/afr: Print heal info split-brain output in
a3470f
 stream fashion
a3470f
a3470f
Problem:
a3470f
When we trigger the heal info split-brain command the o/p is not
a3470f
streamed as it is received, but dumped at the end for all the bricks
a3470f
together. This gives a perception that the command is hung.
a3470f
a3470f
Fix:
a3470f
When we get a split brain entry while crawling throught the pending
a3470f
heal entries, flush that immediately so that it prints the output
a3470f
in a stream fashion and doesn't look like the cli is hung.
a3470f
a3470f
Upstream patch: https://review.gluster.org/#/c/18570/
a3470f
a3470f
> Change-Id: I7547e86b83202d66616749b8b31d4d0dff0abf07
a3470f
> BUG: 1506104
a3470f
> Signed-off-by: karthik-us <ksubrahm@redhat.com>
a3470f
a3470f
Change-Id: I7547e86b83202d66616749b8b31d4d0dff0abf07
a3470f
BUG: 1419438
a3470f
Signed-off-by: karthik-us <ksubrahm@redhat.com>
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/123563
a3470f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
a3470f
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
a3470f
---
a3470f
 heal/src/glfs-heal.c | 2 ++
a3470f
 1 file changed, 2 insertions(+)
a3470f
a3470f
diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c
a3470f
index 22c9395..532b6f9 100644
a3470f
--- a/heal/src/glfs-heal.c
a3470f
+++ b/heal/src/glfs-heal.c
a3470f
@@ -120,6 +120,7 @@ void
a3470f
 glfsh_print_hr_spb_status (char *path, uuid_t gfid, char *status)
a3470f
 {
a3470f
         printf ("%s\n", path);
a3470f
+        fflush (stdout);
a3470f
         return;
a3470f
 }
a3470f
 
a3470f
@@ -133,6 +134,7 @@ void
a3470f
 glfsh_print_hr_heal_status (char *path, uuid_t gfid, char *status)
a3470f
 {
a3470f
         printf ("%s%s\n", path, status);
a3470f
+        fflush (stdout);
a3470f
 }
a3470f
 
a3470f
 #if (HAVE_LIB_XML)
a3470f
-- 
a3470f
1.8.3.1
a3470f