Skip to content

Commit 14a4e11

Browse files
craig[bot]RaduBerindefqazirickystewart
committed
159846: go.mod: bump Pebble, add table filter cluster setting r=RaduBerinde a=RaduBerinde This PR is only for the top commit. #### go.mod: bump Pebble, add table filter cluster setting The defaults remain unchanged. Changes: * [`92a8576e`](cockroachdb/pebble@92a8576e) cmd: use progressive filter policy * [`686c3c88`](cockroachdb/pebble@686c3c88) db: add progressive bloom filter policy * [`378cc7d4`](cockroachdb/pebble@378cc7d4) options: add per-LSM table filter policy * [`5997d9ad`](cockroachdb/pebble@5997d9ad) options: make FilterPolicy a function Release note: none. Epic: none. 160009: sql: tolerate serialization errors for gist decoding r=fqazi a=fqazi Previously, when locked leasing was disabled, decoding plans was guaranteed never to hit serialization errors. With locked leasing enabled, mixing leased descriptors with those from KV required them both to have the same version. These errors can occur when executing tests like TestExplainGist, which involves concurrent schema changes. To address this, this patch ignores serialization failure errors during gist decoding. Fixes: #159714 Release note: None 160014: ci-stress: skip stressing if there are no tests r=annaw2193 a=rickystewart Release note: none Epic: DEVINF-1582 Co-authored-by: Radu Berinde <[email protected]> Co-authored-by: Faizan Qazi <[email protected]> Co-authored-by: Ricky Stewart <[email protected]>
4 parents 86f34c6 + e544711 + fa6538d + f535db9 commit 14a4e11

File tree

7 files changed

+48
-9
lines changed

7 files changed

+48
-9
lines changed

