From 221ac5530bf73221acd09c7cb6365ad19e989d8c Mon Sep 17 00:00:00 2001 From: Andrei Matei Date: Tue, 12 Jul 2022 19:45:28 -0400 Subject: [PATCH] tracing: delete old field The RecordedSpan.RedactableLogs. This field was unused since 22.1. Release note: None --- pkg/server/node_tenant.go | 10 ++-------- pkg/server/node_tenant_test.go | 1 - pkg/util/tracing/crdbspan.go | 19 +++++++++---------- .../tracing/tracingpb/recorded_span.proto | 6 +----- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/pkg/server/node_tenant.go b/pkg/server/node_tenant.go index 0f6a7760c004..8c046e4c76b4 100644 --- a/pkg/server/node_tenant.go +++ b/pkg/server/node_tenant.go @@ -13,7 +13,6 @@ package server import ( "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/util/tracing/tracingpb" - "github.com/cockroachdb/errors" "github.com/cockroachdb/redact" ) @@ -22,7 +21,8 @@ const TraceRedactedMarker = redact.RedactableString("verbose trace message redac // redactRecordingForTenant redacts the sensitive parts of log messages in the // recording if the tenant to which this recording is intended is not the system -// tenant (the system tenant gets an. See https://github.com/cockroachdb/cockroach/issues/70407. +// tenant (the system tenant gets an unredacted trace). +// See https://github.com/cockroachdb/cockroach/issues/70407. // The recording is modified in place. // // tenID is the tenant that will receive this recording. @@ -36,12 +36,6 @@ func redactRecordingForTenant(tenID roachpb.TenantID, rec tracingpb.Recording) e sp.TagGroups = nil for j := range sp.Logs { record := &sp.Logs[j] - if record.Message != "" && !sp.RedactableLogs { - // If Message is set, the record should have been produced by a 22.1 - // node that also sets RedactableLogs. - return errors.AssertionFailedf( - "recording has non-redactable span with the Message field set: %s", sp) - } record.Message = record.Message.Redact() } } diff --git a/pkg/server/node_tenant_test.go b/pkg/server/node_tenant_test.go index 180ea60a7991..9192d1cb43bd 100644 --- a/pkg/server/node_tenant_test.go +++ b/pkg/server/node_tenant_test.go @@ -121,7 +121,6 @@ func TestRedactRecordingForTenant(t *testing.T) { TagGroups []tracingpb.TagGroup StartTime time.Time Duration time.Duration - RedactableLogs bool Logs []tracingpb.LogRecord Verbose bool RecordingMode tracingpb.RecordingMode diff --git a/pkg/util/tracing/crdbspan.go b/pkg/util/tracing/crdbspan.go index c2ff400bbc8f..cbc062f32478 100644 --- a/pkg/util/tracing/crdbspan.go +++ b/pkg/util/tracing/crdbspan.go @@ -834,16 +834,15 @@ func (s *crdbSpan) getRecordingNoChildrenLocked( recordingType tracingpb.RecordingType, finishing bool, ) tracingpb.RecordedSpan { rs := tracingpb.RecordedSpan{ - TraceID: s.traceID, - SpanID: s.spanID, - ParentSpanID: s.parentSpanID, - GoroutineID: s.mu.goroutineID, - Operation: s.operation, - StartTime: s.startTime, - Duration: s.mu.duration, - RedactableLogs: true, - Verbose: s.recordingType() == tracingpb.RecordingVerbose, - RecordingMode: s.recordingType().ToProto(), + TraceID: s.traceID, + SpanID: s.spanID, + ParentSpanID: s.parentSpanID, + GoroutineID: s.mu.goroutineID, + Operation: s.operation, + StartTime: s.startTime, + Duration: s.mu.duration, + Verbose: s.recordingType() == tracingpb.RecordingVerbose, + RecordingMode: s.recordingType().ToProto(), } if rs.Duration == -1 { diff --git a/pkg/util/tracing/tracingpb/recorded_span.proto b/pkg/util/tracing/tracingpb/recorded_span.proto index 1cd832c3cf59..d79cfdb89f3a 100644 --- a/pkg/util/tracing/tracingpb/recorded_span.proto +++ b/pkg/util/tracing/tracingpb/recorded_span.proto @@ -101,10 +101,6 @@ message RecordedSpan { google.protobuf.Duration duration = 8 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; - // RedactableLogs determines whether the verbose log messages are redactable. - // This field was introduced in the 22.1 release. It can be removed in the 22.2 - // release. On 22.1 this is always set to `true`. - bool redactable_logs = 15; // Events logged in the span. repeated LogRecord logs = 9 [(gogoproto.nullable) = false]; // verbose indicates whether the span was recording in verbose mode at the @@ -141,7 +137,7 @@ message RecordedSpan { // view of the various operations that are being traced as part of a span. map children_metadata = 19 [(gogoproto.nullable) = false]; - reserved 5,10,11; + reserved 5,10,11,15; } message TagGroup {