@@ -138,7 +138,7 @@ func (c *seriesStore) Get(ctx context.Context, from, through model.Time, allMatc
138
138
}
139
139
level .Debug (log ).Log ("chunk-ids" , len (chunkIDs ))
140
140
141
- chunks , err := c .convertChunkIDsToChunks (ctx , chunkIDs )
141
+ chunks , err := c .convertChunkIDsToChunks (ctx , userID , chunkIDs )
142
142
if err != nil {
143
143
level .Error (log ).Log ("err" , "convertChunkIDsToChunks" , "err" , err )
144
144
return nil , err
@@ -326,21 +326,16 @@ func (c *seriesStore) Put(ctx context.Context, chunks []Chunk) error {
326
326
327
327
// PutOne implements ChunkStore
328
328
func (c * seriesStore ) PutOne (ctx context.Context , from , through model.Time , chunk Chunk ) error {
329
- userID , err := user .ExtractOrgID (ctx )
330
- if err != nil {
331
- return err
332
- }
333
-
334
329
chunks := []Chunk {chunk }
335
330
336
- err = c .storage .PutChunks (ctx , chunks )
331
+ err : = c .storage .PutChunks (ctx , chunks )
337
332
if err != nil {
338
333
return err
339
334
}
340
335
341
336
c .writeBackCache (ctx , chunks )
342
337
343
- writeReqs , keysToCache , err := c .calculateIndexEntries (userID , from , through , chunk )
338
+ writeReqs , keysToCache , err := c .calculateIndexEntries (from , through , chunk )
344
339
if err != nil {
345
340
return err
346
341
}
@@ -355,7 +350,7 @@ func (c *seriesStore) PutOne(ctx context.Context, from, through model.Time, chun
355
350
}
356
351
357
352
// calculateIndexEntries creates a set of batched WriteRequests for all the chunks it is given.
358
- func (c * seriesStore ) calculateIndexEntries (userID string , from , through model.Time , chunk Chunk ) (WriteBatch , []string , error ) {
353
+ func (c * seriesStore ) calculateIndexEntries (from , through model.Time , chunk Chunk ) (WriteBatch , []string , error ) {
359
354
seenIndexEntries := map [string ]struct {}{}
360
355
entries := []IndexEntry {}
361
356
keysToCache := []string {}
@@ -365,7 +360,7 @@ func (c *seriesStore) calculateIndexEntries(userID string, from, through model.T
365
360
return nil , nil , err
366
361
}
367
362
368
- keys := c .schema .GetLabelEntryCacheKeys (from , through , userID , chunk .Metric )
363
+ keys := c .schema .GetLabelEntryCacheKeys (from , through , chunk . UserID , chunk .Metric )
369
364
370
365
cacheKeys := make ([]string , 0 , len (keys )) // Keys which translate to the strings stored in the cache.
371
366
for _ , key := range keys {
@@ -376,7 +371,7 @@ func (c *seriesStore) calculateIndexEntries(userID string, from, through model.T
376
371
377
372
_ , _ , missing := c .writeDedupeCache .Fetch (context .Background (), cacheKeys )
378
373
if len (missing ) != 0 {
379
- labelEntries , err := c .schema .GetLabelWriteEntries (from , through , userID , metricName , chunk .Metric , chunk .ExternalKey ())
374
+ labelEntries , err := c .schema .GetLabelWriteEntries (from , through , chunk . UserID , metricName , chunk .Metric , chunk .ExternalKey ())
380
375
if err != nil {
381
376
return nil , nil , err
382
377
}
@@ -385,7 +380,7 @@ func (c *seriesStore) calculateIndexEntries(userID string, from, through model.T
385
380
keysToCache = missing
386
381
}
387
382
388
- chunkEntries , err := c .schema .GetChunkWriteEntries (from , through , userID , metricName , chunk .Metric , chunk .ExternalKey ())
383
+ chunkEntries , err := c .schema .GetChunkWriteEntries (from , through , chunk . UserID , metricName , chunk .Metric , chunk .ExternalKey ())
389
384
if err != nil {
390
385
return nil , nil , err
391
386
}
0 commit comments