From 430dd7902a79a21efb35c2d13c8c8c014c8a2948 Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Mon, 23 Dec 2024 16:06:59 +0530 Subject: [PATCH] server: fix over redacted log lines Previosuly, few log lines were getting redacted assuming that it contains sensitive information. Support team was facing challenges during dignostics. To address this, this patch address few of the log lines which were overly redacted. Epic: CRDB-37533 Part of: CRDB-44885 Release note: None --- pkg/server/auto_upgrade.go | 8 ++++---- pkg/server/migration.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/server/auto_upgrade.go b/pkg/server/auto_upgrade.go index c17d8738b82b..7f821966725a 100644 --- a/pkg/server/auto_upgrade.go +++ b/pkg/server/auto_upgrade.go @@ -49,7 +49,7 @@ func (s *topLevelServer) startAttemptUpgrade(ctx context.Context) error { for r := retry.StartWithCtx(ctx, retryOpts); r.Next(); { clusterVersion, err := s.clusterVersion(ctx) if err != nil { - log.Errorf(ctx, "unable to retrieve cluster version: %v", err) + log.Errorf(ctx, "unable to retrieve cluster version: %v", redact.Safe(err)) continue } @@ -58,10 +58,10 @@ func (s *topLevelServer) startAttemptUpgrade(ctx context.Context) error { status, err := s.upgradeStatus(ctx, clusterVersion) switch status { case UpgradeBlockedDueToError: - log.Errorf(ctx, "failed attempt to upgrade cluster version, error: %v", err) + log.Errorf(ctx, "failed attempt to upgrade cluster version, error: %v", redact.Safe(err)) continue case UpgradeBlockedDueToMixedVersions: - log.Infof(ctx, "failed attempt to upgrade cluster version: %v", err) + log.Infof(ctx, "failed attempt to upgrade cluster version: %v", redact.Safe(err)) continue case UpgradeDisabledByConfigurationToPreserveDowngrade: log.Infof(ctx, "auto upgrade is disabled by preserve_downgrade_option") @@ -101,7 +101,7 @@ func (s *topLevelServer) startAttemptUpgrade(ctx context.Context) error { sessiondata.NodeUserSessionDataOverride, "SET CLUSTER SETTING version = crdb_internal.node_executable_version();", ); err != nil { - log.Errorf(ctx, "error when finalizing cluster version upgrade: %v", err) + log.Errorf(ctx, "error when finalizing cluster version upgrade: %v", redact.Safe(err)) } else { log.Info(ctx, "successfully upgraded cluster version") return diff --git a/pkg/server/migration.go b/pkg/server/migration.go index 1406c5f12c3f..bc2f412a9669 100644 --- a/pkg/server/migration.go +++ b/pkg/server/migration.go @@ -144,7 +144,7 @@ func bumpClusterVersion( return err } log.Infof(ctx, "active cluster version setting is now %s (up from %s)", - newCV.PrettyPrint(), prevCV.PrettyPrint()) + redact.Safe(newCV.PrettyPrint()), redact.Safe(prevCV.PrettyPrint())) return nil }