Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-22.2: sql,server: increase severity of upgraded-related logging #90201

Merged
merged 1 commit into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/server/auto_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (s *Server) startAttemptUpgrade(ctx context.Context) {
// Check if we should upgrade cluster version, keep checking upgrade
// status, or stop attempting upgrade.
if quit, err := s.upgradeStatus(ctx); err != nil {
log.Infof(ctx, "failed attempt to upgrade cluster version, error: %s", err)
log.Errorf(ctx, "failed attempt to upgrade cluster version, error: %v", err)
continue
} else if quit {
log.Info(ctx, "no need to upgrade, cluster already at the newest version")
Expand All @@ -76,7 +76,7 @@ func (s *Server) startAttemptUpgrade(ctx context.Context) {
sessiondata.InternalExecutorOverride{User: username.RootUserName()},
"SET CLUSTER SETTING version = crdb_internal.node_executable_version();",
); err != nil {
log.Infof(ctx, "error when finalizing cluster version upgrade: %s", err)
log.Errorf(ctx, "error when finalizing cluster version upgrade: %v", err)
} else {
log.Info(ctx, "successfully upgraded cluster version")
return
Expand All @@ -85,7 +85,7 @@ func (s *Server) startAttemptUpgrade(ctx context.Context) {
}
}); err != nil {
cancel()
log.Infof(ctx, "failed attempt to upgrade cluster version, error: %s", err)
log.Errorf(ctx, "failed attempt to upgrade cluster version, error: %v", err)
}
}

Expand Down
8 changes: 7 additions & 1 deletion pkg/upgrade/upgrademanager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,16 @@ func (m *Manager) Migrate(
user username.SQLUsername,
from, to clusterversion.ClusterVersion,
updateSystemVersionSetting sql.UpdateVersionSystemSettingHook,
) error {
) (returnErr error) {
// TODO(irfansharif): Should we inject every ctx here with specific labels
// for each upgrade, so they log distinctly?
ctx = logtags.AddTag(ctx, "migration-mgr", nil)
defer func() {
if returnErr != nil {
log.Warningf(ctx, "error encountered during version upgrade: %v", returnErr)
}
}()

if from == to {
// Nothing to do here.
log.Infof(ctx, "no need to migrate, cluster already at newest version")
Expand Down