From d17ecc3b5ce59aa38d89ac786b36b31281f5ac88 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Fri, 12 Oct 2018 12:45:37 +0200 Subject: [PATCH] replication/fsrep: report Pending[0] problem as fsrep problem in RetryWait state --- replication/fsrep/fsfsm.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/replication/fsrep/fsfsm.go b/replication/fsrep/fsfsm.go index a8c836e..2397309 100644 --- a/replication/fsrep/fsfsm.go +++ b/replication/fsrep/fsfsm.go @@ -312,6 +312,13 @@ func (fsr *Replication) Report() *Report { for i := range fsr.pending { rep.Pending[i] = fsr.pending[i].Report() } + + if fsr.state&RetryWait != 0 { + if len(rep.Pending) != 0 { // should always be true for RetryWait == true? + rep.Problem = rep.Pending[0].Problem + } + } + return &rep } @@ -509,10 +516,15 @@ func (s *ReplicationStep) Report() *StepReport { if s.byteCounter != nil { bytes = s.byteCounter.Bytes() } + problem := "" + if s.err != nil { + problem = s.err.Error() + } rep := StepReport{ From: from, To: s.to.RelName(), Status: s.state, + Problem: problem, Bytes: bytes, ExpectedBytes: s.expectedSize, }