Skip to content

Commit ada407c

Browse files
craig[bot]cockroach-teamcityarulajmaniRaduBerindejasonlmfong
committed
158810: build: update PGO profile to 20251204202750-818ff5108cdb1f16f69b3d915acdb4f669b848eb.pb.gz r=srosenberg a=cockroach-teamcity This PR updates the PGO (Profile-Guided Optimization) profile used for building CockroachDB. The new profile was validated using tpcc-nowait benchmarks. Results comparing the old profile (before) vs new profile (after): ``` │ artifacts/benchstat_before.txt │ artifacts/benchstat_after.txt │ │ ops/sec │ ops/sec vs base │ TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/delivery 135.4 ± 3% 136.9 ± 4% ~ (p=0.683 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/neworder 1.355k ± 3% 1.369k ± 4% ~ (p=0.703 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/orderstatus 135.4 ± 3% 136.9 ± 4% ~ (p=0.683 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/payment 1.355k ± 3% 1.369k ± 4% ~ (p=0.703 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/stocklevel 135.4 ± 3% 136.9 ± 4% ~ (p=0.713 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/total 3.115k ± 3% 3.150k ± 4% ~ (p=0.703 n=20) geomean 492.1 497.6 +1.10% │ artifacts/benchstat_before.txt │ artifacts/benchstat_after.txt │ │ ms/avg │ ms/avg vs base │ TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/delivery 67.55 ± 3% 67.20 ± 6% ~ (p=0.693 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/neworder 108.4 ± 3% 106.1 ± 3% ~ (p=0.457 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/orderstatus 14.45 ± 4% 14.40 ± 5% ~ (p=0.416 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/payment 29.70 ± 5% 30.90 ± 5% ~ (p=0.176 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/stocklevel 19.65 ± 1% 19.55 ± 3% ~ (p=0.804 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/total 64.20 ± 3% 63.50 ± 4% ~ (p=0.693 n=20) geomean 39.78 39.74 -0.11% │ artifacts/benchstat_before.txt │ artifacts/benchstat_after.txt │ │ ms/p50 │ ms/p50 vs base │ TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/delivery 63.95 ± 5% 62.90 ± 7% ~ (p=0.582 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/neworder 104.9 ± 4% 102.8 ± 2% ~ (p=0.611 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/orderstatus 9.400 ± 6% 9.400 ± 6% ~ (p=0.104 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/payment 26.20 ± 4% 27.30 ± 8% ~ (p=0.163 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/stocklevel 15.20 ± 3% 15.45 ± 6% ~ (p=0.734 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/total 50.30 ± 4% 50.30 ± 4% ~ (p=0.426 n=20) geomean 32.88 32.99 +0.34% │ artifacts/benchstat_before.txt │ artifacts/benchstat_after.txt │ │ ms/p95 │ ms/p95 vs base │ TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/delivery 113.2 ± 4% 113.2 ± 4% ~ (p=0.622 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/neworder 192.9 ± 4% 184.5 ± 9% ~ (p=0.269 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/orderstatus 41.90 ± 5% 41.90 ± 5% ~ (p=0.621 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/payment 60.80 ± 3% 60.80 ± 3% ~ (p=0.960 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/stocklevel 48.20 ± 4% 46.10 ± 5% ~ (p=0.338 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/total 163.6 ± 3% 159.4 ± 5% ~ (p=0.102 n=20) geomean 87.17 85.51 -1.90% │ artifacts/benchstat_before.txt │ artifacts/benchstat_after.txt │ │ ms/p99 │ ms/p99 vs base │ TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/delivery 146.8 ± 3% 142.6 ± 6% ~ (p=0.683 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/neworder 234.9 ± 4% 226.5 ± 7% ~ (p=0.211 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/orderstatus 65.00 ± 3% 62.90 ± 7% ~ (p=0.220 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/payment 88.10 ± 5% 86.00 ± 2% ~ (p=0.957 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/stocklevel 71.30 ± 6% 71.30 ± 0% ~ (p=0.449 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/total 213.9 ± 2% 209.7 ± 4% ~ (p=0.210 n=20) geomean 120.2 117.4 -2.34% │ artifacts/benchstat_before.txt │ artifacts/benchstat_after.txt │ │ ms/max │ ms/max vs base │ TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/delivery 255.8 ± 5% 285.2 ± 12% ~ (p=0.090 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/neworder 402.7 ± 8% 402.7 ± 8% ~ (p=0.700 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/orderstatus 172.0 ± 12% 176.2 ± 10% ~ (p=0.501 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/payment 230.7 ± 5% 222.3 ± 9% ~ (p=0.421 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/stocklevel 192.9 ± 9% 192.9 ± 9% ~ (p=0.781 n=20) TPCC/tpcc-nowait/literal/w=1000/nodes=5/cpu=16/total 402.7 ± 8% 402.7 ± 8% ~ (p=0.700 n=20) geomean 261.2 265.4 +1.61% ``` Epic: none Release note: none 158909: storeliveness: remove stale TODO r=arulajmani a=arulajmani No longer applies as the cluster setting is on by default. Epic: none Release note: None 158936: go.mod: bump Pebble to eec404107db6 r=RaduBerinde a=RaduBerinde Changes: * [`eec40410`](cockroachdb/pebble@eec40410) objstorageprovider: add dual-write for cold metadata * [`fd11d171`](cockroachdb/pebble@fd11d171) objstorageprovider: clean up datadriven tests * [`fd767661`](cockroachdb/pebble@fd767661) go.mod: update datadriven * [`cebacb9c`](cockroachdb/pebble@cebacb9c) db: remove FilterType option * [`26371eaf`](cockroachdb/pebble@26371eaf) internal/base: introduce KVMeta, iterators Release note: none. Epic: none. 158986: ts: limit the recording of child metrics to a small set of metrics r=jasonlmfong a=jasonlmfong This change adds an explicit list of metrics which we perform child metrics collection for. This helps bound the performance impact even when the cluster setting `timeseries.child_metrics.enable`d is turned on. Epic: CRDB-55079 Release: The list of metrics which we record child metrics in TSDB has been reduced from all changefeed metrics to a defined list. Co-authored-by: Justin Beaver <[email protected]> Co-authored-by: Arul Ajmani <[email protected]> Co-authored-by: Radu Berinde <[email protected]> Co-authored-by: Jason Fong <[email protected]>
5 parents 61a3fef + 11d77c7 + 417fff9 + 61f9d71 + 88525f4 commit ada407c

