Skip to content

Move DynamoDB index tests to cover other storage backends, fix bunch of Cassandra issues.#783

Merged
bboreham merged 6 commits intocortexproject:masterfrom
grafana:index-tests
Apr 4, 2018
Merged

Move DynamoDB index tests to cover other storage backends, fix bunch of Cassandra issues.#783
bboreham merged 6 commits intocortexproject:masterfrom
grafana:index-tests

Conversation

@tomwilkie
Copy link
Contributor

@tomwilkie tomwilkie commented Apr 1, 2018

Firstly, move some tests around so we get some coverage on the Cassandra backend (and BigTable).

Next, refactor out QueryPage lastPage param, its a dumb interface. The various backends can do a better job here; it only affects the AWS backend anyway.

Finally, fix a bunch of issue with the QueryPage implementation for Cassandra. Details in commits.

@tomwilkie tomwilkie changed the title [WIP] Move DynamoDB index tests to cover other storage backends. Move DynamoDB index tests to cover other storage backends, fix bunch of Cassandra issues. Apr 2, 2018
@bboreham
Copy link
Contributor

bboreham commented Apr 3, 2018

I find it very hard to review a PR like this.
Some things that would make it easier:

  • Split commits into pure-refactoring and behaviour-changing.
  • When you move a file and then change it, do this in two commits so GitHub shows me a diff of the change.
  • Make sure all changes in a commit are covered by the commit message

- Factor out `forAllFixtures` function, to run a test over all the storage types.
- Move some utils functions to pkg/chunk/storage/utils_test.go.
…results; server doesn't offer this facility in a consumable fashion.
… causes no ends of issues.

Instead, just have the DynamoDB implementation work it out for itself.
Doesn't run by default, as it depends on an external Cassandra cluster.  See pkg/chunk/cassandra/fixtures.go for details on how to run.
- Add errors.WithStack on all error coming back from Cassandra.
- Implement server-side value filtering.
- Correctly implement prefix queries.
- Don't call the test table "table", as this is a reserved word in CQL.
- Don't use Cassandra batches for writes, they don't do what you think they do.
- Correctly honor QueryPage callback value <--- this was the cause of the bug I was chasing...
@tomwilkie
Copy link
Contributor Author

@bboreham PTAL, I've tried to make this easier to follow for you.

Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

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

⭐ for @tomwilkie


/* BigTable only seems to support regex match on cell values, so doing it
client side for now
readOpts := []bigtable.ReadOption{
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm unclear why this code is commented out. Is it an example of what you'd like to do but doesn't work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, pretty much - I'm hoping to get some input from the Bigtable team on this. Seems weird we can do regex matches on values, but not equality matches.

Normally don't like to leave this kind of mess in there, and can remove it if you like. I'll move it to another PR that will sit open otherwise though - I need somewhere to point them at.

@bboreham bboreham merged commit 177f1ba into cortexproject:master Apr 4, 2018
@tomwilkie tomwilkie deleted the index-tests branch July 9, 2018 11:56
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.

2 participants