From 57756cc0cc8dd517d1e2c4f544249fa132cc3426 Mon Sep 17 00:00:00 2001 From: Adam Lee Date: Thu, 22 Oct 2020 15:35:50 +0800 Subject: [PATCH] gprecoverseg: log the error if pg_rewind fails It didn't log the error message before if pg_rewind fails, fix that to make DBA/field/developer's life eaisier. Before this: ``` 20201022:15:19:10:011118 gprecoverseg:earth:adam-[INFO]:-Running pg_rewind on required mirrors 20201022:15:19:12:011118 gprecoverseg:earth:adam-[WARNING]:-Incremental recovery failed for dbid 2. You must use gprecoverseg -F to recover the segment. 20201022:15:19:12:011118 gprecoverseg:earth:adam-[INFO]:-Starting mirrors 20201022:15:19:12:011118 gprecoverseg:earth:adam-[INFO]:-era is 0406b847bf226356_201022151031 ``` After this: ``` 20201022:15:33:31:019577 gprecoverseg:earth:adam-[INFO]:-Running pg_rewind on required mirrors 20201022:15:33:31:019577 gprecoverseg:earth:adam-[WARNING]:-pg_rewind: fatal: could not find common ancestor of the source and target cluster's timelines 20201022:15:33:31:019577 gprecoverseg:earth:adam-[WARNING]:-Incremental recovery failed for dbid 2. You must use gprecoverseg -F to recover the segment. 20201022:15:33:31:019577 gprecoverseg:earth:adam-[INFO]:-Starting mirrors 20201022:15:33:31:019577 gprecoverseg:earth:adam-[INFO]:-era is 0406b847bf226356_201022151031 ``` --- gpMgmt/bin/gppylib/operations/buildMirrorSegments.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gpMgmt/bin/gppylib/operations/buildMirrorSegments.py b/gpMgmt/bin/gppylib/operations/buildMirrorSegments.py index 0157e1b54c..bd16717049 100644 --- a/gpMgmt/bin/gppylib/operations/buildMirrorSegments.py +++ b/gpMgmt/bin/gppylib/operations/buildMirrorSegments.py @@ -394,6 +394,7 @@ class GpMirrorListToBuild: if not cmd.was_successful(): dbid = int(cmd.name.split(':')[1].strip()) self.__logger.debug("%s failed" % cmd.name) + self.__logger.warning(cmd.get_stdout()) self.__logger.warning("Incremental recovery failed for dbid %d. You must use gprecoverseg -F to recover the segment." % dbid) rewindFailedSegments.append(rewindInfo[dbid].targetSegment) -- GitLab