File tree

15 files changed

+239
-122
lines changed

15 files changed

+239
-122
lines changed

DEPS.bzl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,10 +1764,10 @@ def go_deps():
17641764
name = "com_github_cockroachdb_datadriven",
17651765
build_file_proto_mode = "disable_global",
17661766
importpath = "github.com/cockroachdb/datadriven",
1767-
sha256 = "a7ffcef0b264d9c28c36b2f9b737ff739542f472d7614938ae507e2da269f6c2",
1768-
strip_prefix = "github.com/cockroachdb/[email protected].20251006155849-f84f9e519edd",
1767+
sha256 = "6c1ae8a9550d3a92f85d7371e5c0caf922dc0ff1425e299359814b6a9a587f14",
1768+
strip_prefix = "github.com/cockroachdb/[email protected].20251123150250-ddff6747b112",
17691769
urls = [
1770-
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/datadriven/com_github_cockroachdb_datadriven-v1.0.3-0.20251006155849-f84f9e519edd.zip",
1770+
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/datadriven/com_github_cockroachdb_datadriven-v1.0.3-0.20251123150250-ddff6747b112.zip",
17711771
],
17721772
)
17731773
go_repository(
@@ -1834,10 +1834,10 @@ def go_deps():
18341834
patches = [
18351835
"@com_github_cockroachdb_cockroach//build/patches:com_github_cockroachdb_pebble.patch",
18361836
],
1837-
sha256 = "f318e608fa935791ce965dfab8693db54e101de66b4961a7bd1877c76e3083a1",
1838-
strip_prefix = "github.com/cockroachdb/[email protected]20251202161204-36cb7a24d395",
1837+
sha256 = "0f60d31c331d228bfacf820de70557ce7ae3d450592b7a5e97c6f56a41cf3dd5",
1838+
strip_prefix = "github.com/cockroachdb/[email protected]20251204205628-eec404107db6",
18391839
urls = [
1840-
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20251202161204-36cb7a24d395.zip",
1840+
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20251204205628-eec404107db6.zip",
18411841
],
18421842
)
18431843
go_repository(

WORKSPACE

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

644644
pgo_profile(
645645
name = "pgo_profile",
646-
sha256 = "7500eeeecba8edc9d25fd65b178568e7c543b50b3ef3ffc5e6e13af186ae2023",
647-
url = "https://storage.googleapis.com/cockroach-profiles/20250926213937-4c6b4ce4dd320a7aa835757ed60f295f6e7c692c.pb.gz",
646+
sha256 = "5a23c5b33325d5fc3dfa4e67d872aa8371756f8e4f8f159509e8cc522c298cb2",
647+
url = "https://storage.googleapis.com/cockroach-profiles/20251204202750-818ff5108cdb1f16f69b3d915acdb4f669b848eb.pb.gz",
648648
)

build/bazelutil/distdir_files.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ DISTDIR_FILES = {
343343
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/cockroach-go/v2/com_github_cockroachdb_cockroach_go_v2-v2.4.1.zip": "ba646db91152f3121a6812c7b74d12d8c0e126f7b4d3b927618b159692ceb424",
344344
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/crlfmt/com_github_cockroachdb_crlfmt-v0.0.0-20221214225007-b2fc5c302548.zip": "fedc01bdd6d964da0425d5eaac8efadc951e78e13f102292cc0774197f09ab63",
345345
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/crlib/com_github_cockroachdb_crlib-v0.0.0-20251122031428-fe658a2dbda1.zip": "fa361e52b072ce18ac1d103e2556851906477361b5fe688745d29b1efabff3cb",
346-
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/datadriven/com_github_cockroachdb_datadriven-v1.0.3-0.20251006155849-f84f9e519edd.zip": "a7ffcef0b264d9c28c36b2f9b737ff739542f472d7614938ae507e2da269f6c2",
346+
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/datadriven/com_github_cockroachdb_datadriven-v1.0.3-0.20251123150250-ddff6747b112.zip": "6c1ae8a9550d3a92f85d7371e5c0caf922dc0ff1425e299359814b6a9a587f14",
347347
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/drpc/com_github_cockroachdb_drpc-v0.0.0-20251122104303-6d3d35fe35b3.zip": "3dbe010ef17497f2f3087f6d0ab565c1c469c0fc25ba031159fb107e6969715a",
348348
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/errors/com_github_cockroachdb_errors-v1.12.1-0.20251010171200-64801262cd6f.zip": "4df66cc44791d4290071696abf179dc6df7b94b4cb5d29a20f39c6bf522c60ee",
349349
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/go-test-teamcity/com_github_cockroachdb_go_test_teamcity-v0.0.0-20191211140407-cff980ad0a55.zip": "bac30148e525b79d004da84d16453ddd2d5cd20528e9187f1d7dac708335674b",
@@ -352,7 +352,7 @@ DISTDIR_FILES = {
352352
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/gostdlib/com_github_cockroachdb_gostdlib-v1.19.0.zip": "c4d516bcfe8c07b6fc09b8a9a07a95065b36c2855627cb3514e40c98f872b69e",
353353
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/logtags/com_github_cockroachdb_logtags-v0.0.0-20241215232642-bb51bb14a506.zip": "920068af09e3846d9ebb4e4a7787ff1dd10f3989c5f940ad861b0f6a9f824f6e",
354354
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/metamorphic/com_github_cockroachdb_metamorphic-v0.0.0-20231108215700-4ba948b56895.zip": "28c8cf42192951b69378cf537be5a9a43f2aeb35542908cc4fe5f689505853ea",
355-
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20251202161204-36cb7a24d395.zip": "f318e608fa935791ce965dfab8693db54e101de66b4961a7bd1877c76e3083a1",
355+
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20251204205628-eec404107db6.zip": "0f60d31c331d228bfacf820de70557ce7ae3d450592b7a5e97c6f56a41cf3dd5",
356356
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/redact/com_github_cockroachdb_redact-v1.1.6.zip": "018eccb5fb9ca52d43ec9eaf213539d01c1f2b94e0e822406ebfb2e9321ef6cf",
357357
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/returncheck/com_github_cockroachdb_returncheck-v0.0.0-20200612231554-92cdbca611dd.zip": "ce92ba4352deec995b1f2eecf16eba7f5d51f5aa245a1c362dfe24c83d31f82b",
358358
"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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ require (
133133
github.com/cockroachdb/cmux v0.0.0-20250514152509-914d3bf9ec58
134134
github.com/cockroachdb/cockroach-go/v2 v2.4.1
135135
github.com/cockroachdb/crlib v0.0.0-20251122031428-fe658a2dbda1
136-
github.com/cockroachdb/datadriven v1.0.3-0.20251006155849-f84f9e519edd
136+
github.com/cockroachdb/datadriven v1.0.3-0.20251123150250-ddff6747b112
137137
github.com/cockroachdb/errors v1.12.1-0.20251010171200-64801262cd6f
138138
github.com/cockroachdb/gostdlib v1.19.0
139139
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506
140-
github.com/cockroachdb/pebble v0.0.0-20251202161204-36cb7a24d395
140+
github.com/cockroachdb/pebble v0.0.0-20251204205628-eec404107db6
141141
github.com/cockroachdb/redact v1.1.6
142142
github.com/cockroachdb/returncheck v0.0.0-20200612231554-92cdbca611dd
143143
github.com/cockroachdb/tokenbucket v0.0.0-20250429170803-42689b6311bb

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,8 @@ github.com/cockroachdb/crlib v0.0.0-20251122031428-fe658a2dbda1 h1:iX0YCYC5Jbt2/
554554
github.com/cockroachdb/crlib v0.0.0-20251122031428-fe658a2dbda1/go.mod h1:NjNuToN/FbhwH1cCyM9G4Rhtxx+ZaOgtoqFR+thng7w=
555555
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
556556
github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU=
557-
github.com/cockroachdb/datadriven v1.0.3-0.20251006155849-f84f9e519edd h1:vpWCe7VvdQbQ/9wGtlH3i+Oj+9OggKci3lsASL1ydvg=
558-
github.com/cockroachdb/datadriven v1.0.3-0.20251006155849-f84f9e519edd/go.mod h1:jsaKMvD3RBCATk1/jbUZM8C9idWBJME9+VRZ5+Liq1g=
557+
github.com/cockroachdb/datadriven v1.0.3-0.20251123150250-ddff6747b112 h1:T1++5Vt0/4/IWZ1mHmUYl7fhQnz50QhNWIY+ITvLLIM=
558+
github.com/cockroachdb/datadriven v1.0.3-0.20251123150250-ddff6747b112/go.mod h1:jsaKMvD3RBCATk1/jbUZM8C9idWBJME9+VRZ5+Liq1g=
559559
github.com/cockroachdb/drpc v0.0.0-20251122104303-6d3d35fe35b3 h1:g9feJVqL6mBMZ/odZZsNl2XrsAxRaI6dP/y1PP+lf6s=
560560
github.com/cockroachdb/drpc v0.0.0-20251122104303-6d3d35fe35b3/go.mod h1:Ag2/Yfl22WZ8ywFUasRQ2brdltpX5QvY63jnYTZ3N5U=
561561
github.com/cockroachdb/errors v1.12.1-0.20251010171200-64801262cd6f h1:lUmJxzb2/ukuRIvKTaNkvuj5LwlX4u/KxnI3zmx1SSw=
@@ -572,8 +572,8 @@ github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 h1:ASDL+UJcILM
572572
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506/go.mod h1:Mw7HqKr2kdtu6aYGn3tPmAftiP3QPX63LdK/zcariIo=
573573
github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA=
574574
github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA=
575-
github.com/cockroachdb/pebble v0.0.0-20251202161204-36cb7a24d395 h1:12Csn16z4ZsuLBzwRZYmSNhrScE7cnU99n+z9gj2laM=
576-
github.com/cockroachdb/pebble v0.0.0-20251202161204-36cb7a24d395/go.mod h1:4p9u+hqtw8sRxiY5cNFWETymMf4brYGG90pS8MzlXmg=
575+
github.com/cockroachdb/pebble v0.0.0-20251204205628-eec404107db6 h1:wsh1qV50H39JqvESbH4DyNjf/Q5NS1LR3UnkGJUN0D8=
576+
github.com/cockroachdb/pebble v0.0.0-20251204205628-eec404107db6/go.mod h1:bG0wtdt00P7/kJ+n+t171aJnYKlfILF0IcO7ehoxwug=
577577
github.com/cockroachdb/redact v1.1.6 h1:zXJBwDZ84xJNlHl1rMyCojqyIxv+7YUpQiJLQ7n4314=
578578
github.com/cockroachdb/redact v1.1.6/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
579579
github.com/cockroachdb/returncheck v0.0.0-20200612231554-92cdbca611dd h1:KFOt5I9nEKZgCnOSmy8r4Oykh8BYQO8bFOTgHDS8YZA=

pkg/ccl/storageccl/encryption.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ func EncryptingWriter(ciphertext objstorage.Writable, key []byte) (objstorage.Wr
148148
return &encWriter{gcm: gcm, iv: iv, ciphertext: ciphertext, buf: make([]byte, encryptionChunkSizeV2+tagSize)}, nil
149149
}
150150

151+
func (e *encWriter) StartMetadataPortion() error {
152+
if err := e.flush(); err != nil {
153+
return err
154+
}
155+
return e.ciphertext.StartMetadataPortion()
156+
}
157+
151158
func (e *encWriter) Write(p []byte) error {
152159
var wrote int
153160
for wrote < len(p) {

pkg/cloud/flush_writer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ func (f *AbortableWriter) Write(p []byte) (err error) {
4848
return nil
4949
}
5050

51+
func (f *AbortableWriter) StartMetadataPortion() error { return nil }
52+
5153
func (f *AbortableWriter) Finish() error {
5254
defer f.cancel()
5355
return f.writer.Close()

pkg/kv/kvserver/kvstorage/snaprecv/sst_snapshot_storage.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ func (f *SSTSnapshotStorageFile) ensureFile() error {
231231
return nil
232232
}
233233

234+
func (f *SSTSnapshotStorageFile) StartMetadataPortion() error { return nil }
235+
234236
// Write is part of objstorage.Writable; it writes contents to the file while
235237
// respecting the limiter passed into SSTSnapshotStorageScratch. Writing empty
236238
// contents is okay and is treated as a noop.

pkg/kv/kvserver/storeliveness/transport.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,8 @@ const (
4848
connClass = rpcbase.SystemClass
4949
)
5050

51-
// TODO(dodeca12): Currently this complexity allows the fallback to immediate
52-
// heartbeat sends. Once the smearing has been battle-tested, remove this and
53-
// default to using the smeared heartbeat sends approach (no more fallback).
54-
//
55-
// HeartbeatSmearingEnabled controls whether heartbeat sends are distributed over
56-
// time to avoid spiking the number of runnable goroutines. When enabled,
51+
// HeartbeatSmearingEnabled controls whether heartbeat sends are distributed
52+
// over time to avoid spiking the number of runnable goroutines. When enabled,
5753
// heartbeats are paced by the transport's smearing sender goroutine across
5854
// HeartbeatSmearingRefreshInterval. When disabled, heartbeats are sent
5955
// immediately upon enqueueing, bypassing the smearing mechanism.

pkg/server/status/recorder.go

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,25 @@ type registryRecorder struct {
801801
timestampNanos int64
802802
}
803803

804+
// allowedChangefeedMetrics is the list of changefeed metrics that should have
805+
// child metrics collected and recorded to TSDB. This is a curated list to prevent
806+
// unbounded cardinality while still capturing the most important per-changefeed metrics.
807+
var allowedChangefeedMetrics = map[string]struct{}{
808+
"changefeed.max_behind_nanos": {},
809+
"changefeed.error_retries": {},
810+
"changefeed.internal_retry_message_count": {},
811+
"changefeed.stage.downstream_client_send.latency": {},
812+
"changefeed.emitted_messages": {},
813+
"changefeed.sink_backpressure_nanos": {},
814+
"changefeed.backfill_pending_ranges": {},
815+
"changefeed.sink_io_inflight": {},
816+
"changefeed.lagging_ranges": {},
817+
"changefeed.aggregator_progress": {},
818+
"changefeed.checkpoint_progress": {},
819+
"changefeed.emitted_batch_sizes": {},
820+
"changefeed.total_ranges": {},
821+
}
822+
804823
// extractValue extracts the metric value(s) for the given metric and passes it, along with the metric name, to the
805824
// provided callback function.
806825
func extractValue(name string, mtr interface{}, fn func(string, float64)) error {
@@ -931,14 +950,17 @@ func (rr registryRecorder) recordChild(
931950

932951
// recordChangefeedChildMetrics iterates through changefeed metrics in the registry and processes child metrics
933952
// for those that have TsdbRecordLabeled set to true in their metadata.
934-
// Records up to 1024 child metrics to prevent unbounded memory usage and performance issues.
953+
// Records up to 1024 child metrics per metric to prevent unbounded memory usage and performance issues.
935954
//
936955
// NB: Only available for Counter and Gauge metrics.
937956
func (rr registryRecorder) recordChangefeedChildMetrics(dest *[]tspb.TimeSeriesData) {
938957
maxChildMetricsPerMetric := 1024
939958

940959
labels := rr.registry.GetLabels()
941960
rr.registry.Each(func(name string, v interface{}) {
961+
if _, allowed := allowedChangefeedMetrics[name]; !allowed {
962+
return
963+
}
942964
// Check if the metric has child collection enabled in its metadata
943965
iterable, ok := v.(metric.Iterable)
944966
if !ok {
@@ -949,10 +971,6 @@ func (rr registryRecorder) recordChangefeedChildMetrics(dest *[]tspb.TimeSeriesD
949971
if !metadata.GetTsdbRecordLabeled() {
950972
return // Skip this metric if child collection is not enabled
951973
}
952-
if metadata.Category != metric.Metadata_CHANGEFEEDS {
953-
return
954-
}
955-
956974
prom, ok := v.(metric.PrometheusExportable)
957975
if !ok {
958976
return

0 commit comments

Comments
 (0)