fix(deps): update github.com/grafana/dskit digest to 7c41a40 (#14277)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Trevor Whitney <trevorjwhitney@gmail.com>
pull/14286/head
renovate[bot] 2 years ago committed by GitHub
parent 3c36ba949d
commit f39cdbd541
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      go.mod
  2. 4
      go.sum
  3. 2
      tools/lambda-promtail/go.mod
  4. 4
      tools/lambda-promtail/go.sum
  5. 26
      vendor/github.com/grafana/dskit/grpcclient/grpcclient.go
  6. 27
      vendor/github.com/grafana/dskit/kv/memberlist/memberlist_client.go
  7. 5
      vendor/github.com/grafana/dskit/ring/ring_status.gohtml
  8. 2
      vendor/modules.txt

@ -49,7 +49,7 @@ require (
github.com/gorilla/mux v1.8.1
github.com/gorilla/websocket v1.5.3
github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2
github.com/grafana/dskit v0.0.0-20240905221822-931a021fb06b
github.com/grafana/dskit v0.0.0-20240925193654-7c41a4057319
github.com/grafana/go-gelf/v2 v2.0.1
github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc

@ -1042,8 +1042,8 @@ github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aN
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2 h1:qhugDMdQ4Vp68H0tp/0iN17DM2ehRo1rLEdOFe/gB8I=
github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2/go.mod h1:w/aiO1POVIeXUQyl0VQSZjl5OAGDTL5aX+4v0RA1tcw=
github.com/grafana/dskit v0.0.0-20240905221822-931a021fb06b h1:x2HCzk29I0o5pRPfqWP/qwhXaPGlcz8pohq5kO1NZoE=
github.com/grafana/dskit v0.0.0-20240905221822-931a021fb06b/go.mod h1:SPLNCARd4xdjCkue0O6hvuoveuS1dGJjDnfxYe405YQ=
github.com/grafana/dskit v0.0.0-20240925193654-7c41a4057319 h1:KACpOOTqA4WqyyKF2fFPQFiaSOpZdOT5f5gg0qkPLiU=
github.com/grafana/dskit v0.0.0-20240925193654-7c41a4057319/go.mod h1:SPLNCARd4xdjCkue0O6hvuoveuS1dGJjDnfxYe405YQ=
github.com/grafana/go-gelf/v2 v2.0.1 h1:BOChP0h/jLeD+7F9mL7tq10xVkDG15he3T1zHuQaWak=
github.com/grafana/go-gelf/v2 v2.0.1/go.mod h1:lexHie0xzYGwCgiRGcvZ723bSNyNI8ZRD4s0CLobh90=
github.com/grafana/gocql v0.0.0-20200605141915-ba5dc39ece85 h1:xLuzPoOzdfNb/RF/IENCw+oLVdZB4G21VPhkHBgwSHY=

@ -10,7 +10,7 @@ require (
github.com/go-kit/log v0.2.1
github.com/gogo/protobuf v1.3.2
github.com/golang/snappy v0.0.4
github.com/grafana/dskit v0.0.0-20240905221822-931a021fb06b
github.com/grafana/dskit v0.0.0-20240925193654-7c41a4057319
github.com/grafana/loki/v3 v3.0.0-20240809103847-9315b3d03d79
github.com/prometheus/common v0.55.0
github.com/stretchr/testify v1.9.0

@ -216,8 +216,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
github.com/grafana/dskit v0.0.0-20240905221822-931a021fb06b h1:x2HCzk29I0o5pRPfqWP/qwhXaPGlcz8pohq5kO1NZoE=
github.com/grafana/dskit v0.0.0-20240905221822-931a021fb06b/go.mod h1:SPLNCARd4xdjCkue0O6hvuoveuS1dGJjDnfxYe405YQ=
github.com/grafana/dskit v0.0.0-20240925193654-7c41a4057319 h1:KACpOOTqA4WqyyKF2fFPQFiaSOpZdOT5f5gg0qkPLiU=
github.com/grafana/dskit v0.0.0-20240925193654-7c41a4057319/go.mod h1:SPLNCARd4xdjCkue0O6hvuoveuS1dGJjDnfxYe405YQ=
github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56 h1:X8IKQ0wu40wpvYcKfBcc5T4QnhdQjUhtUtB/1CY89lE=
github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU=
github.com/grafana/jsonparser v0.0.0-20240425183733-ea80629e1a32 h1:NznuPwItog+rwdVg8hAuGKP29ndRSzJAwhxKldkP8oQ=

@ -2,6 +2,8 @@ package grpcclient
import (
"flag"
"slices"
"strings"
"time"
"github.com/pkg/errors"
@ -40,6 +42,9 @@ type Config struct {
Middleware []grpc.UnaryClientInterceptor `yaml:"-"`
StreamMiddleware []grpc.StreamClientInterceptor `yaml:"-"`
// CustomCompressors allows configuring custom compressors.
CustomCompressors []string `yaml:"-"`
}
// RegisterFlags registers flags.
@ -55,9 +60,19 @@ func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) {
cfg.InitialStreamWindowSize = defaultInitialWindowSize
cfg.InitialConnectionWindowSize = defaultInitialWindowSize
var supportedCompressors strings.Builder
supportedCompressors.WriteString("Use compression when sending messages. Supported values are: 'gzip', 'snappy'")
for _, cmp := range cfg.CustomCompressors {
supportedCompressors.WriteString(", ")
supportedCompressors.WriteString("'")
supportedCompressors.WriteString(cmp)
supportedCompressors.WriteString("'")
}
supportedCompressors.WriteString(" and '' (disable compression)")
f.IntVar(&cfg.MaxRecvMsgSize, prefix+".grpc-max-recv-msg-size", 100<<20, "gRPC client max receive message size (bytes).")
f.IntVar(&cfg.MaxSendMsgSize, prefix+".grpc-max-send-msg-size", 100<<20, "gRPC client max send message size (bytes).")
f.StringVar(&cfg.GRPCCompression, prefix+".grpc-compression", "", "Use compression when sending messages. Supported values are: 'gzip', 'snappy' and '' (disable compression)")
f.StringVar(&cfg.GRPCCompression, prefix+".grpc-compression", "", supportedCompressors.String())
f.Float64Var(&cfg.RateLimit, prefix+".grpc-client-rate-limit", 0., "Rate limit for gRPC client; 0 means disabled.")
f.IntVar(&cfg.RateLimitBurst, prefix+".grpc-client-rate-limit-burst", 0, "Rate limit burst for gRPC client.")
f.BoolVar(&cfg.BackoffOnRatelimits, prefix+".backoff-on-ratelimits", false, "Enable backoff and retry when we hit rate limits.")
@ -74,11 +89,10 @@ func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) {
}
func (cfg *Config) Validate() error {
switch cfg.GRPCCompression {
case gzip.Name, snappy.Name, "":
// valid
default:
return errors.Errorf("unsupported compression type: %s", cfg.GRPCCompression)
supportedCompressors := []string{gzip.Name, snappy.Name, ""}
supportedCompressors = append(supportedCompressors, cfg.CustomCompressors...)
if !slices.Contains(supportedCompressors, cfg.GRPCCompression) {
return errors.Errorf("unsupported compression type: %q", cfg.GRPCCompression)
}
return nil
}

@ -552,7 +552,7 @@ func (m *KV) fastJoinMembersOnStartup(ctx context.Context) {
for toJoin > 0 && len(nodes) > 0 && ctx.Err() == nil {
reached, err := m.memberlist.Join(nodes[0:1]) // Try to join single node only.
if err != nil {
level.Debug(m.logger).Log("msg", "fast-joining node failed", "node", nodes[0], "err", err)
level.Info(m.logger).Log("msg", "fast-joining node failed", "node", nodes[0], "err", err)
}
totalJoined += reached
@ -1018,14 +1018,16 @@ func (m *KV) trySingleCas(key string, codec codec.Codec, f func(in interface{})
}
// Don't even try
r, ok := out.(Mergeable)
if !ok || r == nil {
incomingValue, ok := out.(Mergeable)
if !ok || incomingValue == nil {
return nil, 0, retry, fmt.Errorf("invalid type: %T, expected Mergeable", out)
}
// To support detection of removed items from value, we will only allow CAS operation to
// succeed if version hasn't changed, i.e. state hasn't changed since running 'f'.
change, newver, err := m.mergeValueForKey(key, r, ver, codec)
// Supplied function may have kept a reference to the returned "incoming value".
// If KV store will keep this value as well, it needs to make a clone.
change, newver, err := m.mergeValueForKey(key, incomingValue, true, ver, codec)
if err == errVersionMismatch {
return nil, 0, retry, err
}
@ -1379,14 +1381,15 @@ func (m *KV) mergeBytesValueForKey(key string, incomingData []byte, codec codec.
return nil, 0, fmt.Errorf("expected Mergeable, got: %T", decodedValue)
}
return m.mergeValueForKey(key, incomingValue, 0, codec)
// No need to clone this "incomingValue", since we have just decoded it from bytes, and won't be using it.
return m.mergeValueForKey(key, incomingValue, false, 0, codec)
}
// Merges incoming value with value we have in our store. Returns "a change" that can be sent to other
// cluster members to update their state, and new version of the value.
// If CAS version is specified, then merging will fail if state has changed already, and errVersionMismatch is reported.
// If no modification occurred, new version is 0.
func (m *KV) mergeValueForKey(key string, incomingValue Mergeable, casVersion uint, codec codec.Codec) (Mergeable, uint, error) {
func (m *KV) mergeValueForKey(key string, incomingValue Mergeable, incomingValueRequiresClone bool, casVersion uint, codec codec.Codec) (Mergeable, uint, error) {
m.storeMu.Lock()
defer m.storeMu.Unlock()
@ -1398,7 +1401,7 @@ func (m *KV) mergeValueForKey(key string, incomingValue Mergeable, casVersion ui
if casVersion > 0 && curr.Version != casVersion {
return nil, 0, errVersionMismatch
}
result, change, err := computeNewValue(incomingValue, curr.value, casVersion > 0)
result, change, err := computeNewValue(incomingValue, incomingValueRequiresClone, curr.value, casVersion > 0)
if err != nil {
return nil, 0, err
}
@ -1441,8 +1444,16 @@ func (m *KV) mergeValueForKey(key string, incomingValue Mergeable, casVersion ui
}
// returns [result, change, error]
func computeNewValue(incoming Mergeable, oldVal Mergeable, cas bool) (Mergeable, Mergeable, error) {
func computeNewValue(incoming Mergeable, incomingValueRequiresClone bool, oldVal Mergeable, cas bool) (Mergeable, Mergeable, error) {
if oldVal == nil {
// It's OK to return the same value twice (once as result, once as change), because "change" will be cloned
// in mergeValueForKey if needed.
if incomingValueRequiresClone {
clone := incoming.Clone()
return clone, clone, nil
}
return incoming, incoming, nil
}

@ -38,8 +38,13 @@
<td>{{ .State }}</td>
<td>{{ .Address }}</td>
<td>{{ .RegisteredTimestamp | timeOrEmptyString }}</td>
{{ if .ReadOnly }}
<td>{{ .ReadOnly }}</td>
<td>{{ .ReadOnlyUpdatedTimestamp | durationSince }} ago ({{ .ReadOnlyUpdatedTimestamp.Format "15:04:05.999" }})</td>
{{ else }}
<td></td>
<td>{{ .ReadOnlyUpdatedTimestamp | timeOrEmptyString }}</td>
{{ end }}
<td>{{ .HeartbeatTimestamp | durationSince }} ago ({{ .HeartbeatTimestamp.Format "15:04:05.999" }})</td>
<td>{{ .NumTokens }}</td>
<td>{{ .Ownership | humanFloat }}%</td>

@ -980,7 +980,7 @@ github.com/gorilla/websocket
# github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2
## explicit; go 1.17
github.com/grafana/cloudflare-go
# github.com/grafana/dskit v0.0.0-20240905221822-931a021fb06b
# github.com/grafana/dskit v0.0.0-20240925193654-7c41a4057319
## explicit; go 1.21
github.com/grafana/dskit/aws
github.com/grafana/dskit/backoff

Loading…
Cancel
Save