From 309c3cb11767b622c402c453bfd6c39fb394f514 Mon Sep 17 00:00:00 2001 From: Michael Erickson Date: Fri, 10 Sep 2021 17:06:45 -0700 Subject: [PATCH] sql: clean up large row errors and events Addresses: #67400, #69477 Remove ViolatesMaxRowSizeErr from CommonLargeRowDetails, as was done for CommonTxnRowsLimitDetails in #69945. Also remove the SafeDetails methods from CommonLargeRowDetails, txnRowsReadLimitErr, and txnRowsWrittenLimitErr, as I don't think we need them. Release note: None (there was no release between the introduction of the LargeRow and LargeRowInternal events and this commit). --- docs/generated/eventlog.md | 8 +- pkg/sql/conn_executor_exec.go | 14 -- pkg/sql/event_log_test.go | 18 +- pkg/sql/row/helper.go | 9 +- pkg/util/log/eventpb/json_encode_generated.go | 8 - pkg/util/log/eventpb/sql_audit_events.go | 47 ++--- pkg/util/log/eventpb/sql_audit_events.pb.go | 168 +++++++----------- pkg/util/log/eventpb/sql_audit_events.proto | 7 +- 8 files changed, 99 insertions(+), 180 deletions(-) diff --git a/docs/generated/eventlog.md b/docs/generated/eventlog.md index ad8b0e3be05a..8d085e5c439d 100644 --- a/docs/generated/eventlog.md +++ b/docs/generated/eventlog.md @@ -1882,7 +1882,7 @@ Events in this category are logged to the `SQL_PERF` channel. ### `large_row` An event of type `large_row` is recorded when a statement tries to write a row larger than -cluster setting `sql.mutations.max_row_size.log` to the database. Multiple +cluster setting `sql.guardrails.max_row_size_log` to the database. Multiple LargeRow events will be recorded for statements writing multiple large rows. LargeRow events are recorded before the transaction commits, so in the case of transaction abort there will not be a corresponding row in the database. @@ -1900,7 +1900,6 @@ of transaction abort there will not be a corresponding row in the database. | `TableID` | | no | | `FamilyID` | | no | | `PrimaryKey` | | yes | -| `ViolatesMaxRowSizeErr` | | no | ### `slow_query` @@ -2008,8 +2007,8 @@ Events in this category are logged to the `SQL_INTERNAL_PERF` channel. ### `large_row_internal` An event of type `large_row_internal` is recorded when an internal query tries to write a row -larger than cluster settings `sql.mutations.max_row_size.log` or -`sql.mutations.max_row_size.err` to the database. +larger than cluster settings `sql.guardrails.max_row_size_log` or +`sql.guardrails.max_row_size_err` to the database. @@ -2024,7 +2023,6 @@ larger than cluster settings `sql.mutations.max_row_size.log` or | `TableID` | | no | | `FamilyID` | | no | | `PrimaryKey` | | yes | -| `ViolatesMaxRowSizeErr` | | no | ### `slow_query_internal` diff --git a/pkg/sql/conn_executor_exec.go b/pkg/sql/conn_executor_exec.go index 98952089359d..a2319a8417a4 100644 --- a/pkg/sql/conn_executor_exec.go +++ b/pkg/sql/conn_executor_exec.go @@ -1100,7 +1100,6 @@ type txnRowsWrittenLimitErr struct { } var _ error = &txnRowsWrittenLimitErr{} -var _ errors.SafeDetailer = &txnRowsWrittenLimitErr{} var _ fmt.Formatter = &txnRowsWrittenLimitErr{} var _ errors.SafeFormatter = &txnRowsWrittenLimitErr{} @@ -1110,12 +1109,6 @@ func (e *txnRowsWrittenLimitErr) Error() string { return e.CommonTxnRowsLimitDetails.Error("written") } -// SafeDetails is part of the errors.SafeDetailer interface, which -// txnRowsWrittenLimitErr implements. -func (e *txnRowsWrittenLimitErr) SafeDetails() []string { - return e.CommonTxnRowsLimitDetails.SafeDetails("written") -} - // Format is part of the fmt.Formatter interface, which txnRowsWrittenLimitErr // implements. func (e *txnRowsWrittenLimitErr) Format(s fmt.State, verb rune) { @@ -1133,7 +1126,6 @@ type txnRowsReadLimitErr struct { } var _ error = &txnRowsReadLimitErr{} -var _ errors.SafeDetailer = &txnRowsReadLimitErr{} var _ fmt.Formatter = &txnRowsReadLimitErr{} var _ errors.SafeFormatter = &txnRowsReadLimitErr{} @@ -1142,12 +1134,6 @@ func (e *txnRowsReadLimitErr) Error() string { return e.CommonTxnRowsLimitDetails.Error("read") } -// SafeDetails is part of the errors.SafeDetailer interface, which -// txnRowsReadLimitErr implements. -func (e *txnRowsReadLimitErr) SafeDetails() []string { - return e.CommonTxnRowsLimitDetails.SafeDetails("read") -} - // Format is part of the fmt.Formatter interface, which txnRowsReadLimitErr // implements. func (e *txnRowsReadLimitErr) Format(s fmt.State, verb rune) { diff --git a/pkg/sql/event_log_test.go b/pkg/sql/event_log_test.go index ecfda04d6a06..6bbeddd9ead1 100644 --- a/pkg/sql/event_log_test.go +++ b/pkg/sql/event_log_test.go @@ -169,7 +169,7 @@ func TestPerfLogging(t *testing.T) { { query: `INSERT INTO t VALUES (5, false, repeat('x', 2048))`, errRe: `row larger than max row size: table \d+ family 0 primary key /Table/\d+/1/5/0 size \d+`, - logRe: `"EventType":"large_row","RowSize":\d+,"TableID":\d+,"PrimaryKey":"‹/Table/\d+/1/5/0›","ViolatesMaxRowSizeErr":true`, + logRe: `"EventType":"large_row","RowSize":\d+,"TableID":\d+,"PrimaryKey":"‹/Table/\d+/1/5/0›"`, logExpected: true, channel: channel.SQL_PERF, }, @@ -204,7 +204,7 @@ func TestPerfLogging(t *testing.T) { { query: `INSERT INTO t VALUES (2, false, 'x') ON CONFLICT (i) DO UPDATE SET s = repeat('x', 2048)`, errRe: `row larger than max row size: table \d+ family 0 primary key /Table/\d+/1/2/0 size \d+`, - logRe: `"EventType":"large_row","RowSize":\d+,"TableID":\d+,"PrimaryKey":"‹/Table/\d+/1/2/0›","ViolatesMaxRowSizeErr":true`, + logRe: `"EventType":"large_row","RowSize":\d+,"TableID":\d+,"PrimaryKey":"‹/Table/\d+/1/2/0›"`, logExpected: true, channel: channel.SQL_PERF, }, @@ -225,7 +225,7 @@ func TestPerfLogging(t *testing.T) { { query: `UPSERT INTO t VALUES (2, false, repeat('x', 2048))`, errRe: `row larger than max row size: table \d+ family 0 primary key /Table/\d+/1/2/0 size \d+`, - logRe: `"EventType":"large_row","RowSize":\d+,"TableID":\d+,"PrimaryKey":"‹/Table/\d+/1/2/0›","ViolatesMaxRowSizeErr":true`, + logRe: `"EventType":"large_row","RowSize":\d+,"TableID":\d+,"PrimaryKey":"‹/Table/\d+/1/2/0›"`, logExpected: true, channel: channel.SQL_PERF, }, @@ -246,7 +246,7 @@ func TestPerfLogging(t *testing.T) { { query: `UPDATE t SET s = repeat('x', 2048) WHERE i = 2`, errRe: `row larger than max row size: table \d+ family 0 primary key /Table/\d+/1/2/0 size \d+`, - logRe: `"EventType":"large_row","RowSize":\d+,"TableID":\d+,"PrimaryKey":"‹/Table/\d+/1/2/0›","ViolatesMaxRowSizeErr":true`, + logRe: `"EventType":"large_row","RowSize":\d+,"TableID":\d+,"PrimaryKey":"‹/Table/\d+/1/2/0›"`, logExpected: true, channel: channel.SQL_PERF, }, @@ -288,7 +288,7 @@ func TestPerfLogging(t *testing.T) { { query: `ALTER TABLE t2 ADD COLUMN z STRING DEFAULT repeat('z', 2048)`, errRe: ``, - logRe: `"EventType":"large_row_internal","RowSize":\d+,"TableID":\d+,"PrimaryKey":"‹/Table/\d+/1/4/0›","ViolatesMaxRowSizeErr":true`, + logRe: `"EventType":"large_row_internal","RowSize":\d+,"TableID":\d+,"PrimaryKey":"‹/Table/\d+/1/4/0›"`, logExpected: true, channel: channel.SQL_INTERNAL_PERF, }, @@ -323,7 +323,7 @@ func TestPerfLogging(t *testing.T) { { query: `INSERT INTO u VALUES (2, 2, repeat('x', 2048))`, errRe: `pq: row larger than max row size: table \d+ family 1 primary key /Table/\d+/1/2/1/1 size \d+`, - logRe: `"EventType":"large_row","RowSize":\d+,"TableID":\d+,"FamilyID":1,"PrimaryKey":"‹/Table/\d+/1/2/1/1›","ViolatesMaxRowSizeErr":true`, + logRe: `"EventType":"large_row","RowSize":\d+,"TableID":\d+,"FamilyID":1,"PrimaryKey":"‹/Table/\d+/1/2/1/1›"`, logExpected: true, channel: channel.SQL_PERF, }, @@ -351,14 +351,14 @@ func TestPerfLogging(t *testing.T) { { query: `UPDATE u SET s = repeat('x', 2048) WHERE i = 2`, errRe: `pq: row larger than max row size: table \d+ family 1 primary key /Table/\d+/1/2/1/1 size \d+`, - logRe: `"EventType":"large_row","RowSize":\d+,"TableID":\d+,"FamilyID":1,"PrimaryKey":"‹/Table/\d+/1/2/1/1›","ViolatesMaxRowSizeErr":true`, + logRe: `"EventType":"large_row","RowSize":\d+,"TableID":\d+,"FamilyID":1,"PrimaryKey":"‹/Table/\d+/1/2/1/1›"`, logExpected: true, channel: channel.SQL_PERF, }, { query: `CREATE TABLE u2 (i, j, s, PRIMARY KEY (i), FAMILY f1 (i, j), FAMILY f2 (s)) AS SELECT i, j, repeat(s, 2048) FROM u`, errRe: ``, - logRe: `"EventType":"large_row_internal","RowSize":\d+,"TableID":\d+,"FamilyID":1,"PrimaryKey":"‹/Table/\d+/1/2/1/1›","ViolatesMaxRowSizeErr":true`, + logRe: `"EventType":"large_row_internal","RowSize":\d+,"TableID":\d+,"FamilyID":1,"PrimaryKey":"‹/Table/\d+/1/2/1/1›"`, logExpected: true, channel: channel.SQL_INTERNAL_PERF, }, @@ -372,7 +372,7 @@ func TestPerfLogging(t *testing.T) { { query: `UPDATE u2 SET i = i + 1 WHERE i = 2`, errRe: `row larger than max row size: table \d+ family 1 primary key /Table/\d+/1/3/1/1 size \d+`, - logRe: `"EventType":"large_row","RowSize":\d+,"TableID":\d+,"FamilyID":1,"PrimaryKey":"‹/Table/\d+/1/3/1/1›","ViolatesMaxRowSizeErr":true`, + logRe: `"EventType":"large_row","RowSize":\d+,"TableID":\d+,"FamilyID":1,"PrimaryKey":"‹/Table/\d+/1/3/1/1›"`, logExpected: true, channel: channel.SQL_PERF, }, diff --git a/pkg/sql/row/helper.go b/pkg/sql/row/helper.go index e7aa8d518dd5..c8c09bf7c120 100644 --- a/pkg/sql/row/helper.go +++ b/pkg/sql/row/helper.go @@ -260,11 +260,10 @@ func (rh *rowHelper) checkRowSize( return nil } details := eventpb.CommonLargeRowDetails{ - RowSize: size, - TableID: uint32(rh.TableDesc.GetID()), - FamilyID: uint32(family), - PrimaryKey: keys.PrettyPrint(rh.primIndexValDirs, *key), - ViolatesMaxRowSizeErr: shouldErr, + RowSize: size, + TableID: uint32(rh.TableDesc.GetID()), + FamilyID: uint32(family), + PrimaryKey: keys.PrettyPrint(rh.primIndexValDirs, *key), } if rh.internal && shouldErr { // Internal work should never err and always log if violating either limit. diff --git a/pkg/util/log/eventpb/json_encode_generated.go b/pkg/util/log/eventpb/json_encode_generated.go index 267ae69eeaaf..ffb8b8debeff 100644 --- a/pkg/util/log/eventpb/json_encode_generated.go +++ b/pkg/util/log/eventpb/json_encode_generated.go @@ -1195,14 +1195,6 @@ func (m *CommonLargeRowDetails) AppendJSONFields(printComma bool, b redact.Redac b = append(b, '"') } - if m.ViolatesMaxRowSizeErr { - if printComma { - b = append(b, ',') - } - printComma = true - b = append(b, "\"ViolatesMaxRowSizeErr\":true"...) - } - return printComma, b } diff --git a/pkg/util/log/eventpb/sql_audit_events.go b/pkg/util/log/eventpb/sql_audit_events.go index 2e045821e302..c971d4002aa3 100644 --- a/pkg/util/log/eventpb/sql_audit_events.go +++ b/pkg/util/log/eventpb/sql_audit_events.go @@ -18,7 +18,6 @@ import ( ) var _ error = &CommonLargeRowDetails{} -var _ errors.SafeDetailer = &CommonLargeRowDetails{} var _ fmt.Formatter = &CommonLargeRowDetails{} var _ errors.SafeFormatter = &CommonLargeRowDetails{} @@ -26,20 +25,10 @@ var _ errors.SafeFormatter = &CommonLargeRowDetails{} func (r *CommonLargeRowDetails) Error() string { return fmt.Sprintf( "row larger than max row size: table %v family %v primary key %v size %v", - errors.Safe(r.TableID), errors.Safe(r.FamilyID), r.PrimaryKey, errors.Safe(r.RowSize), + r.TableID, r.FamilyID, r.PrimaryKey, r.RowSize, ) } -// SafeDetails is part of the errors.SafeDetailer interface, which -// CommonLargeRowDetails implements. -func (r *CommonLargeRowDetails) SafeDetails() []string { - return []string{ - fmt.Sprint(r.TableID), - fmt.Sprint(r.FamilyID), - fmt.Sprint(r.RowSize), - } -} - // Format is part of the fmt.Formatter interface, which CommonLargeRowDetails // implements. func (r *CommonLargeRowDetails) Format(s fmt.State, verb rune) { errors.FormatError(r, s, verb) } @@ -47,38 +36,30 @@ func (r *CommonLargeRowDetails) Format(s fmt.State, verb rune) { errors.FormatEr // SafeFormatError is part of the errors.SafeFormatter interface, which // CommonLargeRowDetails implements. func (r *CommonLargeRowDetails) SafeFormatError(p errors.Printer) (next error) { - if p.Detail() { - p.Printf( - "row larger than max row size: table %v family %v size %v", - errors.Safe(r.TableID), errors.Safe(r.FamilyID), errors.Safe(r.RowSize), - ) - } + p.Printf( + "row larger than max row size: table %v family %v size %v", + r.TableID, r.FamilyID, r.RowSize, + ) return nil } // Error helps other structs embedding CommonTxnRowsLimitDetails implement the -// error interface. +// error interface. (Note that it does not implement the error interface +// itself.) func (d *CommonTxnRowsLimitDetails) Error(kind string) string { return fmt.Sprintf( "txn has %s %d rows, which is above the limit: TxnID %v SessionID %v", - kind, d.NumRows, redact.SafeString(d.TxnID), redact.SafeString(d.SessionID), + kind, d.NumRows, d.TxnID, d.SessionID, ) } -// SafeDetails helps other structs embedding CommonTxnRowsLimitDetails implement -// the errors.SafeDetailer interface. -func (d *CommonTxnRowsLimitDetails) SafeDetails(kind string) []string { - return []string{d.TxnID, d.SessionID, fmt.Sprintf("%d", d.NumRows), kind} -} - // SafeFormatError helps other structs embedding CommonTxnRowsLimitDetails -// implement the errors.SafeFormatter interface. +// implement the errors.SafeFormatter interface. (Note that it does not +// implement the errors.SafeFormatter interface itself.) func (d *CommonTxnRowsLimitDetails) SafeFormatError(p errors.Printer, kind string) (next error) { - if p.Detail() { - p.Printf( - "txn has %s %d rows, which is above the limit: TxnID %v SessionID %v", - kind, d.NumRows, redact.SafeString(d.TxnID), redact.SafeString(d.SessionID), - ) - } + p.Printf( + "txn has %s %d rows, which is above the limit: TxnID %v SessionID %v", + kind, d.NumRows, redact.SafeString(d.TxnID), redact.SafeString(d.SessionID), + ) return nil } diff --git a/pkg/util/log/eventpb/sql_audit_events.pb.go b/pkg/util/log/eventpb/sql_audit_events.pb.go index 41b91dca2216..459cc0b1f347 100644 --- a/pkg/util/log/eventpb/sql_audit_events.pb.go +++ b/pkg/util/log/eventpb/sql_audit_events.pb.go @@ -201,11 +201,10 @@ var xxx_messageInfo_SlowQuery proto.InternalMessageInfo // CommonLargeRowDetails contains the fields common to both LargeRow and // LargeRowInternal events. type CommonLargeRowDetails struct { - RowSize uint32 `protobuf:"varint,1,opt,name=row_size,json=rowSize,proto3" json:",omitempty"` - TableID uint32 `protobuf:"varint,2,opt,name=table_id,json=tableId,proto3" json:",omitempty"` - FamilyID uint32 `protobuf:"varint,3,opt,name=family_id,json=familyId,proto3" json:",omitempty"` - PrimaryKey string `protobuf:"bytes,4,opt,name=primary_key,json=primaryKey,proto3" json:",omitempty"` - ViolatesMaxRowSizeErr bool `protobuf:"varint,5,opt,name=violates_max_row_size_err,json=violatesMaxRowSizeErr,proto3" json:",omitempty"` + RowSize uint32 `protobuf:"varint,1,opt,name=row_size,json=rowSize,proto3" json:",omitempty"` + TableID uint32 `protobuf:"varint,2,opt,name=table_id,json=tableId,proto3" json:",omitempty"` + FamilyID uint32 `protobuf:"varint,3,opt,name=family_id,json=familyId,proto3" json:",omitempty"` + PrimaryKey string `protobuf:"bytes,4,opt,name=primary_key,json=primaryKey,proto3" json:",omitempty"` } func (m *CommonLargeRowDetails) Reset() { *m = CommonLargeRowDetails{} } @@ -238,7 +237,7 @@ func (m *CommonLargeRowDetails) XXX_DiscardUnknown() { var xxx_messageInfo_CommonLargeRowDetails proto.InternalMessageInfo // LargeRow is recorded when a statement tries to write a row larger than -// cluster setting `sql.mutations.max_row_size.log` to the database. Multiple +// cluster setting `sql.guardrails.max_row_size_log` to the database. Multiple // LargeRow events will be recorded for statements writing multiple large rows. // LargeRow events are recorded before the transaction commits, so in the case // of transaction abort there will not be a corresponding row in the database. @@ -437,8 +436,8 @@ func (m *SlowQueryInternal) XXX_DiscardUnknown() { var xxx_messageInfo_SlowQueryInternal proto.InternalMessageInfo // LargeRowInternal is recorded when an internal query tries to write a row -// larger than cluster settings `sql.mutations.max_row_size.log` or -// `sql.mutations.max_row_size.err` to the database. +// larger than cluster settings `sql.guardrails.max_row_size_log` or +// `sql.guardrails.max_row_size_err` to the database. type LargeRowInternal struct { CommonEventDetails `protobuf:"bytes,1,opt,name=common,proto3,embedded=common" json:""` CommonLargeRowDetails `protobuf:"bytes,2,opt,name=row,proto3,embedded=row" json:""` @@ -613,67 +612,65 @@ func init() { } var fileDescriptor_b7a82d5e93041841 = []byte{ - // 951 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0xc1, 0x6f, 0x1b, 0xc5, - 0x17, 0xf6, 0xae, 0x93, 0x78, 0xfd, 0xdc, 0xfc, 0x7e, 0x65, 0x49, 0x24, 0x27, 0x08, 0xdb, 0xda, - 0x4b, 0x1d, 0x09, 0xec, 0x92, 0x16, 0x90, 0xb8, 0xc5, 0x4d, 0xa0, 0x16, 0x29, 0x28, 0x5e, 0x4b, - 0x95, 0xb8, 0xac, 0x26, 0xbb, 0x13, 0x33, 0xea, 0xee, 0x4c, 0x32, 0x33, 0x8e, 0xd7, 0xfd, 0x0b, - 0x40, 0x70, 0xe8, 0x01, 0x89, 0x0b, 0x12, 0xff, 0x00, 0x37, 0x8e, 0xfc, 0x03, 0x39, 0xe6, 0xd8, - 0xd3, 0x0a, 0x1c, 0x4e, 0x3d, 0x72, 0xe5, 0x82, 0x66, 0x76, 0x37, 0x50, 0x3b, 0x56, 0x83, 0x44, - 0x0e, 0x55, 0x72, 0x4b, 0xd6, 0xdf, 0xf7, 0xcd, 0xbe, 0xf7, 0xbe, 0xf7, 0x8d, 0x0d, 0x77, 0x86, - 0x92, 0x84, 0xed, 0x90, 0x0d, 0xda, 0xf8, 0x18, 0x53, 0x79, 0xb8, 0xdf, 0x16, 0x47, 0xa1, 0x87, - 0x86, 0x01, 0x91, 0x9e, 0x7e, 0x22, 0x5a, 0x87, 0x9c, 0x49, 0x66, 0xaf, 0xfb, 0xcc, 0x7f, 0xc2, - 0x19, 0xf2, 0xbf, 0x6c, 0x29, 0x4a, 0x2b, 0x64, 0x83, 0x56, 0x46, 0x59, 0x5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7, 0x81, 0xda, 0x93, 0xa1, 0xc4, 0xd7, 0x3a, 0x0c, 0x3a, - 0x1b, 0x27, 0xbf, 0xd5, 0x0a, 0x27, 0x93, 0x9a, 0x71, 0x3a, 0xa9, 0x19, 0xcf, 0x27, 0x35, 0xe3, - 0xd7, 0x49, 0xcd, 0x78, 0x76, 0x56, 0x2b, 0x9c, 0x9e, 0xd5, 0x0a, 0xcf, 0xcf, 0x6a, 0x85, 0x2f, - 0x4a, 0x99, 0xe6, 0xfe, 0x92, 0xfe, 0xc9, 0x7f, 0xef, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1a, - 0xc0, 0x1e, 0xee, 0x6e, 0x10, 0x00, 0x00, + // 914 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x41, 0x6f, 0xe3, 0x44, + 0x14, 0x8e, 0x9d, 0xb6, 0xb1, 0x5f, 0xb6, 0xb0, 0x98, 0xae, 0xe4, 0x2d, 0x22, 0x8e, 0x7c, 0xd9, + 0x54, 0x82, 0x64, 0xe9, 0x2e, 0x20, 0x71, 0x6b, 0xb6, 0x05, 0x22, 0x0a, 0xa8, 0x71, 0xa4, 0x95, + 0xb8, 0x58, 0xae, 0x3d, 0x0d, 0xa3, 0xb5, 0x67, 0xda, 0x99, 0xc9, 0xc6, 0xd9, 0x5f, 0x00, 0x82, + 0xc3, 0x1e, 0x90, 0xb8, 0x20, 0xf1, 0x23, 0x38, 0xf2, 0x07, 0x7a, 0xec, 0x71, 0x4f, 0x16, 0xb8, + 0x9c, 0xf6, 0xc8, 0x95, 0x0b, 0x9a, 0xb1, 0x53, 0xd8, 0xa4, 0xd1, 0x16, 0x89, 0x1e, 0x56, 0xed, + 0xad, 0x75, 0xbe, 0xef, 0x1b, 0xbf, 0xf7, 0xbe, 0xf7, 0x4d, 0x02, 0x77, 0x46, 0x02, 0xc7, 0x9d, + 0x98, 0x0e, 0x3b, 0xe8, 0x31, 0x22, 0xe2, 0x70, 0xbf, 0xc3, 0x8f, 0x62, 0x3f, 0x18, 0x45, 0x58, + 0xf8, 0xea, 0x09, 0x6f, 0x1f, 0x32, 0x2a, 0xa8, 0xb5, 0x1e, 0xd2, 0xf0, 0x11, 0xa3, 0x41, 0xf8, + 0x75, 0x5b, 0x52, 0xda, 0x31, 0x1d, 0xb6, 0x4b, 0xca, 0xfa, 0xda, 0x90, 0x0e, 0xa9, 0x82, 0x75, + 0xe4, 0x5f, 0x05, 0x63, 0xfd, 0xed, 0x39, 0xe9, 0x7f, 0x0b, 0xba, 0x7f, 0x55, 0x61, 0xed, 0x01, + 0x4d, 0x12, 0x4a, 0xbc, 0xbd, 0xdd, 0x9d, 0x14, 0x85, 0xdb, 0x48, 0x04, 0x38, 0xe6, 0xd6, 0x36, + 0x98, 0x28, 0x45, 0xa1, 0x9f, 0xd0, 0x08, 0xd9, 0x5a, 0x53, 0x6b, 0x99, 0xdd, 0x3b, 0xcf, 0x33, + 0x07, 0xde, 0xa1, 0x09, 0x16, 0x28, 0x39, 0x14, 0x93, 0x3f, 0x33, 0xe7, 0x16, 0x43, 0x51, 0x10, + 0x8a, 0x8f, 0x5c, 0x42, 0x09, 0x47, 0x84, 0x63, 0x81, 0x1f, 0x23, 0xb7, 0x6f, 0x48, 0xe6, 0xe7, + 0x34, 0x42, 0xd6, 0x06, 0x18, 0x64, 0x94, 0xf8, 0x8c, 0x8e, 0xb9, 0xad, 0x37, 0xb5, 0xd6, 0x52, + 0xf7, 0xb5, 0x17, 0x45, 0xfa, 0x35, 0x32, 0x4a, 0xfa, 0x74, 0xcc, 0xad, 0x2f, 0xc1, 0xe0, 0x47, + 0x31, 0x17, 0x81, 0x40, 0x76, 0x55, 0x9d, 0x77, 0x2f, 0xcf, 0x1c, 0xc3, 0xdb, 0xdb, 0xf5, 0x06, + 0x5b, 0x83, 0x9d, 0x0b, 0x9f, 0x3d, 0x15, 0xb1, 0xde, 0x05, 0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, 0xed, 0x39, 0x6b, 0xcf, 0x77, 0x3a, + 0xdc, 0x50, 0x69, 0x20, 0xf7, 0x64, 0x24, 0xd0, 0x95, 0x0e, 0x83, 0xee, 0xc6, 0xf1, 0xef, 0x8d, + 0xca, 0x71, 0xde, 0xd0, 0x4e, 0xf2, 0x86, 0xf6, 0x2c, 0x6f, 0x68, 0xbf, 0xe5, 0x0d, 0xed, 0xe9, + 0x69, 0xa3, 0x72, 0x72, 0xda, 0xa8, 0x3c, 0x3b, 0x6d, 0x54, 0xbe, 0xaa, 0x95, 0x9a, 0xfb, 0x2b, + 0xea, 0x87, 0xfa, 0xbd, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe2, 0xb9, 0xb4, 0xa3, 0x24, 0x10, + 0x00, 0x00, } func (m *CommonSQLExecDetails) Marshal() (dAtA []byte, err error) { @@ -954,16 +951,6 @@ func (m *CommonLargeRowDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.ViolatesMaxRowSizeErr { - i-- - if m.ViolatesMaxRowSizeErr { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } if len(m.PrimaryKey) > 0 { i -= len(m.PrimaryKey) copy(dAtA[i:], m.PrimaryKey) @@ -1557,9 +1544,6 @@ func (m *CommonLargeRowDetails) Size() (n int) { if l > 0 { n += 1 + l + sovSqlAuditEvents(uint64(l)) } - if m.ViolatesMaxRowSizeErr { - n += 2 - } return n } @@ -2588,26 +2572,6 @@ func (m *CommonLargeRowDetails) Unmarshal(dAtA []byte) error { } m.PrimaryKey = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ViolatesMaxRowSizeErr", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSqlAuditEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ViolatesMaxRowSizeErr = bool(v != 0) default: iNdEx = preIndex skippy, err := skipSqlAuditEvents(dAtA[iNdEx:]) diff --git a/pkg/util/log/eventpb/sql_audit_events.proto b/pkg/util/log/eventpb/sql_audit_events.proto index 3d15cee82c2d..561039c6325f 100644 --- a/pkg/util/log/eventpb/sql_audit_events.proto +++ b/pkg/util/log/eventpb/sql_audit_events.proto @@ -108,11 +108,10 @@ message CommonLargeRowDetails { uint32 table_id = 2 [(gogoproto.customname) = "TableID", (gogoproto.jsontag) = ",omitempty"]; uint32 family_id = 3 [(gogoproto.customname) = "FamilyID", (gogoproto.jsontag) = ",omitempty"]; string primary_key = 4 [(gogoproto.jsontag) = ",omitempty"]; - bool violates_max_row_size_err = 5 [(gogoproto.jsontag) = ",omitempty"]; } // LargeRow is recorded when a statement tries to write a row larger than -// cluster setting `sql.mutations.max_row_size.log` to the database. Multiple +// cluster setting `sql.guardrails.max_row_size_log` to the database. Multiple // LargeRow events will be recorded for statements writing multiple large rows. // LargeRow events are recorded before the transaction commits, so in the case // of transaction abort there will not be a corresponding row in the database. @@ -177,8 +176,8 @@ message SlowQueryInternal { } // LargeRowInternal is recorded when an internal query tries to write a row -// larger than cluster settings `sql.mutations.max_row_size.log` or -// `sql.mutations.max_row_size.err` to the database. +// larger than cluster settings `sql.guardrails.max_row_size_log` or +// `sql.guardrails.max_row_size_err` to the database. message LargeRowInternal { CommonEventDetails common = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; CommonLargeRowDetails row = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true];