diff --git a/CHANGELOG.md b/CHANGELOG.md index 19d100c06f5..090a1bc97d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re ### Fixed - [#5339](https://github.com/thanos-io/thanos/pull/5339) Receive: Fix deadlock on interrupt in routerOnly mode +- []() Store: fix groupcache handling of slashes ### Added diff --git a/pkg/cache/groupcache.go b/pkg/cache/groupcache.go index 6e62112fba4..ae46513852c 100644 --- a/pkg/cache/groupcache.go +++ b/pkg/cache/groupcache.go @@ -150,7 +150,7 @@ func NewGroupcacheWithConfig(logger log.Logger, reg prometheus.Registerer, conf galaxyhttp.RegisterHTTPHandler(universe, &galaxyhttp.HTTPOptions{ BasePath: basepath, }, mux) - r.Get(filepath.Join(basepath, conf.GroupcacheGroup, ":key"), mux.ServeHTTP) + r.Get(filepath.Join(basepath, conf.GroupcacheGroup, "*key"), mux.ServeHTTP) galaxy := universe.NewGalaxy(conf.GroupcacheGroup, int64(conf.MaxSize), galaxycache.GetterFunc( func(ctx context.Context, id string, dest galaxycache.Codec) error { diff --git a/test/e2e/store_gateway_test.go b/test/e2e/store_gateway_test.go index 84599a1ee08..5fe69581413 100644 --- a/test/e2e/store_gateway_test.go +++ b/test/e2e/store_gateway_test.go @@ -493,28 +493,9 @@ metafile_content_ttl: 0s` } }) - t.Run("query with cache hit", func(t *testing.T) { - retrievedMetrics, err := store1.SumMetrics([]string{`thanos_cache_groupcache_hits_total`, `thanos_cache_groupcache_loads_total`, `thanos_cache_groupcache_get_requests_total`}) + t.Run("try to load file with slashes", func(t *testing.T) { + resp, err := http.Get(fmt.Sprintf("http://%s/_galaxycache/groupcache_test_group/content:%s/meta.json", store1.Endpoint("http"), id.String())) testutil.Ok(t, err) - testutil.Assert(t, len(retrievedMetrics) == 3) - - queryAndAssertSeries(t, ctx, q.Endpoint("http"), func() string { return testQuery }, - time.Now, promclient.QueryOptions{ - Deduplicate: false, - }, - []model.Metric{ - { - "a": "1", - "b": "2", - "ext1": "value1", - "replica": "1", - }, - }, - ) - - testutil.Ok(t, store1.WaitSumMetricsWithOptions(e2e.Greater(retrievedMetrics[0]), []string{`thanos_cache_groupcache_hits_total`})) - testutil.Ok(t, store1.WaitSumMetricsWithOptions(e2e.Equals(retrievedMetrics[1]), []string{`thanos_cache_groupcache_loads_total`})) - testutil.Ok(t, store1.WaitSumMetricsWithOptions(e2e.Greater(retrievedMetrics[2]), []string{`thanos_cache_groupcache_get_requests_total`})) - testutil.Ok(t, store2.WaitSumMetricsWithOptions(e2e.Greater(0), []string{`thanos_cache_groupcache_peer_loads_total`})) + testutil.Equals(t, 200, resp.StatusCode) }) }