From b174ee239c509a33d20f58aadaa9af6199759f1b Mon Sep 17 00:00:00 2001 From: Thomas Hardy Date: Mon, 25 Jul 2022 15:02:49 -0400 Subject: [PATCH] Revert "sql: Add database ID to sampled query log" Reverts: #84195 This reverts commit c633d130bf49a9a38b9e95e47fe1b60d00d1f338. Removes the DatabaseID field from the SampledQuery telemetry log due to the potential of indefinite blocking in the case of a lease acquisition failure. Protobuf field not reserved as no official build was released with these changes yet. Release note (sql change): Removes the DatabaseID field from the SampledQuery telemetry log due to the potential of indefinite blocking in the case of a lease acquisition failure. --- docs/generated/eventlog.md | 1 - pkg/sql/exec_log.go | 5 - pkg/sql/telemetry_logging_test.go | 9 -- pkg/util/log/eventpb/json_encode_generated.go | 9 -- pkg/util/log/eventpb/telemetry.pb.go | 127 +++++++----------- pkg/util/log/eventpb/telemetry.proto | 5 +- 6 files changed, 49 insertions(+), 107 deletions(-) diff --git a/docs/generated/eventlog.md b/docs/generated/eventlog.md index d6783c6dd84c..fbf2850c89db 100644 --- a/docs/generated/eventlog.md +++ b/docs/generated/eventlog.md @@ -2244,7 +2244,6 @@ contains common SQL event/execution details. | `Database` | Name of the database that initiated the query. | no | | `StatementID` | Statement ID of the query. | no | | `TransactionID` | Transaction ID of the query. | no | -| `DatabaseID` | Database ID of the query. | no | | `StatementFingerprintID` | Statement fingerprint ID of the query. | no | diff --git a/pkg/sql/exec_log.go b/pkg/sql/exec_log.go index d9729677f23b..eae76b6f8c06 100644 --- a/pkg/sql/exec_log.go +++ b/pkg/sql/exec_log.go @@ -380,7 +380,6 @@ func (p *planner) maybeLogStatementInternal( } if telemetryMetrics.maybeUpdateLastEmittedTime(telemetryMetrics.timeNow(), requiredTimeElapsed) { skippedQueries := telemetryMetrics.resetSkippedQueryCount() - databaseName := p.CurrentDatabase() sampledQuery := eventpb.SampledQuery{ CommonSQLExecDetails: execDetails, SkippedQueries: skippedQueries, @@ -392,10 +391,6 @@ func (p *planner) maybeLogStatementInternal( TransactionID: p.txn.ID().String(), StatementFingerprintID: uint64(stmtFingerprintID), } - db, _ := p.Descriptors().GetImmutableDatabaseByName(ctx, p.txn, databaseName, tree.DatabaseLookupFlags{Required: true}) - if db != nil { - sampledQuery.DatabaseID = uint32(db.GetID()) - } p.logOperationalEventsOnlyExternally(ctx, eventLogEntry{event: &sampledQuery}) } else { telemetryMetrics.incSkippedQueryCount() diff --git a/pkg/sql/telemetry_logging_test.go b/pkg/sql/telemetry_logging_test.go index cc286a21dbf2..5e93d8b038f1 100644 --- a/pkg/sql/telemetry_logging_test.go +++ b/pkg/sql/telemetry_logging_test.go @@ -12,11 +12,9 @@ package sql import ( "context" - gosql "database/sql" "fmt" "math" "regexp" - "strconv" "strings" "testing" "time" @@ -97,14 +95,10 @@ func TestTelemetryLogging(t *testing.T) { var sessionID string var databaseName string - var dbID uint32 db := sqlutils.MakeSQLRunner(sqlDB) - conn := db.DB.(*gosql.DB) - db.QueryRow(t, `SHOW session_id`).Scan(&sessionID) db.QueryRow(t, `SHOW database`).Scan(&databaseName) - dbID = sqlutils.QueryDatabaseID(t, conn, databaseName) db.Exec(t, `SET application_name = 'telemetry-logging-test'`) db.Exec(t, `SET CLUSTER SETTING sql.telemetry.query_sampling.enabled = true;`) db.Exec(t, "CREATE TABLE t();") @@ -275,9 +269,6 @@ func TestTelemetryLogging(t *testing.T) { if !strings.Contains(e.Message, "\"Database\":\""+databaseName+"\"") { t.Errorf("expected to find Database: %s", databaseName) } - if !strings.Contains(e.Message, "\"DatabaseID\":"+strconv.Itoa(int(dbID))) { - t.Errorf("expected to find DatabaseID: %v", dbID) - } stmtFingerprintID := roachpb.ConstructStatementFingerprintID(tc.queryNoConstants, false, true, databaseName) if !strings.Contains(e.Message, "\"StatementFingerprintID\":"+strconv.FormatUint(uint64(stmtFingerprintID), 10)) { t.Errorf("expected to find StatementFingerprintID: %v", stmtFingerprintID) diff --git a/pkg/util/log/eventpb/json_encode_generated.go b/pkg/util/log/eventpb/json_encode_generated.go index 9c92b7ecab68..306e22345ce3 100644 --- a/pkg/util/log/eventpb/json_encode_generated.go +++ b/pkg/util/log/eventpb/json_encode_generated.go @@ -2900,15 +2900,6 @@ func (m *SampledQuery) AppendJSONFields(printComma bool, b redact.RedactableByte b = append(b, '"') } - if m.DatabaseID != 0 { - if printComma { - b = append(b, ',') - } - printComma = true - b = append(b, "\"DatabaseID\":"...) - b = strconv.AppendUint(b, uint64(m.DatabaseID), 10) - } - if m.StatementFingerprintID != 0 { if printComma { b = append(b, ',') diff --git a/pkg/util/log/eventpb/telemetry.pb.go b/pkg/util/log/eventpb/telemetry.pb.go index cf97716d3395..20991387d3ff 100644 --- a/pkg/util/log/eventpb/telemetry.pb.go +++ b/pkg/util/log/eventpb/telemetry.pb.go @@ -47,10 +47,8 @@ type SampledQuery struct { StatementID string `protobuf:"bytes,10,opt,name=statement_id,json=statementId,proto3" json:",omitempty" redact:"nonsensitive"` // Transaction ID of the query. TransactionID string `protobuf:"bytes,11,opt,name=transaction_id,json=transactionId,proto3" json:",omitempty" redact:"nonsensitive"` - // Database ID of the query. - DatabaseID uint32 `protobuf:"varint,12,opt,name=database_id,json=databaseId,proto3" json:",omitempty"` // Statement fingerprint ID of the query. - StatementFingerprintID uint64 `protobuf:"varint,13,opt,name=statement_fingerprint_id,json=statementFingerprintId,proto3" json:",omitempty"` + StatementFingerprintID uint64 `protobuf:"varint,12,opt,name=statement_fingerprint_id,json=statementFingerprintId,proto3" json:",omitempty"` } func (m *SampledQuery) Reset() { *m = SampledQuery{} } @@ -139,55 +137,53 @@ func init() { func init() { proto.RegisterFile("util/log/eventpb/telemetry.proto", fileDescriptor_3d317b4ad74be4f7) } var fileDescriptor_3d317b4ad74be4f7 = []byte{ - // 755 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcd, 0x6e, 0xfb, 0x44, - 0x10, 0xc0, 0x63, 0x9a, 0x36, 0xc9, 0xe6, 0x03, 0xb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0x2a, 0x25, 0x92, 0xcc, 0x88, 0x00, 0xbd, 0xb6, 0x5f, 0x77, 0xeb, - 0x42, 0xfc, 0x23, 0x6a, 0x08, 0x49, 0x24, 0xf8, 0x10, 0xc8, 0xac, 0x37, 0xa4, 0x44, 0x5f, 0xa5, - 0x89, 0x59, 0x9f, 0xac, 0xe2, 0xbb, 0x77, 0x57, 0x5f, 0xbb, 0x2c, 0x8a, 0x1d, 0xd4, 0x92, 0x11, - 0x09, 0x04, 0x71, 0x65, 0xb1, 0xf0, 0xba, 0x92, 0x7f, 0x93, 0x26, 0x66, 0x73, 0xba, 0xc9, 0xec, - 0xae, 0x6f, 0x3e, 0xf3, 0x59, 0x14, 0x7f, 0x87, 0xea, 0xab, 0x75, 0x64, 0xf6, 0x46, 0x5b, 0xeb, - 0x36, 0x07, 0x1f, 0xa4, 0x89, 0x89, 0x46, 0x45, 0xf8, 0x9f, 0x6a, 0x1b, 0xad, 0x0a, 0x2c, 0x8a, - 0x67, 0x48, 0xdf, 0x2c, 0xfd, 0x67, 0x16, 0xcc, 0x21, 0x0a, 0x23, 0x96, 0x6f, 0x43, 0x53, 0x5d, - 0xac, 0x6e, 0x9a, 0x98, 0xc7, 0xeb, 0x6d, 0xb8, 0xd8, 0x20, 0x5b, 0xde, 0x63, 0xf1, 0x1a, 0x45, - 0x3b, 0xbf, 0x1d, 0xa2, 0xf7, 0x87, 0x24, 0x94, 0x71, 0x04, 0xd4, 0x0a, 0x28, 0xdc, 0x5e, 0x09, - 0x32, 0x87, 0x4c, 0x29, 0xde, 0xd0, 0x30, 0x77, 0xd1, 0x3b, 0x92, 0x4b, 0xe2, 0x39, 0x11, 0x10, - 0xea, 0xb8, 0x3c, 0x0e, 0xa4, 0x9a, 0xec, 0xb2, 0xdd, 0x52, 0x71, 0x1b, 0x08, 0x1d, 0x66, 0x51, - 0x3c, 0x42, 0x35, 0x8f, 0x08, 0xa9, 0x40, 0x35, 0xa8, 0xfb, 0x5c, 0xa0, 0xac, 0x32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733 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcf, 0x6e, 0xeb, 0x44, + 0x14, 0x87, 0x63, 0x6e, 0xda, 0x24, 0x93, 0x3f, 0xa0, 0x11, 0x5c, 0xac, 0x4a, 0xd8, 0x51, 0x16, + 0xdc, 0x20, 0x50, 0x02, 0x14, 0x01, 0x62, 0x99, 0xa4, 0x95, 0x2c, 0x2a, 0xa4, 0x38, 0xe9, 0x02, + 0x36, 0xd6, 0xc4, 0x73, 0x08, 0xa3, 0xda, 0x1e, 0xc7, 0x33, 0xae, 0x9a, 0x1d, 0x8f, 0xc0, 0xbb, + 0xf0, 0x12, 0x5d, 0x76, 0xd9, 0x95, 0x05, 0xee, 0xae, 0x4b, 0x9e, 0x00, 0xcd, 0xd8, 0x6d, 0x5a, + 0x52, 0x20, 0x59, 0xdc, 0x55, 0x92, 0x73, 0xbe, 0xdf, 0x97, 0xe3, 0xd1, 0x9c, 0x04, 0x75, 0x53, + 0xc9, 0x82, 0x61, 0xc0, 0x97, 0x43, 0xb8, 0x84, 0x48, 0xc6, 0x8b, 0xa1, 0x84, 0x00, 0x42, 0x90, + 0xc9, 0x7a, 0x10, 0x27, 0x5c, 0x72, 0x7c, 0xe4, 0x73, 0xff, 0x22, 0xe1, 0xc4, 0xff, 0x65, 0xa0, + 0xd8, 0x41, 0xc0, 0x97, 0x83, 0x92, 0x3d, 0x7a, 0x7f, 0xc9, 0x97, 0x5c, 0x63, 0x43, 0xf5, 0xae, + 0x48, 0x1c, 0x7d, 0xb4, 0xe5, 0xd4, 0xaf, 0xa2, 0x6c, 0xbf, 0xd9, 0x6a, 0x8b, 0x55, 0xe0, 0x91, + 0x94, 0x32, 0xe9, 0x3d, 0x05, 0x7b, 0xbf, 0xd6, 0x50, 0x6b, 0x46, 0xc2, 0x38, 0x00, 0x3a, 0x4d, + 0x21, 0x59, 0xe3, 0x39, 0x3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, 0x36, 0x9d, 0x1d, 0x08, 0x07, 0x00, 0x00, } func (m *SampledQuery) Marshal() (dAtA []byte, err error) { @@ -213,11 +209,6 @@ func (m *SampledQuery) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.StatementFingerprintID != 0 { i = encodeVarintTelemetry(dAtA, i, uint64(m.StatementFingerprintID)) i-- - dAtA[i] = 0x68 - } - if m.DatabaseID != 0 { - i = encodeVarintTelemetry(dAtA, i, uint64(m.DatabaseID)) - i-- dAtA[i] = 0x60 } if len(m.TransactionID) > 0 { @@ -451,9 +442,6 @@ func (m *SampledQuery) Size() (n int) { if l > 0 { n += 1 + l + sovTelemetry(uint64(l)) } - if m.DatabaseID != 0 { - n += 1 + sovTelemetry(uint64(m.DatabaseID)) - } if m.StatementFingerprintID != 0 { n += 1 + sovTelemetry(uint64(m.StatementFingerprintID)) } @@ -831,25 +819,6 @@ func (m *SampledQuery) Unmarshal(dAtA []byte) error { m.TransactionID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DatabaseID", wireType) - } - m.DatabaseID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTelemetry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DatabaseID |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field StatementFingerprintID", wireType) } diff --git a/pkg/util/log/eventpb/telemetry.proto b/pkg/util/log/eventpb/telemetry.proto index 1a50a6aed413..cb17cbbe53bb 100644 --- a/pkg/util/log/eventpb/telemetry.proto +++ b/pkg/util/log/eventpb/telemetry.proto @@ -56,11 +56,8 @@ message SampledQuery { // Transaction ID of the query. string transaction_id = 11 [(gogoproto.customname) = "TransactionID", (gogoproto.jsontag) = ',omitempty', (gogoproto.moretags) = "redact:\"nonsensitive\""]; - // Database ID of the query. - uint32 database_id = 12 [(gogoproto.customname) = "DatabaseID", (gogoproto.jsontag) = ",omitempty"]; - // Statement fingerprint ID of the query. - uint64 statement_fingerprint_id = 13 [(gogoproto.customname) = "StatementFingerprintID", (gogoproto.jsontag) = ',omitempty']; + uint64 statement_fingerprint_id = 12 [(gogoproto.customname) = "StatementFingerprintID", (gogoproto.jsontag) = ',omitempty']; } // CapturedIndexUsageStats