Skip to content

Commit

Permalink
chore(storage): Restructure shipper packages (grafana#10729)
Browse files Browse the repository at this point in the history
**What this PR does / why we need it**:

This PR restructures the code for the shipper component of the Loki storage layer.

New package layout:

```console
$ tree -d pkg/storage/stores/shipper 
pkg/storage/stores/shipper
└── indexshipper
    ├── boltdb
    │   └── compactor
    ├── compactor
    │   ├── client
    │   │   └── grpc
    │   ├── deletion
    │   ├── deletionmode
    │   ├── generationnumber
    │   └── retention
    ├── downloads
    ├── gatewayclient
    ├── index
    ├── indexgateway
    ├── storage
    ├── testutil
    ├── tsdb
    │   ├── index
    │   ├── testdata
    │   └── testutil
    ├── uploads
    └── util

23 directories
```

* TSDB and BoltDB specific code is under `./pkg/storage/stores/shipper/indexshipper/tsdb` and `./pkg/storage/stores/shipper/indexshipper/boltdb` respectively.
* Common code for both TSDB and BoltDB is directly under `./pkg/storage/stores/shipper/indexshipper` and subdirectories, such as `uploads/`, `downloads/`, `compactor/`, ...

**Special notes for your reviewer**:

This PR is identical to grafana#10724 except of the package `pkg/storage/stores/indexshipper` the package is `pkg/storage/stores/shipper/indexshipper` (one level deeper).


Signed-off-by: Christian Haudum <[email protected]>
  • Loading branch information
chaudum authored Sep 28, 2023
1 parent bb92837 commit 2e775f3
Show file tree
Hide file tree
Showing 201 changed files with 492 additions and 506 deletions.
2 changes: 1 addition & 1 deletion cmd/migrate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/grafana/loki/pkg/storage"
"github.com/grafana/loki/pkg/storage/chunk"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper"
"github.com/grafana/loki/pkg/util/cfg"
util_log "github.com/grafana/loki/pkg/util/log"
"github.com/grafana/loki/pkg/validation"
Expand Down
2 changes: 1 addition & 1 deletion pkg/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (
"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/logql/syntax"
"github.com/grafana/loki/pkg/runtime"
"github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/util"
util_log "github.com/grafana/loki/pkg/util/log"
"github.com/grafana/loki/pkg/validation"
Expand Down
2 changes: 1 addition & 1 deletion pkg/distributor/limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"time"

"github.com/grafana/loki/pkg/distributor/shardstreams"
"github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
)

// Limits is an interface for distributor limits/related configs
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingester/index/bitprefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/querier/astmapper"
"github.com/grafana/loki/pkg/storage/stores/tsdb/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb/index"
)

// BitPrefixInvertedIndex is another inverted index implementation
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingester/index/bitprefix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/querier/astmapper"
"github.com/grafana/loki/pkg/storage/stores/tsdb/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb/index"
)

func Test_BitPrefixGetShards(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingester/index/multi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/querier/astmapper"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/tsdb/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb/index"
)

func MustParseDayTime(s string) config.DayTime {
Expand Down
2 changes: 1 addition & 1 deletion pkg/logcli/query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/grafana/loki/pkg/storage"
chunk "github.com/grafana/loki/pkg/storage/chunk/client"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper"
"github.com/grafana/loki/pkg/util/cfg"
util_log "github.com/grafana/loki/pkg/util/log"
"github.com/grafana/loki/pkg/util/marshal"
Expand Down
6 changes: 3 additions & 3 deletions pkg/logcli/query/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"github.com/grafana/loki/pkg/storage"
"github.com/grafana/loki/pkg/storage/chunk/client/local"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/shipper"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/boltdb"
"github.com/grafana/loki/pkg/util/marshal"
)

