Skip to content

Add Redis support #1612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Oct 3, 2019
Merged

Add Redis support #1612

merged 37 commits into from
Oct 3, 2019

Conversation

dmitsh
Copy link
Contributor

@dmitsh dmitsh commented Aug 24, 2019

Adding support for Redis.
Reference: issue #1333

Dmitry Shmulevich added 2 commits August 23, 2019 18:31
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Dmitry Shmulevich added 3 commits August 26, 2019 13:15
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
@dmitsh dmitsh changed the title adding support for Redis cache Add Redis support Aug 29, 2019
@tomwilkie
Copy link
Contributor

Hi @dmitsh! This PR looks pretty good to me so far. I wonder why you've choosen to separate out the redis type from the redisClient type? I think they could be all one type.

@dmitsh
Copy link
Contributor Author

dmitsh commented Sep 5, 2019

@tomwilkie The main rationale was to follow memcached model. But I can see your point. Let me address that shortly.

Dmitry Shmulevich added 2 commits September 5, 2019 14:26
added unit test

Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
@dmitsh
Copy link
Contributor Author

dmitsh commented Sep 5, 2019

@tomwilkie please take a look. I also added a unit test.

Dmitry Shmulevich added 3 commits September 5, 2019 16:03
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
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.

Code looks broadly OK, thanks for the PR!

I was a little surprised that it allows tiering of redis on top of memcached, which seems unlikely.
It's simpler to add redis as a whole separate thing to memcached, but I think the result is more hostile to users who end up with dozens of new options.
Similarly it would be good to combine the metrics rather than exporting two sets, of which one set is useless.

@bboreham
Copy link
Contributor

Oh, and you should add a line to CHANGELOG for the release.

Dmitry Shmulevich added 4 commits September 11, 2019 14:47
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
@dmitsh
Copy link
Contributor Author

dmitsh commented Sep 11, 2019

@bboreham I've implemented the changes we discussed.

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.

Looks good to me!

@bboreham bboreham requested a review from tomwilkie September 12, 2019 11:31
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Copy link
Contributor

@gouthamve gouthamve left a comment

Choose a reason for hiding this comment

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

I don't think we should mix the cache configs together. We should separate them. We do the same in ring kv stores (consul, etcd) for example.

Dmitry Shmulevich added 2 commits September 18, 2019 10:39
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Dmitry Shmulevich added 17 commits September 18, 2019 10:39
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
added unit test

Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
…is-cache

Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
@dmitsh
Copy link
Contributor Author

dmitsh commented Sep 18, 2019

@gouthamve per our discussion I have made requested changes.
I've also rebased the branch and updated dependencies.

Dmitry Shmulevich added 2 commits September 25, 2019 16:43
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
Copy link
Contributor

@gouthamve gouthamve left a comment

Choose a reason for hiding this comment

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

@bboreham I spoke with Dmitry and we decided it is best to keep the specific config options separate. Right now it's cleaner as we're simply doing a {Memcached/Redis}Config.RegisterFlags and calling a NewRedisCache(RedisConfig).

If we had a common host and timeout, we'd be doing something similar to:

cfg.RedisConfig.Host = cfg.Host
cfg.RegisConfig.Timeout = cfg.Timeout

And similarly for Memcached. Further, having it this way would also mean we are backwards compatible and nothing needs to be deprecated.

Though we have -redis.hostname and memcached.hostname now, I think it's clearer to the users here.

Curious to know your thoughts on this.

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.

Some initial thoughts.

Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
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.

LGTM, thanks!

Copy link
Contributor

@csmarchbanks csmarchbanks left a comment

Choose a reason for hiding this comment

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

LGTM

@csmarchbanks csmarchbanks merged commit 857bb84 into cortexproject:master Oct 3, 2019
@dmitsh dmitsh deleted the ds-redis-cache branch October 3, 2019 17:02
@dmitsh dmitsh restored the ds-redis-cache branch October 3, 2019 17:02
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.

5 participants