We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0667242 commit b41a4dfCopy full SHA for b41a4df
pkg/querier/queryrange/results_cache.go
@@ -179,11 +179,17 @@ func NewResultsCacheMiddleware(
179
}
180
181
func (s resultsCache) Do(ctx context.Context, r Request) (Response, error) {
182
- userID, err := tenant.TenantID(ctx)
+ tenantIDs, err := tenant.TenantIDs(ctx)
183
if err != nil {
184
return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error())
185
186
187
+ // do not cache multi tenant queries
188
+ if len(tenantIDs) != 1 {
189
+ return s.next.Do(ctx, r)
190
+ }
191
+ userID := tenantIDs[0]
192
+
193
if s.shouldCache != nil && !s.shouldCache(r) {
194
return s.next.Do(ctx, r)
195
0 commit comments