Skip to content

Commit 325aac0

Browse files
craig[bot]railarulajmanirafissRaduBerinde
committed
154031: WORKSPACE: update pgo profile r=mgartner a=rail Benchstat results: ``` │ benchstat_old.txt │ benchstat.txt │ │ queries/sec │ queries/sec vs base │ Sysbench/a=oltp_read_write/nodes=3/cpu=8/conc=64 25.86k ± 3% 27.15k ± 1% +5.00% (p=0.000 n=20) │ benchstat_old.txt │ benchstat.txt │ │ txns/sec │ txns/sec vs base │ Sysbench/a=oltp_read_write/nodes=3/cpu=8/conc=64 1.293k ± 3% 1.358k ± 1% +5.00% (p=0.000 n=20) │ benchstat_old.txt │ benchstat.txt │ │ ms/min │ ms/min vs base │ Sysbench/a=oltp_read_write/nodes=3/cpu=8/conc=64 13.00 ± 4% 12.13 ± 5% -6.69% (p=0.000 n=20) │ benchstat_old.txt │ benchstat.txt │ │ ms/avg │ ms/avg vs base │ Sysbench/a=oltp_read_write/nodes=3/cpu=8/conc=64 49.50 ± 3% 47.14 ± 1% -4.77% (p=0.000 n=20) │ benchstat_old.txt │ benchstat.txt │ │ ms/p95 │ ms/p95 vs base │ Sysbench/a=oltp_read_write/nodes=3/cpu=8/conc=64 77.89 ± 3% 71.83 ± 2% -7.79% (p=0.000 n=20) │ benchstat_old.txt │ benchstat.txt │ │ ms/max │ ms/max vs base │ Sysbench/a=oltp_read_write/nodes=3/cpu=8/conc=64 251.4 ± 6% 216.9 ± 12% ~ (p=0.086 n=20) ``` Fixes: REL-3226 Release note: None 154408: rangefeed: make TestUnrecoverableErrors work with multi-tenancy r=tbg a=arulajmani This test wants to see errors because of strict GC enforcement policies. To do so, it creates a scratch range and tries to trigger an error there. Strict GC enforcement policies don't apply to the scratch range out of the box, so to sidestep this, the test would explicitly configure the scratch range's span config. This explicit configuration only worked for the system tenant previously; this patch extends it to secondary tenants. Closes #109472 Release note: None 154495: sql: add guardrail for approximate max schema objects r=rafiss a=rafiss This adds a new cluster setting `sql.schema.approx_max_object_count` that operators can use to limit the total number of schema objects (tables, databases, schemas, types, functions) in a cluster. The implementation uses cached table statistics from TableStatisticsCache to count descriptors in system.descriptor, avoiding expensive `COUNT(*)` queries. If cached statistics are unavailable, object creation is allowed. The check is enforced in both the legacy and declarative schema changers. fixes #148286 Release note (ops change): Added cluster setting `sql.schema.approx_max_object_count` (default: 20,000) to prevent creation of new schema objects when the limit is exceeded. The check uses cached table statistics for performance and is approximate - it may not be immediately accurate until table statistics are updated by the background statistics refreshing job. Clusters that have been running stably with a larger object count should raise the limit or disable the limit by setting the value to 0. In future releases, the default value for this setting will be raised as more CockroachDB features support larger object counts. 154556: build: enable custom toolchain use in crlib r=RaduBerinde a=RaduBerinde We set up a patch to enable the crdb-specific code in crlib/crsync. We add a test in syncutil which verifies that the correct path is being used. Epic: none Release note: None Co-authored-by: Rail Aliiev <[email protected]> Co-authored-by: Arul Ajmani <[email protected]> Co-authored-by: Rafi Shamim <[email protected]> Co-authored-by: Radu Berinde <[email protected]>
5 parents 8f858b5 + 8406c66 + 5efe495 + 11fbc96 + ced7762 commit 325aac0

30 files changed

+358
-14
lines changed