DEPS.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,10 +1854,10 @@ def go_deps():
18541854
patches = [
18551855
"@com_github_cockroachdb_cockroach//build/patches:com_github_cockroachdb_pebble.patch",
18561856
],
1857-
sha256 = "920a1cc6b0b9d0bfcab3054ebe724b8e44f2f406457a3658ed9e0deb066ba537",
1858-
strip_prefix = "github.com/cockroachdb/[email protected]20251218170843-5aa02b5b0fe4",
1857+
sha256 = "ff0f66a8ccaf093a150c3a72c98565ba159d9ac190cd8cc24eabe52726658cf3",
1858+
strip_prefix = "github.com/cockroachdb/[email protected]20251218181515-92a8576e35e5",
18591859
urls = [
1860-
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20251218170843-5aa02b5b0fe4.zip",
1860+
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20251218181515-92a8576e35e5.zip",
18611861
],
18621862
)
18631863
go_repository(

build/bazelutil/distdir_files.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ DISTDIR_FILES = {
354354
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/gostdlib/com_github_cockroachdb_gostdlib-v1.19.0.zip": "c4d516bcfe8c07b6fc09b8a9a07a95065b36c2855627cb3514e40c98f872b69e",
355355
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/logtags/com_github_cockroachdb_logtags-v0.0.0-20241215232642-bb51bb14a506.zip": "920068af09e3846d9ebb4e4a7787ff1dd10f3989c5f940ad861b0f6a9f824f6e",
356356
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/metamorphic/com_github_cockroachdb_metamorphic-v0.0.0-20231108215700-4ba948b56895.zip": "28c8cf42192951b69378cf537be5a9a43f2aeb35542908cc4fe5f689505853ea",
357-
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20251218170843-5aa02b5b0fe4.zip": "920a1cc6b0b9d0bfcab3054ebe724b8e44f2f406457a3658ed9e0deb066ba537",
357+
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20251218181515-92a8576e35e5.zip": "ff0f66a8ccaf093a150c3a72c98565ba159d9ac190cd8cc24eabe52726658cf3",
358358
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/redact/com_github_cockroachdb_redact-v1.1.6.zip": "018eccb5fb9ca52d43ec9eaf213539d01c1f2b94e0e822406ebfb2e9321ef6cf",
359359
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/returncheck/com_github_cockroachdb_returncheck-v0.0.0-20200612231554-92cdbca611dd.zip": "ce92ba4352deec995b1f2eecf16eba7f5d51f5aa245a1c362dfe24c83d31f82b",
360360
"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
@@ -138,7 +138,7 @@ require (
138138
github.com/cockroachdb/errors v1.12.1-0.20251010171200-64801262cd6f
139139
github.com/cockroachdb/gostdlib v1.19.0
140140
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506
141-
github.com/cockroachdb/pebble v0.0.0-20251218170843-5aa02b5b0fe4
141+
github.com/cockroachdb/pebble v0.0.0-20251218181515-92a8576e35e5
142142
github.com/cockroachdb/redact v1.1.6
143143
github.com/cockroachdb/returncheck v0.0.0-20200612231554-92cdbca611dd
144144
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
@@ -580,8 +580,8 @@ github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 h1:ASDL+UJcILM
580580
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506/go.mod h1:Mw7HqKr2kdtu6aYGn3tPmAftiP3QPX63LdK/zcariIo=
581581
github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA=
582582
github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA=
583-
github.com/cockroachdb/pebble v0.0.0-20251218170843-5aa02b5b0fe4 h1:f1ysffeG5HrGdjKLQRC4LOxsdGpKGQVcpUAr2380zkE=
584-
github.com/cockroachdb/pebble v0.0.0-20251218170843-5aa02b5b0fe4/go.mod h1:bG0wtdt00P7/kJ+n+t171aJnYKlfILF0IcO7ehoxwug=
583+
github.com/cockroachdb/pebble v0.0.0-20251218181515-92a8576e35e5 h1:W4+2H4cz8tOM0r20Go5Da03wTqHBD1hiKMKvQ5YWPco=
584+
github.com/cockroachdb/pebble v0.0.0-20251218181515-92a8576e35e5/go.mod h1:bG0wtdt00P7/kJ+n+t171aJnYKlfILF0IcO7ehoxwug=
585585
github.com/cockroachdb/redact v1.1.6 h1:zXJBwDZ84xJNlHl1rMyCojqyIxv+7YUpQiJLQ7n4314=
586586
github.com/cockroachdb/redact v1.1.6/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
587587
github.com/cockroachdb/returncheck v0.0.0-20200612231554-92cdbca611dd h1:KFOt5I9nEKZgCnOSmy8r4Oykh8BYQO8bFOTgHDS8YZA=

pkg/cmd/ci-stress/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ func mainImpl(baseRef string, bazelArgs []string) error {
152152
return err
153153
}
154154
pkgToTests := getPkgToTests(diff)
155+
if len(pkgToTests) == 0 {
156+
fmt.Println("could not find any eligible tests to stress, exiting")
157+
return nil
158+
}
155159
return runTests(ctx, pkgToTests, bazelArgs)
156160
}
157161

pkg/sql/conn_executor_exec.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3300,6 +3300,11 @@ func (ex *connExecutor) makeExecPlan(
33003300
}
33013301
_, err := explain.DecodePlanGistToRows(ctx, &planner.extendedEvalCtx.Context, ih.planGist.String(), catalog)
33023302
if err != nil {
3303+
// Serialization failures can occur from the lease manager if a
3304+
// consistent view of descriptors was not observed.
3305+
if pgerror.GetPGCode(err) == pgcode.SerializationFailure {
3306+
return ctx, err
3307+
}
33033308
return ctx, errors.NewAssertionErrorWithWrappedErrf(err, "failed to decode plan gist: %q", ih.planGist.String())
33043309
}
33053310
}

pkg/storage/pebble.go

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,26 @@ var tombstoneDenseCompactionThreshold = settings.RegisterIntSetting(
580580
settings.IntInRange(0, 100),
581581
)
582582

583+
var tableFilterModeSetting = settings.RegisterEnumSetting(
584+
settings.ApplicationLevel, // used by temp storage as well
585+
"storage.table_filters",
586+
"table filter configuration: uniform = 10bpk bloom filters on all levels; progressive = bloom filters with level-dependent size",
587+
"uniform",
588+
map[tableFilterMode]string{
589+
tableFilterModeUniform: "uniform",
590+
tableFilterModeProgressive: "progressive",
591+
},
592+
)
593+
594+
type tableFilterMode int8
595+
596+
const (
597+
// tableFilterModeUniform applies pebble.DBTableFilterPolicyUniform.
598+
tableFilterModeUniform tableFilterMode = iota
599+
// tableFilterModeProgressive applies pebble.DBTableFilterPolicyProgressive.
600+
tableFilterModeProgressive
601+
)
602+
583603
// EngineComparer is a pebble.Comparer object that implements MVCC-specific
584604
// comparator settings for use with Pebble.
585605
var EngineComparer = func() pebble.Comparer {
@@ -673,14 +693,14 @@ func initPebbleOptions() *pebble.Options {
673693
opts.Levels[0] = pebble.LevelOptions{
674694
BlockSize: 32 << 10, // 32 KB
675695
IndexBlockSize: 256 << 10, // 256 KB
676-
TableFilterPolicy: bloom.FilterPolicy(10),
696+
TableFilterPolicy: func() pebble.TableFilterPolicy { return bloom.FilterPolicy(10) },
677697
}
678698
opts.Levels[0].EnsureL0Defaults()
679699
for i := 1; i < len(opts.Levels); i++ {
680700
l := &opts.Levels[i]
681701
l.BlockSize = 32 << 10 // 32 KB
682702
l.IndexBlockSize = 256 << 10 // 256 KB
683-
l.TableFilterPolicy = bloom.FilterPolicy(10)
703+
l.TableFilterPolicy = func() pebble.TableFilterPolicy { return bloom.FilterPolicy(10) }
684704
l.EnsureL1PlusDefaults(&opts.Levels[i-1])
685705
}
686706

@@ -1016,6 +1036,16 @@ func newPebble(ctx context.Context, cfg engineConfig) (p *Pebble, err error) {
10161036
cfg.opts.ApplyCompressionSettings(func() pebble.DBCompressionSettings {
10171037
return CompressionAlgorithmStorage.Get(sv).DBCompressionSettings()
10181038
})
1039+
cfg.opts.ApplyTableFilterPolicy(func() pebble.DBTableFilterPolicy {
1040+
switch tableFilterModeSetting.Get(&cfg.settings.SV) {
1041+
case tableFilterModeUniform:
1042+
return pebble.DBTableFilterPolicyUniform
1043+
case tableFilterModeProgressive:
1044+
return pebble.DBTableFilterPolicyProgressive
1045+
default:
1046+
return pebble.DBTableFilterPolicyUniform
1047+
}
1048+
})
10191049
// Note: the CompactionConcurrencyRange function will be wrapped below to
10201050
// allow overriding the lower and upper values at runtime through
10211051
// Engine.SetCompactionConcurrency.

0 commit comments

Comments
 (0)