Expand Down Expand Up @@ -518,7 +518,7 @@ func TestLoadFromURL(t *testing.T) {
require.Error(t, err)
require.Nil(t, client)

conf.StorageConfig.BoltDBShipperConfig = shipper.Config{
conf.StorageConfig.BoltDBShipperConfig = boltdb.IndexCfg{
Config: indexshipper.Config{
SharedStoreType: config.StorageTypeFileSystem,
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/logproto/extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/dustin/go-humanize"
"github.com/prometheus/common/model"

"github.com/grafana/loki/pkg/storage/stores/tsdb/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb/index"
)

// This is the separator define in the Prometheus Labels.Hash function.
Expand Down
2 changes: 1 addition & 1 deletion pkg/loki/delete_store_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package loki
import (
"github.com/grafana/dskit/services"

"github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor/deletion"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletion"
)

func deleteRequestsStoreListener(d deletion.DeleteRequestsClient) *listener {
Expand Down
8 changes: 4 additions & 4 deletions pkg/loki/loki.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ import (
internalserver "github.com/grafana/loki/pkg/server"
"github.com/grafana/loki/pkg/storage"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor"
compactor_client "github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor/client"
"github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor/deletion"
"github.com/grafana/loki/pkg/storage/stores/series/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor"
compactor_client "github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/client"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletion"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/indexgateway"
"github.com/grafana/loki/pkg/tracing"
"github.com/grafana/loki/pkg/util"
"github.com/grafana/loki/pkg/util/fakeauth"
Expand Down
24 changes: 12 additions & 12 deletions pkg/loki/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ import (
"github.com/grafana/loki/pkg/storage/chunk/client"
chunk_util "github.com/grafana/loki/pkg/storage/chunk/client/util"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor"
compactor_client "github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor/client"
"github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor/client/grpc"
"github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor/deletion"
"github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor/generationnumber"
"github.com/grafana/loki/pkg/storage/stores/series/index"
shipper_index "github.com/grafana/loki/pkg/storage/stores/shipper/index"
boltdb_shipper_compactor "github.com/grafana/loki/pkg/storage/stores/shipper/index/compactor"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway"
"github.com/grafana/loki/pkg/storage/stores/tsdb"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/boltdb"
boltdbcompactor "github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/boltdb/compactor"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor"
compactor_client "github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/client"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/client/grpc"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletion"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/generationnumber"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/indexgateway"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb"
"github.com/grafana/loki/pkg/util/httpreq"
"github.com/grafana/loki/pkg/util/limiter"
util_log "github.com/grafana/loki/pkg/util/log"
Expand Down Expand Up @@ -1168,7 +1168,7 @@ func (t *Loki) initCompactor() (services.Service, error) {
return nil, err
}

t.compactor.RegisterIndexCompactor(config.BoltDBShipperType, boltdb_shipper_compactor.NewIndexCompactor())
t.compactor.RegisterIndexCompactor(config.BoltDBShipperType, boltdbcompactor.NewIndexCompactor())
t.compactor.RegisterIndexCompactor(config.TSDBType, tsdb.NewIndexCompactor())
t.Server.HTTP.Path("/compactor/ring").Methods("GET", "POST").Handler(t.compactor)

Expand Down Expand Up @@ -1459,7 +1459,7 @@ func shipperQuerierIndexUpdateDelay(cacheValidity, resyncInterval time.Duration)

// shipperIngesterIndexUploadDelay returns duration it could take for an index file containing id of a chunk to be uploaded to the shared store since it got flushed.
func shipperIngesterIndexUploadDelay() time.Duration {
return shipper_index.ShardDBsByDuration + indexshipper.UploadInterval
return boltdb.ShardDBsByDuration + indexshipper.UploadInterval
}

// shipperMinIngesterQueryStoreDuration returns minimum duration(with some buffer) ingesters should query their stores to
Expand Down
9 changes: 4 additions & 5 deletions pkg/loki/modules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ import (
"github.com/grafana/loki/pkg/storage"
"github.com/grafana/loki/pkg/storage/chunk/client/local"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/shipper"

"github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/boltdb"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/indexgateway"
)

func Test_calculateMaxLookBack(t *testing.T) {
Expand Down Expand Up @@ -367,7 +366,7 @@ func minimalWorkingConfig(t *testing.T, dir, target string, cfgTransformers ...f
// This would be overwritten by the default values setting.
cfg.StorageConfig = storage.Config{
FSConfig: local.FSConfig{Directory: dir},
BoltDBShipperConfig: shipper.Config{
BoltDBShipperConfig: boltdb.IndexCfg{
Config: indexshipper.Config{
SharedStoreType: config.StorageTypeFileSystem,
ActiveIndexDirectory: path.Join(dir, "index"),
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/astmapper/shard_summer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/promql/parser"

"github.com/grafana/loki/pkg/storage/stores/tsdb/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb/index"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/grafana/loki/pkg/logql/syntax"
"github.com/grafana/loki/pkg/storage"
"github.com/grafana/loki/pkg/storage/stores/index/stats"
"github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor/deletion"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletion"
listutil "github.com/grafana/loki/pkg/util"
"github.com/grafana/loki/pkg/util/spanlogger"
util_validation "github.com/grafana/loki/pkg/util/validation"
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/logql"
"github.com/grafana/loki/pkg/storage"
"github.com/grafana/loki/pkg/storage/stores/indexshipper/compactor/deletion"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletion"
"github.com/grafana/loki/pkg/validation"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/config/schema_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/grafana/loki/pkg/chunkenc"
"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/storage/stores/tsdb/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb/index"
"github.com/grafana/loki/pkg/util/log"
)

Expand Down
24 changes: 12 additions & 12 deletions pkg/storage/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ import (
"github.com/grafana/loki/pkg/storage/chunk/client/testutils"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores"
"github.com/grafana/loki/pkg/storage/stores/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/indexshipper/downloads"
"github.com/grafana/loki/pkg/storage/stores/indexshipper/gatewayclient"
"github.com/grafana/loki/pkg/storage/stores/series/index"
"github.com/grafana/loki/pkg/storage/stores/shipper"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway"
"github.com/grafana/loki/pkg/storage/stores/tsdb"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/boltdb"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/downloads"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/gatewayclient"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/indexgateway"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb"
"github.com/grafana/loki/pkg/util"
util_log "github.com/grafana/loki/pkg/util/log"
)

var (
indexGatewayClient index.Client
// singleton for each period
boltdbIndexClientsWithShipper = make(map[config.DayTime]*shipper.IndexClient)
boltdbIndexClientsWithShipper = make(map[config.DayTime]*boltdb.IndexClient)

supportedIndexTypes = []string{
config.BoltDBShipperType,
Expand Down Expand Up @@ -100,7 +100,7 @@ func ResetBoltDBIndexClientsWithShipper() {
client.Stop()
}

boltdbIndexClientsWithShipper = make(map[config.DayTime]*shipper.IndexClient)
boltdbIndexClientsWithShipper = make(map[config.DayTime]*boltdb.IndexClient)

if indexGatewayClient != nil {
indexGatewayClient.Stop()
Expand Down Expand Up @@ -332,9 +332,9 @@ type Config struct {
DisableBroadIndexQueries bool `yaml:"disable_broad_index_queries"`
MaxParallelGetChunk int `yaml:"max_parallel_get_chunk"`

MaxChunkBatchSize int `yaml:"max_chunk_batch_size"`
BoltDBShipperConfig shipper.Config `yaml:"boltdb_shipper" doc:"description=Configures storing index in an Object Store (GCS/S3/Azure/Swift/COS/Filesystem) in the form of boltdb files. Required fields only required when boltdb-shipper is defined in config."`
TSDBShipperConfig tsdb.IndexCfg `yaml:"tsdb_shipper" doc:"description=Configures storing index in an Object Store (GCS/S3/Azure/Swift/COS/Filesystem) in a prometheus TSDB-like format. Required fields only required when TSDB is defined in config."`
MaxChunkBatchSize int `yaml:"max_chunk_batch_size"`
BoltDBShipperConfig boltdb.IndexCfg `yaml:"boltdb_shipper" doc:"description=Configures storing index in an Object Store (GCS/S3/Azure/Swift/COS/Filesystem) in the form of boltdb files. Required fields only required when boltdb-shipper is defined in config."`
TSDBShipperConfig tsdb.IndexCfg `yaml:"tsdb_shipper" doc:"description=Configures storing index in an Object Store (GCS/S3/Azure/Swift/COS/Filesystem) in a prometheus TSDB-like format. Required fields only required when TSDB is defined in config."`

// Config for using AsyncStore when using async index stores like `boltdb-shipper`.
// It is required for getting chunk ids of recently flushed chunks from the ingesters.
Expand Down Expand Up @@ -440,7 +440,7 @@ func NewIndexClient(periodCfg config.PeriodConfig, tableRange config.TableRange,
if shardingStrategy != nil {
filterFn = shardingStrategy.FilterTenants
}
indexClient, err := shipper.NewIndexClient(cfg.BoltDBShipperConfig, objectClient, limits, filterFn, tableRange, registerer, logger)
indexClient, err := boltdb.NewIndexClient(cfg.BoltDBShipperConfig, objectClient, limits, filterFn, tableRange, registerer, logger)
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/storage/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"github.com/grafana/loki/pkg/storage/chunk/client/cassandra"
"github.com/grafana/loki/pkg/storage/chunk/client/local"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/shipper"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/boltdb"
util_log "github.com/grafana/loki/pkg/util/log"
"github.com/grafana/loki/pkg/validation"
)
Expand Down Expand Up @@ -94,7 +94,7 @@ func TestNamedStores(t *testing.T) {
tempDir := t.TempDir()

// config for BoltDB Shipper
boltdbShipperConfig := shipper.Config{}
boltdbShipperConfig := boltdb.IndexCfg{}
flagext.DefaultValues(&boltdbShipperConfig)
boltdbShipperConfig.ActiveIndexDirectory = path.Join(tempDir, "index")
boltdbShipperConfig.SharedStoreType = "named-store"
Expand Down
8 changes: 4 additions & 4 deletions pkg/storage/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import (
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores"
"github.com/grafana/loki/pkg/storage/stores/index"
"github.com/grafana/loki/pkg/storage/stores/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/indexshipper/gatewayclient"
"github.com/grafana/loki/pkg/storage/stores/series"
series_index "github.com/grafana/loki/pkg/storage/stores/series/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway"
"github.com/grafana/loki/pkg/storage/stores/tsdb"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/gatewayclient"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/indexgateway"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb"
"github.com/grafana/loki/pkg/util"
"github.com/grafana/loki/pkg/util/deletion"
)
Expand Down
20 changes: 9 additions & 11 deletions pkg/storage/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import (
"github.com/grafana/loki/pkg/storage/chunk"
"github.com/grafana/loki/pkg/storage/chunk/client/local"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/shipper"
"github.com/grafana/loki/pkg/storage/stores/tsdb"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/boltdb"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb"
util_log "github.com/grafana/loki/pkg/util/log"
"github.com/grafana/loki/pkg/util/marshal"
"github.com/grafana/loki/pkg/validation"
Expand Down Expand Up @@ -1189,11 +1189,9 @@ func TestStore_MultiPeriod(t *testing.T) {
shipperConfig.Mode = indexshipper.ModeReadWrite

cfg := Config{
FSConfig: local.FSConfig{Directory: path.Join(tempDir, "chunks")},
BoltDBShipperConfig: shipper.Config{
Config: shipperConfig,
},
TSDBShipperConfig: tsdb.IndexCfg{Config: shipperConfig, CachePostings: false},
FSConfig: local.FSConfig{Directory: path.Join(tempDir, "chunks")},
BoltDBShipperConfig: boltdb.IndexCfg{Config: shipperConfig},
TSDBShipperConfig: tsdb.IndexCfg{Config: shipperConfig, CachePostings: false},
NamedStores: NamedStores{
Filesystem: map[string]NamedFSConfig{
"named-store": {Directory: path.Join(tempDir, "named-store")},
Expand Down Expand Up @@ -1507,7 +1505,7 @@ func TestStore_BoltdbTsdbSameIndexPrefix(t *testing.T) {
require.NoError(t, err)

// config for BoltDB Shipper
boltdbShipperConfig := shipper.Config{}
boltdbShipperConfig := boltdb.IndexCfg{}
flagext.DefaultValues(&boltdbShipperConfig)
boltdbShipperConfig.ActiveIndexDirectory = path.Join(tempDir, "index")
boltdbShipperConfig.SharedStoreType = config.StorageTypeFileSystem
Expand All @@ -1516,7 +1514,7 @@ func TestStore_BoltdbTsdbSameIndexPrefix(t *testing.T) {
boltdbShipperConfig.IngesterName = ingesterName

// config for tsdb Shipper
tsdbShipperConfig := indexshipper.Config{}
tsdbShipperConfig := tsdb.IndexCfg{}
flagext.DefaultValues(&tsdbShipperConfig)
tsdbShipperConfig.ActiveIndexDirectory = path.Join(tempDir, "tsdb-index")
tsdbShipperConfig.SharedStoreType = config.StorageTypeFileSystem
Expand All @@ -1531,7 +1529,7 @@ func TestStore_BoltdbTsdbSameIndexPrefix(t *testing.T) {
cfg := Config{
FSConfig: local.FSConfig{Directory: path.Join(tempDir, "chunks")},
BoltDBShipperConfig: boltdbShipperConfig,
TSDBShipperConfig: tsdb.IndexCfg{Config: tsdbShipperConfig},
TSDBShipperConfig: tsdbShipperConfig,
}

schemaConfig := config.SchemaConfig{
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/stores/index/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/willf/bloom"

"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/storage/stores/tsdb/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb/index"
)

var BloomPool PoolBloom
Expand Down
Loading

0 comments on commit 2e775f3

Please sign in to comment.