Skip to content

Use BigTable Columns as range keys#946

Merged
tomwilkie merged 11 commits intocortexproject:masterfrom
grafana:bt-schema
Aug 29, 2018
Merged

Use BigTable Columns as range keys#946
tomwilkie merged 11 commits intocortexproject:masterfrom
grafana:bt-schema

Conversation

@tomwilkie
Copy link
Contributor

@tomwilkie tomwilkie commented Aug 23, 2018

This PR replaces #753, fixes #714.

Should improve performance for BigTable queries as we don't need to resend the row key multiple times.

Required a fair amount of refactoring of the composite store to support changing storage client based on time, as well as schema.

gouthamve and others added 7 commits August 23, 2018 11:39
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
@tomwilkie
Copy link
Contributor Author

I've already done a bunch of review on this, LGTM from me.

@gouthamve gouthamve force-pushed the bt-schema branch 2 times, most recently from 2eb86b1 to f180c25 Compare August 24, 2018 04:47
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
@csmarchbanks
Copy link
Contributor

I think this needs to be rebased now that the index cache is in. Once that is done I will happily review it!

@gouthamve
Copy link
Contributor

I've updated the PR, but it's not reflecting because GH has issues rn: https://status.github.com/messages

But you can put this PR back on your TODO now :) Thanks a lot for all the reviews!

// NewStorageClient makes a storage client based on the configuration.
func NewStorageClient(cfg Config, schemaCfg chunk.SchemaConfig) (client chunk.StorageClient, err error) {
// Clients makes the storage clients based on the configuration.
func Clients(cfg Config, schemaCfg chunk.SchemaConfig) ([]chunk.StorageOpt, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like a bit of a name mismatch to have a method called Clients return StorageOpts

level.Error(util.Logger).Log("msg", "error initializing storage client", "err", err)
os.Exit(1)
}
schemaOpts := chunk.SchemaOpts(chunkStoreConfig, schemaConfig)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this line be done inside chunk.NewStore since it looks like it is the same everywhere? Or is there a case you would want to use a NewStore with schemaOpts not generated like this?


opts = append(opts, chunk.StorageOpt{From: model.Time(0), Client: client})
if cfg.StorageClient == "gcp" && schemaCfg.BigtableColumnKeyFrom.IsSet() {
client, err = gcp.NewStorageClientColumnKey(context.Background(), cfg.GCPStorageConfig, schemaCfg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be a CachingStorageClient as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Fixed it.

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
@tomwilkie tomwilkie merged commit 8ebef2b into cortexproject:master Aug 29, 2018
@tomwilkie tomwilkie deleted the bt-schema branch August 29, 2018 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use column keys in Bigtable

3 participants