Skip to content

Commit

Permalink
Update cortex vendoring to latest master (#1975)
Browse files Browse the repository at this point in the history
* Update cortex vendoring to latest master checksum `36496a074bc4530fb1d7c74136cab1566fbd9583`

Signed-off-by: Ed Welch <[email protected]>

* handle all the breaking changes from cortes

Signed-off-by: Sandeep Sukhani <[email protected]>

* rebasing on master, re-runing go mod vendor seemed to bring in some more changes...

Signed-off-by: Ed Welch <[email protected]>

Co-authored-by: Sandeep Sukhani <[email protected]>
  • Loading branch information
slim-bean and sandeepsukhani authored Apr 23, 2020
1 parent 97788ab commit b89a1f8
Show file tree
Hide file tree
Showing 58 changed files with 1,093 additions and 148 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/containerd/containerd v1.3.2 // indirect
github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448 // indirect
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e
github.com/cortexproject/cortex v1.0.1-0.20200416152925-3fe04dcff1d8
github.com/cortexproject/cortex v1.0.1-0.20200423101820-36496a074bc4
github.com/davecgh/go-spew v1.1.1
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/docker v0.7.3-0.20190817195342-4760db040282
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cortexproject/cortex v0.6.1-0.20200228110116-92ab6cbe0995/go.mod h1:3Xa3DjJxtpXqxcMGdk850lcIRb81M0fyY1MQ6udY134=
github.com/cortexproject/cortex v1.0.1-0.20200416152925-3fe04dcff1d8 h1:A7nGtA5pj10j5bwbLPqf5C+WAhVzFaOt1c/uen6202o=
github.com/cortexproject/cortex v1.0.1-0.20200416152925-3fe04dcff1d8/go.mod h1:5NXU+UpV8NW6I3teskVmxn45xcq4+IbtSOINfRf+jds=
github.com/cortexproject/cortex v1.0.1-0.20200423101820-36496a074bc4 h1:SNBpM6lX8ZjDsSrQWbxP1FRO8KXirnRwFvtcLA8+DCc=
github.com/cortexproject/cortex v1.0.1-0.20200423101820-36496a074bc4/go.mod h1:S2BogfHdb0YCo5Zly3vOEsqzsE7YXdumHBMRJkgDZm4=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/cznic/b v0.0.0-20180115125044-35e9bbe41f07/go.mod h1:URriBxXwVq5ijiJ12C7iIZqlA69nTlI+LgI6/pwftG8=
github.com/cznic/fileutil v0.0.0-20180108211300-6a051e75936f/go.mod h1:8S58EK26zhXSxzv7NQFpnliaOQsmDUxvoQO3rt154Vg=
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingester/flush_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func defaultIngesterTestConfig(t *testing.T) Config {
cfg.ConcurrentFlushes = 1
cfg.LifecyclerConfig.RingConfig.KVStore.Mock = kvClient
cfg.LifecyclerConfig.NumTokens = 1
cfg.LifecyclerConfig.ListenPort = func(i int) *int { return &i }(0)
cfg.LifecyclerConfig.ListenPort = 0
cfg.LifecyclerConfig.Addr = "localhost"
cfg.LifecyclerConfig.ID = "localhost"
cfg.LifecyclerConfig.FinalSleep = 0
Expand Down
2 changes: 1 addition & 1 deletion pkg/loki/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (t *Loki) initQuerier() (services.Service, error) {
func (t *Loki) initIngester() (_ services.Service, err error) {
t.cfg.Ingester.LifecyclerConfig.RingConfig.KVStore.Multi.ConfigProvider = multiClientRuntimeConfigChannel(t.runtimeConfig)
t.cfg.Ingester.LifecyclerConfig.RingConfig.KVStore.MemberlistKV = t.memberlistKV.GetMemberlistKV
t.cfg.Ingester.LifecyclerConfig.ListenPort = &t.cfg.Server.GRPCListenPort
t.cfg.Ingester.LifecyclerConfig.ListenPort = t.cfg.Server.GRPCListenPort

// We want ingester to also query the store when using boltdb-shipper
if activeIndexType(t.cfg.SchemaConfig) == local.BoltDBShipperType {
Expand Down
3 changes: 2 additions & 1 deletion pkg/storage/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/cortexproject/cortex/pkg/chunk"
cortex_local "github.com/cortexproject/cortex/pkg/chunk/local"
"github.com/cortexproject/cortex/pkg/chunk/storage"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/weaveworks/common/user"
Expand Down Expand Up @@ -51,7 +52,7 @@ type store struct {
func NewStore(cfg Config, storeCfg chunk.StoreConfig, schemaCfg chunk.SchemaConfig, limits storage.StoreLimits) (Store, error) {
registerCustomIndexClients(cfg, schemaCfg)

s, err := storage.NewStore(cfg.Config, storeCfg, schemaCfg, limits)
s, err := storage.NewStore(cfg.Config, storeCfg, schemaCfg, limits, prometheus.DefaultRegisterer)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/stores/local/boltdb_index_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (b *BoltdbIndexClientWithShipper) QueryPages(ctx context.Context, queries [
return chunk_util.DoParallelQueries(ctx, b.query, queries, callback)
}

func (b *BoltdbIndexClientWithShipper) query(ctx context.Context, query chunk.IndexQuery, callback func(chunk.ReadBatch) (shouldContinue bool)) error {
func (b *BoltdbIndexClientWithShipper) query(ctx context.Context, query chunk.IndexQuery, callback chunk_util.Callback) error {
db, err := b.GetDB(query.TableName, local.DBOperationRead)
if err != nil && err != local.ErrUnexistentBoltDB {
return err
Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/stores/local/downloads.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (s *Shipper) checkStorageForUpdates(ctx context.Context, period string, fc

// listing tables from store
var objects []chunk.StorageObject
objects, err = s.storageClient.List(ctx, period+"/")
objects, _, err = s.storageClient.List(ctx, period+"/")
if err != nil {
return
}
Expand Down Expand Up @@ -160,7 +160,7 @@ func (s *Shipper) downloadFilesForPeriod(ctx context.Context, period string, fc
fc.Lock()
defer fc.Unlock()

objects, err := s.storageClient.List(ctx, period+"/")
objects, _, err := s.storageClient.List(ctx, period+"/")
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/stores/local/downloads_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
func queryTestBoltdb(t *testing.T, boltdbIndexClient *BoltdbIndexClientWithShipper, query chunk.IndexQuery) map[string]string {
resp := map[string]string{}

require.NoError(t, boltdbIndexClient.query(context.Background(), query, func(batch chunk.ReadBatch) (shouldContinue bool) {
require.NoError(t, boltdbIndexClient.query(context.Background(), query, func(query chunk.IndexQuery, batch chunk.ReadBatch) bool {
itr := batch.Iterator()
for itr.Next() {
resp[string(itr.RangeValue())] = string(itr.Value())
Expand Down
8 changes: 4 additions & 4 deletions pkg/storage/stores/util/object_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ func (p PrefixedObjectClient) GetObject(ctx context.Context, objectKey string) (
return p.downstreamClient.GetObject(ctx, p.prefix+objectKey)
}

func (p PrefixedObjectClient) List(ctx context.Context, prefix string) ([]chunk.StorageObject, error) {
objects, err := p.downstreamClient.List(ctx, p.prefix+prefix)
func (p PrefixedObjectClient) List(ctx context.Context, prefix string) ([]chunk.StorageObject, []chunk.StorageCommonPrefix, error) {
objects, commonPrefixes, err := p.downstreamClient.List(ctx, p.prefix+prefix)
if err != nil {
return nil, err
return nil, nil, err
}

for i := range objects {
objects[i].Key = strings.TrimPrefix(objects[i].Key, p.prefix)
}

return objects, nil
return objects, commonPrefixes, nil
}

func (p PrefixedObjectClient) DeleteObject(ctx context.Context, objectKey string) error {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b89a1f8

Please sign in to comment.