Skip to content

Commit 25fb625

Browse files
committed
go.mod: bump Pebble to 258531bdf87e
Changes: * [`258531bd`](cockroachdb/pebble@258531bd) blob: add FileFormatV2 which has a properties block * [`4be89e71`](cockroachdb/pebble@4be89e71) go.mod: require go1.24 * [`d3bef264`](cockroachdb/pebble@d3bef264) sstable: remove CompressionOptions * [`2d7040f1`](cockroachdb/pebble@2d7040f1) manifest: improve API around TableStats * [`7d7cc282`](cockroachdb/pebble@7d7cc282) db: fix bug in scaling compression stats for virtual tables * [`c9692798`](cockroachdb/pebble@c9692798) db: add some tests for compression stats Release note: none. Epic: none.
1 parent af632a6 commit 25fb625

File tree

7 files changed

+52
-44
lines changed

7 files changed

+52
-44
lines changed

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 = "e6a74cd60e0d641da8d9a9091efc369f0895b1d18e4dc67cc2a5ee06cde6999b",
1839-
strip_prefix = "github.com/cockroachdb/[email protected]20250804212405-afb4d6001bab",
1838+
sha256 = "e47b5d6c32ebd359e64d4332866e2935861a82cff227ccfe184741384955b199",
1839+
strip_prefix = "github.com/cockroachdb/[email protected]20250806123517-258531bdf87e",
18401840
urls = [
1841-
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20250804212405-afb4d6001bab.zip",
1841+
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20250806123517-258531bdf87e.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-20250804212405-afb4d6001bab.zip": "e6a74cd60e0d641da8d9a9091efc369f0895b1d18e4dc67cc2a5ee06cde6999b",
361+
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20250806123517-258531bdf87e.zip": "e47b5d6c32ebd359e64d4332866e2935861a82cff227ccfe184741384955b199",
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
@@ -135,7 +135,7 @@ require (
135135
github.com/cockroachdb/errors v1.12.0
136136
github.com/cockroachdb/gostdlib v1.19.0
137137
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506
138-
github.com/cockroachdb/pebble v0.0.0-20250804212405-afb4d6001bab
138+
github.com/cockroachdb/pebble v0.0.0-20250806123517-258531bdf87e
139139
github.com/cockroachdb/redact v1.1.6
140140
github.com/cockroachdb/returncheck v0.0.0-20200612231554-92cdbca611dd
141141
github.com/cockroachdb/tokenbucket v0.0.0-20250429170803-42689b6311bb

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,8 @@ github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 h1:ASDL+UJcILM
581581
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506/go.mod h1:Mw7HqKr2kdtu6aYGn3tPmAftiP3QPX63LdK/zcariIo=
582582
github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA=
583583
github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA=
584-
github.com/cockroachdb/pebble v0.0.0-20250804212405-afb4d6001bab h1:XGO/UWIv5lB3r5kUv1MoF49Nofz0Ro74Vtt+p2whIX0=
585-
github.com/cockroachdb/pebble v0.0.0-20250804212405-afb4d6001bab/go.mod h1:m1E2qCthmjzpvzktMEjYXj0eykYI325brUhFJU6VRis=
584+
github.com/cockroachdb/pebble v0.0.0-20250806123517-258531bdf87e h1:MqHNboOEEG68bOzAvh+crJX7j9CmkvyTiGWtTphR0Eg=
585+
github.com/cockroachdb/pebble v0.0.0-20250806123517-258531bdf87e/go.mod h1:86lLSKhilQEdaYPIVAG2mIlDGhxlKX1CUkr4Z09nCzA=
586586
github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
587587
github.com/cockroachdb/redact v1.1.6 h1:zXJBwDZ84xJNlHl1rMyCojqyIxv+7YUpQiJLQ7n4314=
588588
github.com/cockroachdb/redact v1.1.6/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=

pkg/kv/kvserver/kvstorage/snaprecv/testdata/echotest/TestMultiSSTWriterInitSST_interesting=false

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
echo
44
----
55
>> finishing msstw
6-
>> sstSize=4881 estDataSize=126
6+
>> sstSize=4270 estDataSize=126
77
>> sst0:
88
rangedel: /Local/RangeID/100/{r""-s""}
99
rangekeydel: /Local/RangeID/100/{r""-s""}

pkg/kv/kvserver/kvstorage/snaprecv/testdata/echotest/TestMultiSSTWriterInitSST_interesting=true

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ echo
55
>> rangekeyset [/Local/RangeID/100/r/AbortSpan/"00000000-0000-0000-0000-000000000000"-/Local/RangeID/100/r/AbortSpan/"6ba7b810-9dad-11d1-80b4-00c04fd430c8")
66
>> sstSize=0 estDataSize=94
77
>> rangekeyset [/Local/Range"d"/RangeDescriptor-/Local/Range"f"/RangeDescriptor)
8-
>> sstSize=1178 estDataSize=403
8+
>> sstSize=1043 estDataSize=403
99
>> rangekeyset ["e"-"f")
10-
>> sstSize=4324 estDataSize=581
10+
>> sstSize=3809 estDataSize=581
1111
>> finishing msstw
12-
>> sstSize=5320 estDataSize=585
12+
>> sstSize=4679 estDataSize=585
1313
>> sst0:
1414
rangedel: /Local/RangeID/100/r{""-/AbortSpan/"00000000-0000-0000-0000-000000000000"}
1515
rangedel: /Local/RangeID/100/r/AbortSpan/"{00000000-0000-0000-0000-000000000000"-6ba7b810-9dad-11d1-80b4-00c04fd430c8"}

pkg/kv/kvserver/rangefeed/event_size_test.go

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package rangefeed
88
import (
99
"context"
1010
"math/rand"
11+
"slices"
1112
"testing"
1213

1314
"github.com/cockroachdb/cockroach/pkg/keys"
@@ -27,31 +28,6 @@ import (
2728
"github.com/stretchr/testify/require"
2829
)
2930

30-
type kvs = storageutils.KVs
31-
32-
var (
33-
pointKV = storageutils.PointKV
34-
rangeKV = storageutils.RangeKV
35-
)
36-
37-
var (
38-
testKey = roachpb.Key("/db1")
39-
testTxnID = uuid.MakeV4()
40-
testIsolationLevel = isolation.Serializable
41-
testSpan = roachpb.Span{Key: roachpb.Key("a"), EndKey: roachpb.Key("z")}
42-
testTs = hlc.Timestamp{WallTime: 1}
43-
testStartKey = roachpb.Key("a")
44-
testEndKey = roachpb.Key("z")
45-
testValue = []byte("1")
46-
testPrevValue = []byte("1234")
47-
testSSTKVs = kvs{
48-
pointKV("a", 1, "1"),
49-
pointKV("b", 1, "2"),
50-
pointKV("c", 1, "3"),
51-
rangeKV("d", "e", 1, ""),
52-
}
53-
)
54-
5531
type testData struct {
5632
numOfLogicalOps int
5733
kvs []interface{}
@@ -68,9 +44,34 @@ type testData struct {
6844
omitInRangefeeds bool
6945
}
7046

71-
func generateStaticTestdata() testData {
47+
// testSSTKVs returns a set of key-value pairs that can be used for testing.
48+
// Note that the value output depends on storage.disableSimpleValueEncoding.
49+
func testSSTKVs() storageutils.KVs {
50+
return storageutils.KVs{
51+
storageutils.PointKV("a", 1, "1"),
52+
storageutils.PointKV("b", 1, "2"),
53+
storageutils.PointKV("c", 1, "3"),
54+
storageutils.RangeKV("d", "e", 1, ""),
55+
}
56+
}
57+
58+
func generateStaticTestdata(t *testing.T) testData {
59+
storage.DisableMetamorphicSimpleValueEncoding(t)
60+
61+
var (
62+
testKey = roachpb.Key("/db1")
63+
testTxnID = uuid.MakeV4()
64+
testIsolationLevel = isolation.Serializable
65+
testSpan = roachpb.Span{Key: roachpb.Key("a"), EndKey: roachpb.Key("z")}
66+
testTs = hlc.Timestamp{WallTime: 1}
67+
testStartKey = roachpb.Key("a")
68+
testEndKey = roachpb.Key("z")
69+
testValue = []byte("1")
70+
testPrevValue = []byte("1234")
71+
)
72+
7273
return testData{
73-
kvs: testSSTKVs,
74+
kvs: testSSTKVs(),
7475
span: testSpan,
7576
key: testKey,
7677
timestamp: testTs,
@@ -94,9 +95,7 @@ func generateStaticTestdata() testData {
9495
// be careful and account the memory usage of the additional underlying data
9596
// structure. Otherwise, you can simply update the expected values in this test.
9697
func TestEventSizeCalculation(t *testing.T) {
97-
st := cluster.MakeTestingClusterSettings()
98-
data := generateStaticTestdata()
99-
storage.CompressionAlgorithmStorage.Override(context.Background(), &st.SV, storage.StoreCompressionSnappy)
98+
data := generateStaticTestdata(t)
10099

101100
key := data.key
102101
timestamp := data.timestamp
@@ -114,7 +113,16 @@ func TestEventSizeCalculation(t *testing.T) {
114113
omitInRangefeeds := data.omitInRangefeeds
115114

116115
span := data.span
116+
117+
// Fix settings that can affect the size of the sstable.
118+
st := cluster.MakeTestingClusterSettings()
119+
storage.CompressionAlgorithmStorage.Override(context.Background(), &st.SV, storage.StoreCompressionSnappy)
120+
storage.IngestionValueBlocksEnabled.Override(context.Background(), &st.SV, true)
117121
sst, _, _ := storageutils.MakeSST(t, st, data.kvs)
122+
// The test cares about cap(sst); this can hide bugs where the sst
123+
// generation is non-deterministic and results in slightly different
124+
// lengths. Clip the slice to its length half the time to detect this.
125+
sst = slices.Clip(sst)
118126

119127
for _, tc := range []struct {
120128
name string
@@ -220,10 +228,10 @@ func TestEventSizeCalculation(t *testing.T) {
220228
{
221229
name: "sstEvent event",
222230
ev: event{sst: &sstEvent{data: sst, span: span, ts: timestamp}},
223-
expectedCurrMemUsage: int64(2218),
231+
expectedCurrMemUsage: int64(1186),
224232
actualCurrMemUsage: eventOverhead + sstEventOverhead +
225233
int64(cap(sst)+cap(span.Key)+cap(span.EndKey)),
226-
expectedFutureMemUsage: int64(2242),
234+
expectedFutureMemUsage: int64(1210),
227235
actualFutureMemUsage: futureEventBaseOverhead + rangefeedSSTTableOverhead +
228236
int64(cap(sst)+cap(span.Key)+cap(span.EndKey)),
229237
},
@@ -290,7 +298,7 @@ func generateRandomTestData(rand *rand.Rand) testData {
290298
startKey, endkey := generateStartAndEndKey(rand)
291299
return testData{
292300
numOfLogicalOps: rand.Intn(100) + 1, // Avoid 0 (empty event)
293-
kvs: testSSTKVs,
301+
kvs: testSSTKVs(),
294302
span: generateRandomizedSpan(rand).AsRawSpanWithNoLocals(),
295303
key: generateRandomizedBytes(rand),
296304
timestamp: GenerateRandomizedTs(rand, 100 /* maxTime */),

0 commit comments

Comments
 (0)