This is an automated email from the ASF dual-hosted git repository. maxyang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/cloudberry-go-libs.git
commit b93ec131a3574e842a29d0c3e5aef7621adb0c5b Author: Karen Huddleston <[email protected]> AuthorDate: Thu May 16 16:54:58 2024 -0700 Use Custom logging for CheckClusterError gpbackup recently made a change to use verbosity info by default for both shell output and logfile since we were logging too much to files by default. However, with this change we get odd behavior with CheckClusterError. It used to write segment errors to the file with verbosity Verbose which would always show up in the file because we set the file log level to Debug by default. We have a message that says "check logfile for complete list of errors", but when the logfile level is info the segment errors don't get printed. Since they are errors we should make sure we print them to the file even when the file log level is lower so customers can see them to debug. --- cluster/cluster.go | 4 ++-- cluster/cluster_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cluster/cluster.go b/cluster/cluster.go index 97fc50d..6643b97 100644 --- a/cluster/cluster.go +++ b/cluster/cluster.go @@ -388,10 +388,10 @@ func (cluster *Cluster) CheckClusterError(remoteOutput *RemoteOutput, finalErrMs case func(content int) string: content := failedCommand.Content host := cluster.GetHostForContent(content) - gplog.Verbose("%s on segment %d on host %s %s", getMessage(content), content, host, errStr) + gplog.Custom(gplog.LOGERROR, gplog.LOGVERBOSE, "%s on segment %d on host %s %s", getMessage(content), content, host, errStr) case func(host string) string: host := failedCommand.Host - gplog.Verbose("%s on host %s %s", getMessage(host), host, errStr) + gplog.Custom(gplog.LOGERROR, gplog.LOGVERBOSE, "%s on host %s %s", getMessage(host), host, errStr) } gplog.Verbose("Command was: %s", failedCommand.CommandString) } diff --git a/cluster/cluster_test.go b/cluster/cluster_test.go index eb78bde..e753ac4 100644 --- a/cluster/cluster_test.go +++ b/cluster/cluster_test.go @@ -559,7 +559,7 @@ var _ = Describe("cluster/cluster tests", func() { } defer testhelper.ShouldPanicWithMessage(fmt.Sprintf("Got an error on %s. See gbytes.Buffer for a complete list of errors.", errStr)) defer Expect(logfile).To(gbytes.Say(`\[DEBUG\]:-Command was: this is the command`)) - defer Expect(logfile).To(gbytes.Say(fmt.Sprintf(`\[DEBUG\]:-Error received on %s with error command error: exit status 1`, debugStr))) + defer Expect(logfile).To(gbytes.Say(fmt.Sprintf(`\[ERROR\]:-Error received on %s with error command error: exit status 1`, debugStr))) testCluster.CheckClusterError(remoteOutput, "Got an error", generatorFunc) }, Entry("prints error messages for a per-segment command, including coordinator", cluster.ON_SEGMENTS|cluster.INCLUDE_COORDINATOR, true, true, true), --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
