Skip to content

Commit 77e5a2b

Browse files
aknuds1alvinlin123
authored andcommitted
Upgrade to dskit@01ce9286d7d5 (cortexproject#4601)
Signed-off-by: Arve Knudsen <[email protected]> Signed-off-by: Alvin Lin <[email protected]>
1 parent 03b423f commit 77e5a2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+428
-455
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
* [CHANGE] Changed default for `-ingester.min-ready-duration` from 1 minute to 15 seconds. #4539
1313
* [CHANGE] query-frontend: Do not print anything in the logs of `query-frontend` if a in-progress query has been canceled (context canceled). #4562
1414
* [CHANGE] Compactor block deletion mark migration, needed when upgrading from v1.7, is now disabled by default. #4597
15+
* [CHANGE] The `status_code` label on gRPC client metrics has changed from '200' and '500' to '2xx', '5xx', '4xx', 'cancel' or 'error'. 4601
16+
* [CHANGE] Memberlist: changed probe interval from `1s` to `5s` and probe timeout from `500ms` to `2s`. #4601
1517
* [ENHANCEMENT] Update Go version to 1.17.5. #4602 #4604
1618
* [ENHANCEMENT] Keep track of discarded samples due to relabel configuration in `cortex_discarded_samples_total`. #4503
1719
* [ENHANCEMENT] Ruler: Add `-ruler.disable-rule-group-label` to disable the `rule_group` label on exported metrics. #4571
@@ -22,9 +24,12 @@
2224
* [ENHANCEMENT] Updated Prometheus to latest. Includes changes from prometheus#9239, adding 15 new functions. Multiple TSDB bugfixes prometheus#9438 & prometheus#9381. #4524
2325
* [ENHANCEMENT] Query Frontend: Add setting `-frontend.forward-headers-list` in frontend to configure the set of headers from the requests to be forwarded to downstream requests. #4486
2426
* [ENHANCEMENT] Blocks storage: Add `-blocks-storage.azure.http.*`, `-alertmanager-storage.azure.http.*`, and `-ruler-storage.azure.http.*` to configure the Azure storage client. #4581
27+
* [ENHANCEMENT] Optimise memberlist receive path when used as a backing store for rings with a large number of members. #4601
2528
* [BUGFIX] AlertManager: remove stale template files. #4495
2629
* [BUGFIX] Distributor: fix bug in query-exemplar where some results would get dropped. #4582
2730
* [BUGFIX] Update Thanos dependency: compactor tracing support, azure blocks storage memory fix. #4585
31+
* [BUGFIX] Querier: Disable query scheduler SRV DNS lookup, which removes noisy log messages about "failed DNS SRV record lookup". #4601
32+
* [BUGFIX] Memberlist: fixed corrupted packets when sending compound messages with more than 255 messages or messages bigger than 64KB. #4601
2833

2934
## 1.11.0 2021-11-25
3035

@@ -123,7 +128,6 @@
123128
* [BUGFIX] Update go-kit package to fix spurious log messages #4544
124129
>>>>>>> Merge release 1.11 to master (#4569)
125130
126-
127131
## 1.10.0 / 2021-08-03
128132

129133
* [CHANGE] Prevent path traversal attack from users able to control the HTTP header `X-Scope-OrgID`. #4375 (CVE-2021-36157)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ require (
2929
github.com/golang/protobuf v1.5.2
3030
github.com/golang/snappy v0.0.4
3131
github.com/gorilla/mux v1.8.0
32-
github.com/grafana/dskit v0.0.0-20211021180445-3bd016e9d7f1
32+
github.com/grafana/dskit v0.0.0-20220105080720-01ce9286d7d5
3333
github.com/json-iterator/go v1.1.12
3434
github.com/lib/pq v1.3.0
3535
github.com/minio/minio-go/v7 v7.0.10

go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,9 @@ github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB7
860860
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
861861
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
862862
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
863-
github.com/grafana/dskit v0.0.0-20211021180445-3bd016e9d7f1 h1:Qf+/W3Tup0nO21tgJmO14WJK0yyrm4L2UJipZP+Zoow=
864863
github.com/grafana/dskit v0.0.0-20211021180445-3bd016e9d7f1/go.mod h1:uPG2nyK4CtgNDmWv7qyzYcdI+S90kHHRWvHnBtEMBXM=
864+
github.com/grafana/dskit v0.0.0-20220105080720-01ce9286d7d5 h1:IXo/V2+KKLYLD724qh3uRaZgAy3BV3HdtXuSs7lb3jU=
865+
github.com/grafana/dskit v0.0.0-20220105080720-01ce9286d7d5/go.mod h1:M0/dlftwBvH7+hdNNpjMa/CUXD7gsew67mbkCuDlFXE=
865866
github.com/grafana/gocql v0.0.0-20200605141915-ba5dc39ece85 h1:xLuzPoOzdfNb/RF/IENCw+oLVdZB4G21VPhkHBgwSHY=
866867
github.com/grafana/gocql v0.0.0-20200605141915-ba5dc39ece85/go.mod h1:crI9WX6p0IhrqB+DqIUHulRW853PaNFf7o4UprV//3I=
867868
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=

pkg/compactor/compactor.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ import (
3737
)
3838

3939
const (
40+
// ringKey is the key under which we store the compactors ring in the KVStore.
41+
ringKey = "compactor"
42+
4043
blocksMarkedForDeletionName = "cortex_compactor_blocks_marked_for_deletion_total"
4144
blocksMarkedForDeletionHelp = "Total number of blocks marked for deletion in compactor."
4245
)
@@ -408,12 +411,12 @@ func (c *Compactor) starting(ctx context.Context) error {
408411
// Initialize the compactors ring if sharding is enabled.
409412
if c.compactorCfg.ShardingEnabled {
410413
lifecyclerCfg := c.compactorCfg.ShardingRing.ToLifecyclerConfig()
411-
c.ringLifecycler, err = ring.NewLifecycler(lifecyclerCfg, ring.NewNoopFlushTransferer(), "compactor", ring.CompactorRingKey, false, c.logger, prometheus.WrapRegistererWithPrefix("cortex_", c.registerer))
414+
c.ringLifecycler, err = ring.NewLifecycler(lifecyclerCfg, ring.NewNoopFlushTransferer(), "compactor", ringKey, false, c.logger, prometheus.WrapRegistererWithPrefix("cortex_", c.registerer))
412415
if err != nil {
413416
return errors.Wrap(err, "unable to initialize compactor ring lifecycler")
414417
}
415418

416-
c.ring, err = ring.New(lifecyclerCfg.RingConfig, "compactor", ring.CompactorRingKey, c.logger, prometheus.WrapRegistererWithPrefix("cortex_", c.registerer))
419+
c.ring, err = ring.New(lifecyclerCfg.RingConfig, "compactor", ringKey, c.logger, prometheus.WrapRegistererWithPrefix("cortex_", c.registerer))
417420
if err != nil {
418421
return errors.Wrap(err, "unable to initialize compactor ring")
419422
}

pkg/compactor/compactor_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,7 @@ func removeIgnoredLogs(input []string) []string {
10861086
`level=debug component=compactor msg="unregistering instance from ring" ring=compactor`: {},
10871087
`level=info component=compactor msg="instance removed from the KV store" ring=compactor`: {},
10881088
`level=info component=compactor msg="observing tokens before going ACTIVE" ring=compactor`: {},
1089+
`level=info component=compactor msg="lifecycler entering final sleep before shutdown" final_sleep=0s`: {},
10891090
}
10901091

10911092
out := make([]string, 0, len(input))

pkg/cortex/modules.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (t *Cortex) initServer() (services.Service, error) {
137137

138138
func (t *Cortex) initRing() (serv services.Service, err error) {
139139
t.Cfg.Ingester.LifecyclerConfig.RingConfig.KVStore.Multi.ConfigProvider = multiClientRuntimeConfigChannel(t.RuntimeConfig)
140-
t.Ring, err = ring.New(t.Cfg.Ingester.LifecyclerConfig.RingConfig, "ingester", ring.IngesterRingKey, util_log.Logger, prometheus.WrapRegistererWithPrefix("cortex_", prometheus.DefaultRegisterer))
140+
t.Ring, err = ring.New(t.Cfg.Ingester.LifecyclerConfig.RingConfig, "ingester", ingester.RingKey, util_log.Logger, prometheus.WrapRegistererWithPrefix("cortex_", prometheus.DefaultRegisterer))
141141
if err != nil {
142142
return nil, err
143143
}

pkg/distributor/distributor.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ var (
5454
)
5555

5656
const (
57+
// ringKey is the key under which we store the distributors ring in the KVStore.
58+
ringKey = "distributor"
59+
5760
typeSamples = "samples"
5861
typeMetadata = "metadata"
5962

@@ -211,12 +214,12 @@ func New(cfg Config, clientConfig ingester_client.Config, limits *validation.Ove
211214
if !canJoinDistributorsRing {
212215
ingestionRateStrategy = newInfiniteIngestionRateStrategy()
213216
} else if limits.IngestionRateStrategy() == validation.GlobalIngestionRateStrategy {
214-
distributorsLifeCycler, err = ring.NewLifecycler(cfg.DistributorRing.ToLifecyclerConfig(), nil, "distributor", ring.DistributorRingKey, true, log, prometheus.WrapRegistererWithPrefix("cortex_", reg))
217+
distributorsLifeCycler, err = ring.NewLifecycler(cfg.DistributorRing.ToLifecyclerConfig(), nil, "distributor", ringKey, true, log, prometheus.WrapRegistererWithPrefix("cortex_", reg))
215218
if err != nil {
216219
return nil, err
217220
}
218221

219-
distributorsRing, err = ring.New(cfg.DistributorRing.ToRingConfig(), "distributor", ring.DistributorRingKey, log, prometheus.WrapRegistererWithPrefix("cortex_", reg))
222+
distributorsRing, err = ring.New(cfg.DistributorRing.ToRingConfig(), "distributor", ringKey, log, prometheus.WrapRegistererWithPrefix("cortex_", reg))
220223
if err != nil {
221224
return nil, errors.Wrap(err, "failed to initialize distributors' ring client")
222225
}

pkg/distributor/distributor_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636

3737
"github.com/cortexproject/cortex/pkg/chunk/encoding"
3838
"github.com/cortexproject/cortex/pkg/cortexpb"
39+
"github.com/cortexproject/cortex/pkg/ingester"
3940
"github.com/cortexproject/cortex/pkg/ingester/client"
4041
"github.com/cortexproject/cortex/pkg/prom1/storage/metric"
4142
"github.com/cortexproject/cortex/pkg/tenant"
@@ -1626,7 +1627,7 @@ func BenchmarkDistributor_Push(b *testing.B) {
16261627
kvStore, closer := consul.NewInMemoryClient(ring.GetCodec(), log.NewNopLogger(), nil)
16271628
b.Cleanup(func() { assert.NoError(b, closer.Close()) })
16281629

1629-
err := kvStore.CAS(context.Background(), ring.IngesterRingKey,
1630+
err := kvStore.CAS(context.Background(), ingester.RingKey,
16301631
func(_ interface{}) (interface{}, bool, error) {
16311632
d := &ring.Desc{}
16321633
d.AddIngester("ingester-1", "127.0.0.1", "", ring.GenerateTokens(128, nil), ring.ACTIVE, time.Now())
@@ -1639,7 +1640,7 @@ func BenchmarkDistributor_Push(b *testing.B) {
16391640
KVStore: kv.Config{Mock: kvStore},
16401641
HeartbeatTimeout: 60 * time.Minute,
16411642
ReplicationFactor: 1,
1642-
}, ring.IngesterRingKey, ring.IngesterRingKey, nil, nil)
1643+
}, ingester.RingKey, ingester.RingKey, nil, nil)
16431644
require.NoError(b, err)
16441645
require.NoError(b, services.StartAndAwaitRunning(context.Background(), ingestersRing))
16451646
b.Cleanup(func() {
@@ -1983,7 +1984,7 @@ func prepare(t *testing.T, cfg prepConfig) ([]*Distributor, []mockIngester, []*p
19831984
kvStore, closer := consul.NewInMemoryClient(ring.GetCodec(), log.NewNopLogger(), nil)
19841985
t.Cleanup(func() { assert.NoError(t, closer.Close()) })
19851986

1986-
err := kvStore.CAS(context.Background(), ring.IngesterRingKey,
1987+
err := kvStore.CAS(context.Background(), ingester.RingKey,
19871988
func(_ interface{}) (interface{}, bool, error) {
19881989
return &ring.Desc{
19891990
Ingesters: ingesterDescs,
@@ -2004,7 +2005,7 @@ func prepare(t *testing.T, cfg prepConfig) ([]*Distributor, []mockIngester, []*p
20042005
},
20052006
HeartbeatTimeout: 60 * time.Minute,
20062007
ReplicationFactor: rf,
2007-
}, ring.IngesterRingKey, ring.IngesterRingKey, nil, nil)
2008+
}, ingester.RingKey, ingester.RingKey, nil, nil)
20082009
require.NoError(t, err)
20092010
require.NoError(t, services.StartAndAwaitRunning(context.Background(), ingestersRing))
20102011

pkg/ingester/ingester.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ func New(cfg Config, clientConfig client.Config, limits *validation.Overrides, c
267267
// During WAL recovery, it will create new user states which requires the limiter.
268268
// Hence initialise the limiter before creating the WAL.
269269
// The '!cfg.WALConfig.WALEnabled' argument says don't flush on shutdown if the WAL is enabled.
270-
i.lifecycler, err = ring.NewLifecycler(cfg.LifecyclerConfig, i, "ingester", ring.IngesterRingKey, !cfg.WALConfig.WALEnabled || cfg.WALConfig.FlushOnShutdown, logger, prometheus.WrapRegistererWithPrefix("cortex_", registerer))
270+
i.lifecycler, err = ring.NewLifecycler(cfg.LifecyclerConfig, i, "ingester", RingKey, !cfg.WALConfig.WALEnabled || cfg.WALConfig.FlushOnShutdown, logger, prometheus.WrapRegistererWithPrefix("cortex_", registerer))
271271
if err != nil {
272272
return nil, err
273273
}

pkg/ingester/ingester_v2.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ import (
4747
"github.com/cortexproject/cortex/pkg/util/validation"
4848
)
4949

50+
const (
51+
// RingKey is the key under which we store the ingesters ring in the KVStore.
52+
RingKey = "ring"
53+
)
54+
5055
const (
5156
errTSDBCreateIncompatibleState = "cannot create a new TSDB while the ingester is not in active state (current state: %s)"
5257
errTSDBIngest = "err: %v. timestamp=%s, series=%s" // Using error.Wrap puts the message before the error and if the series is too long, its truncated.
@@ -511,7 +516,7 @@ func NewV2(cfg Config, clientConfig client.Config, limits *validation.Overrides,
511516
}, i.getOldestUnshippedBlockMetric)
512517
}
513518

514-
i.lifecycler, err = ring.NewLifecycler(cfg.LifecyclerConfig, i, "ingester", ring.IngesterRingKey, cfg.BlocksStorageConfig.TSDB.FlushBlocksOnShutdown, logger, prometheus.WrapRegistererWithPrefix("cortex_", registerer))
519+
i.lifecycler, err = ring.NewLifecycler(cfg.LifecyclerConfig, i, "ingester", RingKey, cfg.BlocksStorageConfig.TSDB.FlushBlocksOnShutdown, logger, prometheus.WrapRegistererWithPrefix("cortex_", registerer))
515520
if err != nil {
516521
return nil, err
517522
}

0 commit comments

Comments
 (0)