DEPS.bzl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,10 +1750,14 @@ def go_deps():
17501750
name = "com_github_cockroachdb_crlib",
17511751
build_file_proto_mode = "disable_global",
17521752
importpath = "github.com/cockroachdb/crlib",
1753-
sha256 = "4e2aad9df48f99411a51186fdf92041c881adc642c87106776734e8a64578077",
1754-
strip_prefix = "github.com/cockroachdb/[email protected]",
1753+
patch_args = ["-p1"],
1754+
patches = [
1755+
"@com_github_cockroachdb_cockroach//build/patches:com_github_cockroachdb_crlib.patch",
1756+
],
1757+
sha256 = "539dd737ca1da53ee5c296ea0f3aad92f6d59f577e0d169dffb5a4ad706e1728",
1758+
strip_prefix = "github.com/cockroachdb/[email protected]",
17551759
urls = [
1756-
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/crlib/com_github_cockroachdb_crlib-v0.0.0-20250916151006-1094cb39adac.zip",
1760+
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/crlib/com_github_cockroachdb_crlib-v0.0.0-20251001180057-2a49e1873587.zip",
17571761
],
17581762
)
17591763
go_repository(

WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,8 @@ load("//build:pgo.bzl", "pgo_profile")
641641

642642
pgo_profile(
643643
name = "pgo_profile",
644-
sha256 = "57414977040f9ed887a4e2b0434ca97f0047229928d8456a25acb3e08b4a71f2",
645-
url = "https://storage.googleapis.com/cockroach-profiles/20250616172238-909ceb6ada01354d34416f1087fc256a066daa17.pb.gz",
644+
sha256 = "7500eeeecba8edc9d25fd65b178568e7c543b50b3ef3ffc5e6e13af186ae2023",
645+
url = "https://storage.googleapis.com/cockroach-profiles/20250926213937-4c6b4ce4dd320a7aa835757ed60f295f6e7c692c.pb.gz",
646646
)
647647

648648
# Download and register the FIPS enabled Go toolchain at the end to avoid toolchain conflicts for gazelle.

build/bazelutil/distdir_files.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ DISTDIR_FILES = {
346346
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/cmux/com_github_cockroachdb_cmux-v0.0.0-20250514152509-914d3bf9ec58.zip": "c1cf4cd99a1ad6a00f2ccd4188cbcf004cb0d56895670b2c171061ce564cd791",
347347
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/cockroach-go/v2/com_github_cockroachdb_cockroach_go_v2-v2.4.1.zip": "ba646db91152f3121a6812c7b74d12d8c0e126f7b4d3b927618b159692ceb424",
348348
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/crlfmt/com_github_cockroachdb_crlfmt-v0.0.0-20221214225007-b2fc5c302548.zip": "fedc01bdd6d964da0425d5eaac8efadc951e78e13f102292cc0774197f09ab63",
349-
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/crlib/com_github_cockroachdb_crlib-v0.0.0-20250916151006-1094cb39adac.zip": "4e2aad9df48f99411a51186fdf92041c881adc642c87106776734e8a64578077",
349+
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/crlib/com_github_cockroachdb_crlib-v0.0.0-20251001180057-2a49e1873587.zip": "539dd737ca1da53ee5c296ea0f3aad92f6d59f577e0d169dffb5a4ad706e1728",
350350
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/datadriven/com_github_cockroachdb_datadriven-v1.0.3-0.20250911232732-d959cf14706c.zip": "417027b5ff27774000129768f79e9ae62021b95d3ac9d3181e132dbe46b44da3",
351351
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/drpc/com_github_cockroachdb_drpc-v0.0.0-20250924114114-78d4e121902a.zip": "98b44a51f82873f93f77da80230212ab40f35044e8d38645cb1392ae03462f0b",
352352
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/errors/com_github_cockroachdb_errors-v1.12.0.zip": "f73d8a5f4d8fcbc4ed61db2b47f17e2601d8b32e9a49c0665667489d9d9d6e7c",
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
diff --git a/crsync/BUILD.bazel b/crsync/BUILD.bazel
2+
index e787597..0c25863 100644
3+
--- a/crsync/BUILD.bazel
4+
+++ b/crsync/BUILD.bazel
5+
@@ -4,13 +4,22 @@ go_library(
6+
name = "crsync",
7+
srcs = [
8+
"counters.go",
9+
- "sharding_vanilla.go",
10+
+ ":gen-sharding_crdb",
11+
"typed_atomic.go",
12+
],
13+
importpath = "github.com/cockroachdb/crlib/crsync",
14+
visibility = ["//visibility:public"],
15+
)
16+
17+
+REMOVE_GO_BUILD_CONSTRAINTS = "cat $< | grep -v '//go:build' | grep -v '// +build' > $@"
18+
+
19+
+genrule(
20+
+ name = "gen-sharding_crdb",
21+
+ srcs = ["sharding_crdb.go"],
22+
+ outs = ["gen-sharding_crdb.go"],
23+
+ cmd = REMOVE_GO_BUILD_CONSTRAINTS,
24+
+)
25+
+
26+
alias(
27+
name = "go_default_library",
28+
actual = ":crsync",

build/scripts/patch-apply.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ echo ""
4949

5050
if patch -p1 < "$PATCH_FILE"; then
5151
echo "Patch applied successfully."
52+
echo ""
53+
echo "If you get an error applying the patch when building: comment out the patch in DEPS.bzl,"
54+
echo "build cockroach, then inspect the relevant files in _bazel/cockroach/external/<repo>".
5255
else
5356
echo "Failed to apply patch."
5457
echo "Make sure the repository is at the proper commit."

docs/generated/settings/settings-for-tenants.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ sql.multiple_modifications_of_table.enabled boolean false if true, allow stateme
346346
sql.multiregion.drop_primary_region.enabled boolean true allows dropping the PRIMARY REGION of a database if it is the last region application
347347
sql.notices.enabled boolean true enable notices in the server/client protocol being sent application
348348
sql.optimizer.uniqueness_checks_for_gen_random_uuid.enabled boolean false if enabled, uniqueness checks may be planned for mutations of UUID columns updated with gen_random_uuid(); otherwise, uniqueness is assumed due to near-zero collision probability application
349+
sql.schema.approx_max_object_count integer 20000 approximate maximum number of schema objects allowed in the cluster; the check uses cached statistics, so the actual count may slightly exceed this limit; set to 0 to disable application
349350
sql.schema.telemetry.recurrence string @weekly cron-tab recurrence for SQL schema telemetry job system-visible
350351
sql.spatial.experimental_box2d_comparison_operators.enabled boolean false enables the use of certain experimental box2d comparison operators application
351352
sql.sqlcommenter.enabled boolean false enables support for sqlcommenter. Key value parsed from sqlcommenter comments will be included in sql insights and sql logs. See https://google.github.io/sqlcommenter/ for more details. application

docs/generated/settings/settings.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@
301301
<tr><td><div id="setting-sql-multiregion-drop-primary-region-enabled" class="anchored"><code>sql.multiregion.drop_primary_region.enabled</code></div></td><td>boolean</td><td><code>true</code></td><td>allows dropping the PRIMARY REGION of a database if it is the last region</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
302302
<tr><td><div id="setting-sql-notices-enabled" class="anchored"><code>sql.notices.enabled</code></div></td><td>boolean</td><td><code>true</code></td><td>enable notices in the server/client protocol being sent</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
303303
<tr><td><div id="setting-sql-optimizer-uniqueness-checks-for-gen-random-uuid-enabled" class="anchored"><code>sql.optimizer.uniqueness_checks_for_gen_random_uuid.enabled</code></div></td><td>boolean</td><td><code>false</code></td><td>if enabled, uniqueness checks may be planned for mutations of UUID columns updated with gen_random_uuid(); otherwise, uniqueness is assumed due to near-zero collision probability</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
304+
<tr><td><div id="setting-sql-schema-approx-max-object-count" class="anchored"><code>sql.schema.approx_max_object_count</code></div></td><td>integer</td><td><code>20000</code></td><td>approximate maximum number of schema objects allowed in the cluster; the check uses cached statistics, so the actual count may slightly exceed this limit; set to 0 to disable</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
304305
<tr><td><div id="setting-sql-schema-telemetry-recurrence" class="anchored"><code>sql.schema.telemetry.recurrence</code></div></td><td>string</td><td><code>@weekly</code></td><td>cron-tab recurrence for SQL schema telemetry job</td><td>Advanced/Self-hosted (read-write); Basic/Standard (read-only)</td></tr>
305306
<tr><td><div id="setting-sql-spatial-experimental-box2d-comparison-operators-enabled" class="anchored"><code>sql.spatial.experimental_box2d_comparison_operators.enabled</code></div></td><td>boolean</td><td><code>false</code></td><td>enables the use of certain experimental box2d comparison operators</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
306307
<tr><td><div id="setting-sql-sqlcommenter-enabled" class="anchored"><code>sql.sqlcommenter.enabled</code></div></td><td>boolean</td><td><code>false</code></td><td>enables support for sqlcommenter. Key value parsed from sqlcommenter comments will be included in sql insights and sql logs. See https://google.github.io/sqlcommenter/ for more details.</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ require (
136136
github.com/cockroachdb/cmux v0.0.0-20250514152509-914d3bf9ec58
137137
github.com/cockroachdb/cockroach-go/v2 v2.4.1
138138
github.com/cockroachdb/crlfmt v0.0.0-20221214225007-b2fc5c302548
139-
github.com/cockroachdb/crlib v0.0.0-20250916151006-1094cb39adac
139+
github.com/cockroachdb/crlib v0.0.0-20251001180057-2a49e1873587
140140
github.com/cockroachdb/datadriven v1.0.3-0.20250911232732-d959cf14706c
141141
github.com/cockroachdb/errors v1.12.0
142142
github.com/cockroachdb/go-test-teamcity v0.0.0-20191211140407-cff980ad0a55

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,8 @@ github.com/cockroachdb/cockroach-go/v2 v2.4.1 h1:ACVT/zXsuK6waRPVYtDQpsM8pPA7IA/
555555
github.com/cockroachdb/cockroach-go/v2 v2.4.1/go.mod h1:9U179XbCx4qFWtNhc7BiWLPfuyMVQ7qdAhfrwLz1vH0=
556556
github.com/cockroachdb/crlfmt v0.0.0-20221214225007-b2fc5c302548 h1:i0bnjanlWAvM50wHMT7EFyxlt5HQusznWrkwl+HBIsU=
557557
github.com/cockroachdb/crlfmt v0.0.0-20221214225007-b2fc5c302548/go.mod h1:qtkxNlt5i3rrdirfJE/bQeW/IeLajKexErv7jEIV+Uc=
558-
github.com/cockroachdb/crlib v0.0.0-20250916151006-1094cb39adac h1:L+7nhSrQ9WzW91AJHP0LmjwMHEed2nl5b7PvN9eIw58=
559-
github.com/cockroachdb/crlib v0.0.0-20250916151006-1094cb39adac/go.mod h1:Gq51ZeKaFCXk6QwuGM0w1dnaOqc/F5zKT2zA9D6Xeac=
558+
github.com/cockroachdb/crlib v0.0.0-20251001180057-2a49e1873587 h1:qjG2TrBrPbGRVYp5obcAi8OSsuFJ8s1AElDImHLV9tY=
559+
github.com/cockroachdb/crlib v0.0.0-20251001180057-2a49e1873587/go.mod h1:ae57yNis2F1FThSNdPdoXfiPOVi8G1TLreCBQYPOdqo=
560560
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
561561
github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU=
562562
github.com/cockroachdb/datadriven v1.0.3-0.20250911232732-d959cf14706c h1:a0m7gmtv2mzJQ4wP9BkxCmJAnjZ7fsvCi2IORGD1als=

pkg/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,6 +2311,7 @@ GO_TARGETS = [
23112311
"//pkg/sql/schemachanger/sctest:sctest",
23122312
"//pkg/sql/schemachanger:schemachanger",
23132313
"//pkg/sql/schemachanger:schemachanger_test",
2314+
"//pkg/sql/schemaobjectlimit:schemaobjectlimit",
23142315
"//pkg/sql/scrub/scrubtestutils:scrubtestutils",
23152316
"//pkg/sql/scrub:scrub",
23162317
"//pkg/sql/sem/asof:asof",

0 commit comments

Comments
 (0)