Skip to content

Commit c956621

Browse files
committed
pgwire: remove logs added to debug test
Release note: None
1 parent 31decb2 commit c956621

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

pkg/sql/pgwire/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ go_library(
6161
"//pkg/sql/sqltelemetry",
6262
"//pkg/sql/types",
6363
"//pkg/util",
64-
"//pkg/util/buildutil",
6564
"//pkg/util/ctxlog",
6665
"//pkg/util/duration",
6766
"//pkg/util/envutil",

pkg/sql/pgwire/pre_serve.go

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror"
2424
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgwirebase"
2525
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgwirecancel"
26-
"github.com/cockroachdb/cockroach/pkg/util/buildutil"
2726
"github.com/cockroachdb/cockroach/pkg/util/log"
2827
"github.com/cockroachdb/cockroach/pkg/util/metric"
2928
"github.com/cockroachdb/cockroach/pkg/util/mon"
@@ -441,23 +440,13 @@ func (s *PreServeConnHandler) maybeUpgradeToSecureConn(
441440
// TODO(knz): Remove this condition - see
442441
// https://github.com/cockroachdb/cockroach/issues/53404
443442
if s.cfg.Insecure {
444-
if buildutil.CrdbTestBuild {
445-
log.Infof(ctx, "using insecure mode since version=%d and cfg.Insecure=true", version)
446-
}
447443
return
448444
}
449445

450446
// Secure mode: disallow if TCP and the user did not opt into
451447
// non-TLS SQL conns.
452448
if !s.cfg.AcceptSQLWithoutTLS && connType != hba.ConnLocal && connType != hba.ConnInternalLoopback {
453449
clientErr = pgerror.New(pgcode.ProtocolViolation, ErrSSLRequired)
454-
// Extra logs under test to debug TestAuthenticationAndHBARules.
455-
if buildutil.CrdbTestBuild {
456-
log.Warningf(ctx, "client cannot connect since version=%d AcceptSQLWithoutTLS=false and connType=%s", version, connType)
457-
}
458-
}
459-
if buildutil.CrdbTestBuild {
460-
log.Infof(ctx, "client did not request SSL version=%d AcceptSQLWithoutTLS=false and connType=%s", version, connType)
461450
}
462451
return
463452
}
@@ -469,19 +458,12 @@ func (s *PreServeConnHandler) maybeUpgradeToSecureConn(
469458
// we don't want it.
470459
clientErr = pgerror.New(pgcode.ProtocolViolation,
471460
"cannot use SSL/TLS over local connections")
472-
// Extra logs under test to debug TestAuthenticationAndHBARules.
473-
if buildutil.CrdbTestBuild {
474-
log.Warningf(ctx, "client cannot connect since version=%d and connType=%s", version, connType)
475-
}
476461
return
477462
}
478463

479464
// Protocol sanity check.
480465
if len(buf.Msg) > 0 {
481466
serverErr = errors.Errorf("unexpected data after SSLRequest: %q", buf.Msg)
482-
if buildutil.CrdbTestBuild {
483-
log.Warningf(ctx, "protocol error err=%v", serverErr)
484-
}
485467
return
486468
}
487469

@@ -491,36 +473,20 @@ func (s *PreServeConnHandler) maybeUpgradeToSecureConn(
491473
// Do we have a TLS configuration?
492474
tlsConfig, serverErr := s.getTLSConfig()
493475
if serverErr != nil {
494-
if buildutil.CrdbTestBuild {
495-
log.Warningf(ctx, "could not get TLS config err=%v", serverErr)
496-
}
497476
return
498477
}
499478

500479
if tlsConfig == nil {
501480
// We don't have a TLS configuration available, so we can't honor
502481
// the client's request.
503-
// Extra logs under test to debug TestAuthenticationAndHBARules.
504-
if buildutil.CrdbTestBuild {
505-
log.Infof(ctx, "sending sslUnsupported message to client")
506-
}
507482
n, serverErr = conn.Write(sslUnsupported)
508483
if serverErr != nil {
509-
if buildutil.CrdbTestBuild {
510-
log.Warningf(ctx, "error while sending sslUnsupported message to client err=%v", serverErr)
511-
}
512484
return
513485
}
514486
} else {
515-
if buildutil.CrdbTestBuild {
516-
log.Infof(ctx, "sending sslSupported message to client")
517-
}
518487
// We have a TLS configuration. Upgrade the connection.
519488
n, serverErr = conn.Write(sslSupported)
520489
if serverErr != nil {
521-
if buildutil.CrdbTestBuild {
522-
log.Warningf(ctx, "error while sending sslSupported message to client err=%v", serverErr)
523-
}
524490
return
525491
}
526492
newConn = tls.Server(conn, tlsConfig)
@@ -530,9 +496,6 @@ func (s *PreServeConnHandler) maybeUpgradeToSecureConn(
530496

531497
// Finally, re-read the version/command from the client.
532498
newVersion, *buf, serverErr = s.readVersion(newConn)
533-
if buildutil.CrdbTestBuild && serverErr != nil {
534-
log.Warningf(ctx, "error when reading version err=%v", serverErr)
535-
}
536499
return
537500
}
538501

0 commit comments

Comments
 (0)