Skip to content

Commit 2b6fc50

Browse files
craig[bot]spilchenannrpomrafiss
committed
149583: sql/inspect: introduce new INSPECT processor into DistSQL flow r=spilchen a=spilchen This change integrates a new INSPECT processor into the DistSQL framework. The job coordinator for INSPECT now builds a distributed plan across the key spans of a single table (currently only supports one table). The plan is executed across nodes based on the partitioning of the table, invoking the new INSPECT processor on each participating node. At present, the processor is a no-op that simply returns success, laying groundwork for future changes. Informs: #148683 Epic: CRDB-30356 Release note: none 149709: go.mod: bump Pebble to a370be5e7e50 r=annrpom a=annrpom Changes: * [`a370be5e`](cockroachdb/pebble@a370be5e) internal/keyspan: fix swallowed error in InterleavingIter.NextPrefix * [`6630a64b`](cockroachdb/pebble@6630a64b) db: print value separation metrics * [`6f57a213`](cockroachdb/pebble@6f57a213) db: merge in obsolete blob file during failed blob rewrite compaction Release note: none. Epic: none. 149716: multiregionccl: skip TestMultiRegionTenantRegions under duress r=rafiss a=rafiss fixes #149010 Release note: None Co-authored-by: Matt Spilchen <[email protected]> Co-authored-by: Annie Pompa <[email protected]> Co-authored-by: Rafi Shamim <[email protected]>
4 parents e2c5563 + a62155f + a56feca + 15e0103 commit 2b6fc50

File tree

29 files changed

+514
-86
lines changed

29 files changed

+514
-86
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
/pkg/sql/execinfrapb/processors_bulk_io.proto @cockroachdb/disaster-recovery
6363
/pkg/sql/execinfrapb/processors_changefeeds.proto @cockroachdb/cdc-prs
6464
/pkg/sql/execinfrapb/processors_ttl.proto @cockroachdb/sql-foundations
65+
/pkg/sql/execinfrapb/processors_inspect.proto @cockroachdb/sql-foundations
6566
/pkg/sql/exec_factory_util.go @cockroachdb/sql-queries-prs
6667
#!/pkg/sql/exec_log*.go @cockroachdb/sql-queries-noreview
6768
#!/pkg/sql/exec_util*.go @cockroachdb/sql-queries-noreview
@@ -106,6 +107,7 @@
106107
/pkg/sql/tests/rsg_test.go @cockroachdb/sql-foundations
107108
/pkg/sql/ttl @cockroachdb/sql-foundations
108109
/pkg/sql/spanutils/ @cockroachdb/sql-foundations
110+
/pkg/sql/inspect/ @cockroachdb/sql-foundations
109111

110112
/pkg/sql/syntheticprivilege/ @cockroachdb/sql-foundations
111113
/pkg/sql/syntheticprivilegecache/ @cockroachdb/sql-foundations

