Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go.mod: bump Pebble to 94f91669 #107392

Merged
merged 1 commit into from Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions DEPS.bzl
Expand Up @@ -1585,10 +1585,10 @@ def go_deps():
patches = [
"@com_github_cockroachdb_cockroach//build/patches:com_github_cockroachdb_pebble.patch",
],
sha256 = "2249b70c314282d3477d62ba4c062847b7e866880f377e4f2b655a5700df86ca",
strip_prefix = "github.com/cockroachdb/pebble@v0.0.0-20230719141714-fb76a24ac098",
sha256 = "9175ac8aaf2f5e7a475fbebecb5b05ed013c1dd7fce1f1ec0504cb873bf71744",
strip_prefix = "github.com/cockroachdb/pebble@v0.0.0-20230721205111-94f91669304b",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20230719141714-fb76a24ac098.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20230721205111-94f91669304b.zip",
],
)
go_repository(
Expand Down
2 changes: 1 addition & 1 deletion build/bazelutil/distdir_files.bzl
Expand Up @@ -319,7 +319,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-20230719141714-fb76a24ac098.zip": "2249b70c314282d3477d62ba4c062847b7e866880f377e4f2b655a5700df86ca",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20230721205111-94f91669304b.zip": "9175ac8aaf2f5e7a475fbebecb5b05ed013c1dd7fce1f1ec0504cb873bf71744",
"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",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -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-20230719141714-fb76a24ac098
github.com/cockroachdb/pebble v0.0.0-20230721205111-94f91669304b
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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -490,8 +490,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-20230719141714-fb76a24ac098 h1:aCcc/r3Jdgv0DuPi4QWcTBgA1ulZBmrGyvwABRw3OEA=
github.com/cockroachdb/pebble v0.0.0-20230719141714-fb76a24ac098/go.mod h1:FN5O47SBEz5+kO9fG8UTR64g2WS1u5ZFCgTvxGjoSks=
github.com/cockroachdb/pebble v0.0.0-20230721205111-94f91669304b h1:QU4vwZQ2DkcrMMB9wnLKa2uQZnzlye8kSCwnmDSPUrQ=
github.com/cockroachdb/pebble v0.0.0-20230721205111-94f91669304b/go.mod h1:FN5O47SBEz5+kO9fG8UTR64g2WS1u5ZFCgTvxGjoSks=
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=
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/BUILD.bazel
Expand Up @@ -237,7 +237,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//objstorage/remote",
"@com_github_cockroachdb_pebble//tool",
"@com_github_cockroachdb_pebble//vfs",
"@com_github_cockroachdb_redact//:redact",
Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/debug.go
Expand Up @@ -66,7 +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/objstorage/remote"
"github.com/cockroachdb/pebble/tool"
"github.com/cockroachdb/pebble/vfs"
"github.com/cockroachdb/ttycolor"
Expand Down Expand Up @@ -1556,7 +1556,7 @@ func initPebbleCmds(cmd *cobra.Command, pebbleTool *tool.T) {
return err
}
wrapper := storage.MakeExternalStorageWrapper(context.Background(), es)
factory := shared.MakeSimpleFactory(map[shared.Locator]shared.Storage{
factory := remote.MakeSimpleFactory(map[remote.Locator]remote.Storage{
"": wrapper,
})
pebbleTool.ConfigureSharedStorage(factory, true /* createOnShared */, "" /* createOnSharedLocator */)
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/BUILD.bazel
Expand Up @@ -87,7 +87,7 @@ go_library(
"@com_github_cockroachdb_pebble//:pebble",
"@com_github_cockroachdb_pebble//bloom",
"@com_github_cockroachdb_pebble//objstorage",
"@com_github_cockroachdb_pebble//objstorage/shared",
"@com_github_cockroachdb_pebble//objstorage/remote",
"@com_github_cockroachdb_pebble//rangekey",
"@com_github_cockroachdb_pebble//record",
"@com_github_cockroachdb_pebble//replay",
Expand Down
6 changes: 3 additions & 3 deletions pkg/storage/pebble.go
Expand Up @@ -52,7 +52,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/objstorage/remote"
"github.com/cockroachdb/pebble/rangekey"
"github.com/cockroachdb/pebble/replay"
"github.com/cockroachdb/pebble/sstable"
Expand Down Expand Up @@ -855,7 +855,7 @@ func (p *Pebble) SetStoreID(ctx context.Context, storeID int32) error {
return nil
}
p.storeIDPebbleLog.Set(ctx, storeID)
// Note that SetCreatorID only does something if shared storage is configured
// Note that SetCreatorID only does something if remote storage is configured
// in the pebble options. The version gate protects against accidentally
// setting the creator ID on an older store.
if storeID != base.TempStoreID && p.minVersion.AtLeast(clusterversion.ByKey(clusterversion.V23_1SetPebbleCreatorID)) {
Expand Down Expand Up @@ -1131,7 +1131,7 @@ 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 = shared.MakeSimpleFactory(map[shared.Locator]shared.Storage{
opts.Experimental.RemoteStorage = remote.MakeSimpleFactory(map[remote.Locator]remote.Storage{
"": esWrapper,
})
opts.Experimental.CreateOnShared = true
Expand Down
38 changes: 19 additions & 19 deletions pkg/storage/shared_storage.go
Expand Up @@ -17,13 +17,13 @@ import (

"github.com/cockroachdb/cockroach/pkg/cloud"
"github.com/cockroachdb/errors"
"github.com/cockroachdb/pebble/objstorage/shared"
"github.com/cockroachdb/pebble/objstorage/remote"
)

// externalStorageReader implements shared.ObjectReader on top of
// externalStorageReader implements remote.ObjectReader on top of
// cloud.ExternalStorage..
type externalStorageReader struct {
// Store a reference to the parent Pebble instance. Metrics around shared
// Store a reference to the parent Pebble instance. Metrics around remote
// storage reads/writes are stored there.
//
// TODO(bilal): Refactor the metrics out of Pebble, and store a reference
Expand All @@ -33,7 +33,7 @@ type externalStorageReader struct {
objName string
}

var _ shared.ObjectReader = (*externalStorageReader)(nil)
var _ remote.ObjectReader = (*externalStorageReader)(nil)

func (r *externalStorageReader) ReadAt(ctx context.Context, p []byte, offset int64) error {
reader, _, err := r.es.ReadFile(ctx, r.objName, cloud.ReadOptions{
Expand All @@ -59,18 +59,18 @@ func (r *externalStorageReader) ReadAt(ctx context.Context, p []byte, offset int
return nil
}

// Close is part of the shared.ObjectReader interface.
// Close is part of the remote.ObjectReader interface.
func (e *externalStorageReader) Close() error {
*e = externalStorageReader{}
return nil
}

// externalStorageWriter wraps an io.WriteCloser returned by
// externalStorageWrapper and tracks metrics on bytes written to shared storage.
// externalStorageWrapper and tracks metrics on bytes written to remote storage.
type externalStorageWriter struct {
io.WriteCloser

// Store a reference to the parent Pebble instance. Metrics around shared
// Store a reference to the parent Pebble instance. Metrics around remote
// storage reads/writes are stored there.
//
// TODO(bilal): Refactor the metrics out of Pebble, and store a reference
Expand All @@ -88,31 +88,31 @@ func (e *externalStorageWriter) Write(p []byte) (n int, err error) {
}

// externalStorageWrapper wraps a cloud.ExternalStorage and implements the
// shared.Storage interface expected by Pebble. Also ensures reads and writes
// to shared cloud storage are tracked in store-specific metrics.
// remote.Storage interface expected by Pebble. Also ensures reads and writes
// to remote cloud storage are tracked in store-specific metrics.
type externalStorageWrapper struct {
p *Pebble
es cloud.ExternalStorage
ctx context.Context
}

// MakeExternalStorageWrapper returns a shared.Storage implementation that wraps
// MakeExternalStorageWrapper returns a remote.Storage implementation that wraps
// cloud.ExternalStorage.
func MakeExternalStorageWrapper(ctx context.Context, es cloud.ExternalStorage) shared.Storage {
func MakeExternalStorageWrapper(ctx context.Context, es cloud.ExternalStorage) remote.Storage {
return &externalStorageWrapper{p: &Pebble{}, es: es, ctx: ctx}
}

var _ shared.Storage = &externalStorageWrapper{}
var _ remote.Storage = &externalStorageWrapper{}

// Close implements the shared.Storage interface.
// Close implements the remote.Storage interface.
func (e *externalStorageWrapper) Close() error {
return e.es.Close()
}

// ReadObject implements the shared.Storage interface.
// ReadObject implements the remote.Storage interface.
func (e *externalStorageWrapper) ReadObject(
ctx context.Context, objName string,
) (_ shared.ObjectReader, objSize int64, _ error) {
) (_ remote.ObjectReader, objSize int64, _ error) {
objSize, err := e.es.Size(ctx, objName)
if err != nil {
return nil, 0, err
Expand All @@ -124,13 +124,13 @@ func (e *externalStorageWrapper) ReadObject(
}, objSize, nil
}

// CreateObject implements the shared.Storage interface.
// CreateObject implements the remote.Storage interface.
func (e *externalStorageWrapper) CreateObject(objName string) (io.WriteCloser, error) {
writer, err := e.es.Writer(e.ctx, objName)
return &externalStorageWriter{WriteCloser: writer, p: e.p}, err
}

// List implements the shared.Storage interface.
// List implements the remote.Storage interface.
func (e *externalStorageWrapper) List(prefix, delimiter string) ([]string, error) {
var directoryList []string
err := e.es.List(e.ctx, prefix, delimiter, func(s string) error {
Expand All @@ -143,12 +143,12 @@ func (e *externalStorageWrapper) List(prefix, delimiter string) ([]string, error
return directoryList, nil
}

// Delete implements the shared.Storage interface.
// Delete implements the remote.Storage interface.
func (e *externalStorageWrapper) Delete(objName string) error {
return e.es.Delete(e.ctx, objName)
}

// Size implements the shared.Storage interface.
// Size implements the remote.Storage interface.
func (e *externalStorageWrapper) Size(objName string) (int64, error) {
return e.es.Size(e.ctx, objName)
}
Expand Down