From fad2d0e6e8725f2a843bb2d978a17f5be40d7dbf Mon Sep 17 00:00:00 2001 From: Radu Berinde Date: Wed, 14 Jun 2023 06:39:48 -0700 Subject: [PATCH] go.mod: bump Pebble to 32834aa62738 32834aa6 objstorage: support heteorogeneous Storage backends c75c4d65 db: wrap error when creating Reader with backing filenum a8a7ebf5 db: Add Option to Filter SSTables Release note: --- DEPS.bzl | 6 +++--- build/bazelutil/distdir_files.bzl | 2 +- go.mod | 2 +- go.sum | 4 ++-- pkg/cli/BUILD.bazel | 1 + pkg/cli/debug.go | 7 ++++++- pkg/storage/pebble.go | 7 ++++++- 7 files changed, 20 insertions(+), 9 deletions(-) diff --git a/DEPS.bzl b/DEPS.bzl index 8ae23f702a4e..50adf63fed70 100644 --- a/DEPS.bzl +++ b/DEPS.bzl @@ -1565,10 +1565,10 @@ def go_deps(): patches = [ "@com_github_cockroachdb_cockroach//build/patches:com_github_cockroachdb_pebble.patch", ], - sha256 = "358d67b4d32db4271e320d0d55066195351ddf97447f93e4ecb9442f3d71949f", - strip_prefix = "github.com/cockroachdb/pebble@v0.0.0-20230612212856-1e8aa51077f0", + sha256 = "e58192b93c07d773152894f78a9b47808a4d90dc1649f53949b0f4eafa58ce2a", + strip_prefix = "github.com/cockroachdb/pebble@v0.0.0-20230614133735-32834aa62738", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20230612212856-1e8aa51077f0.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20230614133735-32834aa62738.zip", ], ) go_repository( diff --git a/build/bazelutil/distdir_files.bzl b/build/bazelutil/distdir_files.bzl index 57bce652909d..656919ed0a19 100644 --- a/build/bazelutil/distdir_files.bzl +++ b/build/bazelutil/distdir_files.bzl @@ -313,7 +313,7 @@ DISTDIR_FILES = { "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", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/gostdlib/com_github_cockroachdb_gostdlib-v1.19.0.zip": "c4d516bcfe8c07b6fc09b8a9a07a95065b36c2855627cb3514e40c98f872b69e", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/logtags/com_github_cockroachdb_logtags-v0.0.0-20230118201751-21c54148d20b.zip": "ca7776f47e5fecb4c495490a679036bfc29d95bd7625290cfdb9abb0baf97476", - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20230612212856-1e8aa51077f0.zip": "358d67b4d32db4271e320d0d55066195351ddf97447f93e4ecb9442f3d71949f", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20230614133735-32834aa62738.zip": "e58192b93c07d773152894f78a9b47808a4d90dc1649f53949b0f4eafa58ce2a", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/redact/com_github_cockroachdb_redact-v1.1.5.zip": "11b30528eb0dafc8bc1a5ba39d81277c257cbe6946a7564402f588357c164560", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/returncheck/com_github_cockroachdb_returncheck-v0.0.0-20200612231554-92cdbca611dd.zip": "ce92ba4352deec995b1f2eecf16eba7f5d51f5aa245a1c362dfe24c83d31f82b", "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/sentry-go/com_github_cockroachdb_sentry_go-v0.6.1-cockroachdb.2.zip": "fbb2207d02aecfdd411b1357efe1192dbb827959e36b7cab7491731ac55935c9", diff --git a/go.mod b/go.mod index 6f68520028b3..7c22fa96749d 100644 --- a/go.mod +++ b/go.mod @@ -116,7 +116,7 @@ require ( github.com/cockroachdb/go-test-teamcity v0.0.0-20191211140407-cff980ad0a55 github.com/cockroachdb/gostdlib v1.19.0 github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b - github.com/cockroachdb/pebble v0.0.0-20230612212856-1e8aa51077f0 + github.com/cockroachdb/pebble v0.0.0-20230614133735-32834aa62738 github.com/cockroachdb/redact v1.1.5 github.com/cockroachdb/returncheck v0.0.0-20200612231554-92cdbca611dd github.com/cockroachdb/stress v0.0.0-20220803192808-1806698b1b7b diff --git a/go.sum b/go.sum index f1ef2f6f025a..3239fe6fa6d6 100644 --- a/go.sum +++ b/go.sum @@ -486,8 +486,8 @@ github.com/cockroachdb/gostdlib v1.19.0/go.mod h1:+dqqpARXbE/gRDEhCak6dm0l14AaTy github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230612212856-1e8aa51077f0 h1:hWYfK146XEZwu4ycJaRhr6SjRYOvOGoePT+XFrdLXXo= -github.com/cockroachdb/pebble v0.0.0-20230612212856-1e8aa51077f0/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= +github.com/cockroachdb/pebble v0.0.0-20230614133735-32834aa62738 h1:pKUZ8PCP23se600eVZs1HM7zwipLqWAKldxeWfgDGCk= +github.com/cockroachdb/pebble v0.0.0-20230614133735-32834aa62738/go.mod h1:ZoLpjYdSY0BC1it7VZT20L4tm0OhBawe5awAtC0S5Vk= github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= diff --git a/pkg/cli/BUILD.bazel b/pkg/cli/BUILD.bazel index 57b95c4b3e7e..435b34ff28e1 100644 --- a/pkg/cli/BUILD.bazel +++ b/pkg/cli/BUILD.bazel @@ -236,6 +236,7 @@ go_library( "@com_github_cockroachdb_errors//hintdetail", "@com_github_cockroachdb_errors//oserror", "@com_github_cockroachdb_logtags//:logtags", + "@com_github_cockroachdb_pebble//objstorage/shared", "@com_github_cockroachdb_pebble//tool", "@com_github_cockroachdb_pebble//vfs", "@com_github_cockroachdb_redact//:redact", diff --git a/pkg/cli/debug.go b/pkg/cli/debug.go index d121e343e2d1..6d7bff2dc30e 100644 --- a/pkg/cli/debug.go +++ b/pkg/cli/debug.go @@ -66,6 +66,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/uuid" "github.com/cockroachdb/errors" "github.com/cockroachdb/errors/oserror" + "github.com/cockroachdb/pebble/objstorage/shared" "github.com/cockroachdb/pebble/tool" "github.com/cockroachdb/pebble/vfs" "github.com/cockroachdb/ttycolor" @@ -1554,7 +1555,11 @@ func initPebbleCmds(cmd *cobra.Command, pebbleTool *tool.T) { if err != nil { return err } - pebbleTool.EnableSharedStorage(storage.MakeExternalStorageWrapper(context.Background(), es)) + wrapper := storage.MakeExternalStorageWrapper(context.Background(), es) + factory := shared.MakeSimpleFactory(map[shared.Locator]shared.Storage{ + "": wrapper, + }) + pebbleTool.ConfigureSharedStorage(factory, true /* createOnShared */, "" /* createOnSharedLocator */) } return pebbleCryptoInitializer() } diff --git a/pkg/storage/pebble.go b/pkg/storage/pebble.go index f696176823ad..878ffa6091e4 100644 --- a/pkg/storage/pebble.go +++ b/pkg/storage/pebble.go @@ -51,6 +51,7 @@ import ( "github.com/cockroachdb/logtags" "github.com/cockroachdb/pebble" "github.com/cockroachdb/pebble/bloom" + "github.com/cockroachdb/pebble/objstorage/shared" "github.com/cockroachdb/pebble/rangekey" "github.com/cockroachdb/pebble/replay" "github.com/cockroachdb/pebble/sstable" @@ -1123,7 +1124,11 @@ func NewPebble(ctx context.Context, cfg PebbleConfig) (p *Pebble, err error) { if cfg.SharedStorage != nil { esWrapper := &externalStorageWrapper{p: p, es: cfg.SharedStorage, ctx: ctx} - opts.Experimental.SharedStorage = esWrapper + opts.Experimental.SharedStorage = shared.MakeSimpleFactory(map[shared.Locator]shared.Storage{ + "": esWrapper, + }) + opts.Experimental.CreateOnShared = true + opts.Experimental.CreateOnSharedLocator = "" } // Read the current store cluster version.