DEPS.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,10 +1835,10 @@ def go_deps():
18351835
patches = [
18361836
"@com_github_cockroachdb_cockroach//build/patches:com_github_cockroachdb_pebble.patch",
18371837
],
1838-
sha256 = "23d6f7ca193051e5ba0317a0d6346f0e26ceb4965060fbc5b8cc6e16b7fda849",
1839-
strip_prefix = "github.com/cockroachdb/[email protected]20250703175825-20e2cbcd70de",
1838+
sha256 = "d3a727e03593def35072caac3e097b4cbc58ebafc3f8dc7294f9acfb7c4d79c0",
1839+
strip_prefix = "github.com/cockroachdb/[email protected]20250708172732-a370be5e7e50",
18401840
urls = [
1841-
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20250703175825-20e2cbcd70de.zip",
1841+
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20250708172732-a370be5e7e50.zip",
18421842
],
18431843
)
18441844
go_repository(

build/bazelutil/distdir_files.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ DISTDIR_FILES = {
358358
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/gostdlib/com_github_cockroachdb_gostdlib-v1.19.0.zip": "c4d516bcfe8c07b6fc09b8a9a07a95065b36c2855627cb3514e40c98f872b69e",
359359
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/logtags/com_github_cockroachdb_logtags-v0.0.0-20241215232642-bb51bb14a506.zip": "920068af09e3846d9ebb4e4a7787ff1dd10f3989c5f940ad861b0f6a9f824f6e",
360360
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/metamorphic/com_github_cockroachdb_metamorphic-v0.0.0-20231108215700-4ba948b56895.zip": "28c8cf42192951b69378cf537be5a9a43f2aeb35542908cc4fe5f689505853ea",
361-
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20250703175825-20e2cbcd70de.zip": "23d6f7ca193051e5ba0317a0d6346f0e26ceb4965060fbc5b8cc6e16b7fda849",
361+
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20250708172732-a370be5e7e50.zip": "d3a727e03593def35072caac3e097b4cbc58ebafc3f8dc7294f9acfb7c4d79c0",
362362
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/redact/com_github_cockroachdb_redact-v1.1.6.zip": "018eccb5fb9ca52d43ec9eaf213539d01c1f2b94e0e822406ebfb2e9321ef6cf",
363363
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/returncheck/com_github_cockroachdb_returncheck-v0.0.0-20200612231554-92cdbca611dd.zip": "ce92ba4352deec995b1f2eecf16eba7f5d51f5aa245a1c362dfe24c83d31f82b",
364364
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/stress/com_github_cockroachdb_stress-v0.0.0-20220803192808-1806698b1b7b.zip": "3fda531795c600daf25532a4f98be2a1335cd1e5e182c72789bca79f5f69fcc1",

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ require (
140140
github.com/cockroachdb/go-test-teamcity v0.0.0-20191211140407-cff980ad0a55
141141
github.com/cockroachdb/gostdlib v1.19.0
142142
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506
143-
github.com/cockroachdb/pebble v0.0.0-20250703175825-20e2cbcd70de
143+
github.com/cockroachdb/pebble v0.0.0-20250708172732-a370be5e7e50
144144
github.com/cockroachdb/redact v1.1.6
145145
github.com/cockroachdb/returncheck v0.0.0-20200612231554-92cdbca611dd
146146
github.com/cockroachdb/stress v0.0.0-20220803192808-1806698b1b7b

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,8 +582,8 @@ github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 h1:ASDL+UJcILM
582582
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506/go.mod h1:Mw7HqKr2kdtu6aYGn3tPmAftiP3QPX63LdK/zcariIo=
583583
github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA=
584584
github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA=
585-
github.com/cockroachdb/pebble v0.0.0-20250703175825-20e2cbcd70de h1:PXtuqYSHdl6XuV+OueyfHwxgGJHVASj0wU4NfqYksmw=
586-
github.com/cockroachdb/pebble v0.0.0-20250703175825-20e2cbcd70de/go.mod h1:LLa+I2vZrOsrsy4QcuZ6wSXBNQll7erNg3GCr8NpE90=
585+
github.com/cockroachdb/pebble v0.0.0-20250708172732-a370be5e7e50 h1:nURMd/syIIPsnG2yFt0rx4kUFmjSuCIuGys74/YQxEY=
586+
github.com/cockroachdb/pebble v0.0.0-20250708172732-a370be5e7e50/go.mod h1:LLa+I2vZrOsrsy4QcuZ6wSXBNQll7erNg3GCr8NpE90=
587587
github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
588588
github.com/cockroachdb/redact v1.1.6 h1:zXJBwDZ84xJNlHl1rMyCojqyIxv+7YUpQiJLQ7n4314=
589589
github.com/cockroachdb/redact v1.1.6/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=

pkg/ccl/multiregionccl/multiregion_system_table_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ func TestMultiRegionTenantRegions(t *testing.T) {
330330
defer leaktest.AfterTest(t)()
331331
defer log.Scope(t).Close(t)
332332

333+
skip.UnderDuress(t, "slow test")
334+
333335
tc, _, cleanup := multiregionccltestutils.TestingCreateMultiRegionCluster(
334336
t, 3 /*numServers*/, base.TestingKnobs{},
335337
)

pkg/cli/interactive_tests/test_encryption.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ end_test
5353

5454
start_test "Run pebble debug tool."
5555
send "$argv debug pebble db lsm $storedir\r"
56-
eexpect "level | tables size val-bl vtables | score ff cff | in | tables size | tables size | tables size | read | r w\r"
56+
eexpect "level | tables size val-bl vtables | score ff cff | in | tables size | tables size | tables size | read | r w | refsz valblk\r"
5757
end_test
5858

5959
start_test "Restart with plaintext."
@@ -107,7 +107,7 @@ end_test
107107

108108
start_test "Run pebble debug tool with AES-256."
109109
send "$argv debug pebble db lsm $storedir --enterprise-encryption=path=$storedir,key=$keydir/aes-256.key,old-key=$keydir/aes-256.key\r"
110-
eexpect "level | tables size val-bl vtables | score ff cff | in | tables size | tables size | tables size | read | r w\r"
110+
eexpect "level | tables size val-bl vtables | score ff cff | in | tables size | tables size | tables size | read | r w | refsz valblk\r"
111111
# Try running without the encryption flag.
112112
send "$argv debug pebble db lsm $storedir\r"
113113
eexpect "If this is an encrypted store, make sure the correct encryption key is set."

pkg/jobs/jobspb/jobs.proto

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,42 @@ message HotRangesLoggerDetails {
14051405
}
14061406

14071407
message InspectDetails {
1408+
// Check represents a single validation task to perform as part of an INSPECT
1409+
// job. Each check targets a specific table or index and is associated with a
1410+
// validation type.
1411+
message Check {
1412+
enum InspectCheckType {
1413+
option (gogoproto.goproto_enum_prefix) = false;
1414+
option (gogoproto.goproto_enum_stringer) = false;
1415+
1416+
// UNSPECIFIED indicates an unset check type. This is invalid.
1417+
INSPECT_CHECK_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "InspectCheckUnspecified"];
1418+
1419+
// INDEX_CONSISTENCY performs validation between primary and secondary indexes
1420+
// to detect missing or dangling index entries.
1421+
INSPECT_CHECK_INDEX_CONSISTENCY = 1 [(gogoproto.enumvalue_customname) = "InspectCheckIndexConsistency"];
1422+
}
1423+
1424+
// Type is the kind of validation to perform.
1425+
InspectCheckType type = 1;
1426+
1427+
// TableID identifies the table this check applies to.
1428+
uint32 table_id = 2 [
1429+
(gogoproto.customname) = "TableID",
1430+
(gogoproto.casttype) = "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb.ID"
1431+
];
1432+
1433+
// IndexID identifies the specific index to check, if applicable. Only
1434+
// relevant for check types that operate at the index level. Should be unset
1435+
// or ignored for table-level checks.
1436+
uint32 index_id = 3 [
1437+
(gogoproto.customname) = "IndexID",
1438+
(gogoproto.casttype) = "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb.IndexID"
1439+
];
1440+
}
14081441

1442+
// Checks is the list of individual checks this job will perform.
1443+
repeated Check checks = 1;
14091444
}
14101445

14111446
message UpdateTableMetadataCacheDetails {}

pkg/sql/colexec/colbuilder/execplan.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ func canWrap(mode sessiondatapb.VectorizeExecMode, core *execinfrapb.ProcessorCo
320320
return errIndexBackfillMergerWrap
321321
case core.Ttl != nil:
322322
return errCoreNotWorthWrapping
323+
case core.Inspect != nil:
324+
return errCoreNotWorthWrapping
323325
case core.HashGroupJoiner != nil:
324326
case core.GenerativeSplitAndScatter != nil:
325327
return errCoreNotWorthWrapping

pkg/sql/distsql_leaf_txn.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ func planSafeForReducedLeaf(processors []physicalplan.Processor) bool {
233233
return unoptimizedProcessor
234234
case core.Ttl != nil:
235235
return unoptimizedProcessor
236+
case core.Inspect != nil:
237+
return unoptimizedProcessor
236238
case core.HashGroupJoiner != nil:
237239
if unsafeExpr(core.HashGroupJoiner.HashJoinerSpec.OnExpr) {
238240
return unsafeProcessor

0 commit comments

Comments
 (0)