Commit 5ad6478
146225: metric: add essential label to metrics r=angles-n-daemons a=dhartunian
This commit adds the `Essential: true` label to metrics that are on the essential metrics docs page. The page can be viewed at: https://www.cockroachlabs.com/docs/stable/essential-metrics-self-hosted
Appropriate categories are chosen for metrics where available.
`HowToUse` field is populated with text from the docs page.
These fields are now available in the generated docs YAML file.
Resolves: cockroachdb#142571
Release note: None
146389: sql: propagate TestingKnobs.ForceProductionValues to remote nodes r=yuzefovich a=yuzefovich
This commit fixes an oversight in how we handle `eval.Context.TestingKnobs.ForceProductionValues`. Namely, previously we forgot to propagate this information from the gateway to remote nodes, so the latter would not respect this knob. This is now fixed.
Fixes: cockroachdb#146350.
Release note: None
146511: cspann: cleanup and fixes for quantizers and search set r=drewkimball a=andy-kimball
#### cspann: ensure unit vectors in quantizers when required
Construct a unit vector centroid in the quantizers when using the InnerProduct
or Cosine distance metric. This is required for accurate distances in the
Cosine case. In the InnerProduct case, it avoids partition centroids with high
magnitudes that "attract" vectors simply because of their magnitude.
In test builds, check that all query and data vectors are unit vectors when
using the Cosine distance metric.
Add more testing for Cosine and InnerProduct distance metrics, as used by the
quantizers.
#### cspann: remove centroid distances from quantized and search sets
Remove GetCentroidDistances() from QuantizedVectorSet and remove
CentroidDistance from SearchResult. The centroid distances were never
being used.
#### cspann: rename SearchResult.QuerySquaredDistance to QueryDistance
Now that we're introducing alternative distance metrics, the search result no
longer always returns a squared L2 distance. Rename the field to QueryDistance
to be agnostic to the distance metric that's used.
146561: kvserver: reduce replica mu contention in updateProposalQuotaRaftMuLocked r=iskettaneh a=iskettaneh
This PR refactors updateProposalQuotaRaftMuLocked() to reduce the replica mutex contention, especially in the normal case (QuotaPool is disabled, and the leadership is stable).
Changes done by this commit:
1. Create a short path for the case where we are not the leader.
2. Create a short path for the case where QuotaPool is not enabled.
We only take the write lock in cases where we already had proposal quota that needs to be release, or if the flow control level causes the replicaFlowControlIntegration.onRaftTicked to be a no-op.
3. Untangle the rest of the cases where the QuotaPool is enabled.
benchdiff results:
```
rm -f /tmp/*.pb.gz && env GODEBUG=runtimecontentionstacks=1 benchdiff -b --old e0393de6614ddad81a8209733945be46e967e993 -c 10 ./pkg/sql/tests -r BenchmarkParallelSysbench/SQL/3node/oltp_read_write --mutexprofile -d=3000x
name old time/op new time/op delta
ParallelSysbench/SQL/3node/oltp_read_write-24 1.15ms ± 7% 1.15ms ± 4% ~ (p=1.000 n=10+9)
name old errs/op new errs/op delta
ParallelSysbench/SQL/3node/oltp_read_write-24 0.01 ±46% 0.01 ±32% ~ (p=0.469 n=10+10)
name old alloc/op new alloc/op delta
ParallelSysbench/SQL/3node/oltp_read_write-24 2.05MB ± 1% 2.06MB ± 1% ~ (p=0.052 n=10+10)
name old allocs/op new allocs/op delta
ParallelSysbench/SQL/3node/oltp_read_write-24 8.18k ± 1% 8.20k ± 1% ~ (p=0.101 n=10+10)
```
Mutex contention graph after running the microbenchmark on my GCE worker:
```
rm -f /tmp/*.pb.gz && env GODEBUG=runtimecontentionstacks=1 go test ./pkg/sql/tests -run - -bench BenchmarkParallelSysbench/SQL/3node/oltp_read_write -v -test.benchtime=3000x -test.outputdir=/tmp -test.mutexprofile=mutex.pb.gz -test.mutexprofilefraction=100 -test.timeout 25s 2>&1
```
Before:
<img width="1906" alt="Screenshot 2025-05-12 at 3 40 08 PM" src="https://github.com/user-attachments/assets/0059db5d-fc17-4344-ae1e-7d37770fba0c" />
After:
<img width="1908" alt="Screenshot 2025-05-12 at 3 39 48 PM" src="https://github.com/user-attachments/assets/f3ee3869-8b46-45bc-bf63-ba2af958cb84" />
References: cockroachdb#140235
Release note: None
146594: tests: de-flake a couple of tests due to buffered writes r=yuzefovich a=yuzefovich
We recently enabled buffered writes metamorphically in tests. Previously, we also added several lock reliability cluster settings that have defaults being changed metamorphically. We've now seen two failures where an expected contention event didn't occur due to an unfortunate combination of these two facts: namely, if we metamorphically disable `kv.lock_table.unreplicated_lock_reliability.split.enabled` cluster setting while enabling buffered writes, multi-server unit tests might not observe the expected contention. As of right now two tests like this have been identified, so they are adjusted to always override the split reliability setting to `true`.
The reasoning is that if we only have a handful of tests that are susceptible to flakes due to the poor combination of metamorphic settings, we'd rather adjust the tests themselves. If we find more cases like this, we'll consider making some settings non-metamorphic.
Fixes: cockroachdb#146387.
Fixes: cockroachdb#146412.
Release note: None
146642: workload: reduce RNG allocations r=mgartner a=mgartner
PR cockroachdb#143626 removed `golang.org/x/exp/rand` in favor of `math/rand/v2`.
The number of heap allocations grew dramatically due to new calls to
`rand.New` and `rand.NewPCG`. This commit eliminates these allocations
by reusing allocations of `rand.Rand` and `rand.PCG`.
```
name old time/op new time/op delta
InitialData/tpcc/warehouses=1 103ms ± 0% 91ms ± 0% -11.96% (p=0.016 n=4+5)
name old speed new speed delta
InitialData/tpcc/warehouses=1 2.13GB/s ± 0% 2.50GB/s ± 0% +17.58% (p=0.016 n=4+5)
name old alloc/op new alloc/op delta
InitialData/tpcc/warehouses=1 10.3MB ± 0% 0.1MB ± 0% -99.24% (p=0.008 n=5+5)
name old allocs/op new allocs/op delta
InitialData/tpcc/warehouses=1 640k ± 0% 0k ± 0% -99.97% (p=0.008 n=5+5)
```
Release note: None
146645: util/mon,colexec/colexecdisk: reduce allocations r=mgartner a=mgartner
#### colexec/colexecdisk: lazily construct monitor name strings
Monitor name strings are now built only when an out-of-memory error is
encountered, rather than always built when a disk spiller is created.
Release note: None
#### util/mon: use array for disk spiller monitor names
A fixed size array of type is now used instead of a slice for storing
`mon.Name`s in `diskSpillerBase`, reducing heap allocations. An empty
`mon.Name` is used for the second element in the array if there is only
one name.
Release note: None
Co-authored-by: David Hartunian <davidh@cockroachlabs.com>
Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
Co-authored-by: Andrew Kimball <andyk@cockroachlabs.com>
Co-authored-by: Ibrahim Kettaneh <ibrahim.kettaneh@cockroachlabs.com>
Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com>
File tree
79 files changed
+2734
-1761
lines changed- docs/generated/metrics
- pkg
- backup
- base
- ccl
- changefeedccl
- serverccl/statusccl
- jobs
- kv
- kvclient/kvcoord
- kvserver
- liveness
- txnwait
- raft
- rpc
- security
- server
- application_api
- status
- sql
- colexec
- colbuilder
- colexecdisk
- distsql
- execinfrapb
- execinfra
- pgwire
- rowenc
- ttl/ttljob
- vecindex
- cspann
- commontest
- memstore
- quantize
- testdata
- testdata
- vecencoding
- vecstore
- util
- admission
- metric
- mon
- num32
- workload/tpcc
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
79 files changed
+2734
-1761
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
| 577 | + | |
577 | 578 | | |
578 | 579 | | |
579 | 580 | | |
| |||
584 | 585 | | |
585 | 586 | | |
586 | 587 | | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
587 | 603 | | |
588 | 604 | | |
589 | 605 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
710 | 713 | | |
711 | 714 | | |
712 | 715 | | |
713 | 716 | | |
714 | 717 | | |
715 | 718 | | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
716 | 722 | | |
717 | 723 | | |
718 | 724 | | |
| |||
791 | 797 | | |
792 | 798 | | |
793 | 799 | | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
794 | 803 | | |
795 | 804 | | |
796 | 805 | | |
| |||
811 | 820 | | |
812 | 821 | | |
813 | 822 | | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
814 | 826 | | |
815 | 827 | | |
816 | 828 | | |
| |||
850 | 862 | | |
851 | 863 | | |
852 | 864 | | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
853 | 868 | | |
854 | 869 | | |
855 | 870 | | |
| |||
878 | 893 | | |
879 | 894 | | |
880 | 895 | | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
881 | 899 | | |
882 | 900 | | |
883 | 901 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
| |||
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| |||
884 | 887 | | |
885 | 888 | | |
886 | 889 | | |
887 | | - | |
888 | 890 | | |
889 | 891 | | |
890 | 892 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
88 | 114 | | |
89 | 115 | | |
90 | | - | |
| 116 | + | |
| 117 | + | |
91 | 118 | | |
92 | 119 | | |
93 | 120 | | |
| |||
98 | 125 | | |
99 | 126 | | |
100 | 127 | | |
101 | | - | |
102 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
103 | 131 | | |
104 | 132 | | |
105 | 133 | | |
106 | 134 | | |
107 | 135 | | |
108 | 136 | | |
109 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
110 | 157 | | |
111 | 158 | | |
112 | | - | |
113 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
114 | 162 | | |
115 | 163 | | |
116 | 164 | | |
117 | 165 | | |
118 | 166 | | |
119 | 167 | | |
120 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
121 | 177 | | |
122 | 178 | | |
123 | | - | |
| 179 | + | |
| 180 | + | |
124 | 181 | | |
125 | 182 | | |
126 | 183 | | |
| |||
131 | 188 | | |
132 | 189 | | |
133 | 190 | | |
134 | | - | |
135 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
136 | 194 | | |
137 | 195 | | |
138 | 196 | | |
139 | 197 | | |
140 | 198 | | |
141 | 199 | | |
142 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
143 | 213 | | |
144 | 214 | | |
145 | | - | |
| 215 | + | |
| 216 | + | |
146 | 217 | | |
147 | 218 | | |
148 | 219 | | |
| |||
154 | 225 | | |
155 | 226 | | |
156 | 227 | | |
157 | | - | |
| 228 | + | |
| 229 | + | |
158 | 230 | | |
159 | 231 | | |
160 | 232 | | |
| |||
166 | 238 | | |
167 | 239 | | |
168 | 240 | | |
169 | | - | |
| 241 | + | |
| 242 | + | |
170 | 243 | | |
171 | 244 | | |
172 | 245 | | |
| |||
178 | 251 | | |
179 | 252 | | |
180 | 253 | | |
181 | | - | |
| 254 | + | |
| 255 | + | |
182 | 256 | | |
183 | 257 | | |
184 | 258 | | |
| |||
188 | 262 | | |
189 | 263 | | |
190 | 264 | | |
191 | | - | |
192 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
193 | 268 | | |
194 | 269 | | |
195 | 270 | | |
196 | 271 | | |
197 | 272 | | |
198 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
199 | 283 | | |
200 | 284 | | |
201 | | - | |
| 285 | + | |
| 286 | + | |
202 | 287 | | |
203 | 288 | | |
204 | 289 | | |
| |||
271 | 356 | | |
272 | 357 | | |
273 | 358 | | |
274 | | - | |
275 | 359 | | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
288 | 372 | | |
| 373 | + | |
289 | 374 | | |
290 | 375 | | |
291 | 376 | | |
| |||
0 commit comments