Skip to content

Update lettuce to 3.x #104

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

Closed
wants to merge 15 commits into from
Closed

Update lettuce to 3.x #104

wants to merge 15 commits into from

Conversation

mp911de
Copy link
Member

@mp911de mp911de commented Sep 18, 2014

  • Update lettuce redis client to latest snapshot, adopt changed API and use API for commands which were emulated using LUA script
  • Implement Sentinel support using lettuce library, adopt finer grained exceptions and aligned exception behavior to match other libraries
  • Added shutdown-timeout property in order to control shutdown duration of the netty framework which reduces test run duration
  • Documentation updated
  • Contains also a fix to use psetex instead of setex (typo)
  • Switched MinimumRedisVersionRule to Jedis since Jedis has a much faster shutdown behavior than lettuce

Reference: DATAREDIS-348

Update lettuce redis client to latest snapshot, adopt changed API and use API for commands which were emulated using LUA script

Reference: DATAREDIS-348
Implement Sentinel support using lettuce library, adopt finer grained exceptions and aligned exception behavior to match other libraries. Added shutdown-timeout property in order to control shutdown duration of the netty framework which reduces test run duration. Documentation updated as well. Contains also a fix to use psetex instead of setex (typo).

Reference: DATAREDIS-348
@mp911de
Copy link
Member Author

mp911de commented Sep 18, 2014

Please review this PR. It is in the first step a proposal how to adopt lettuce 3.x into spring-data-redis.

private Object await(Command cmd) {
if (isMulti && cmd.type != MULTI) {
private Object await(com.lambdaworks.redis.protocol.RedisCommand cmd) {
if (isMulti && cmd instanceof Command && ((Command)cmd).isMulti()) {
Copy link
Member

Choose a reason for hiding this comment

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

should have been && !((Command)cmd).isMulti() right?

Copy link
Member Author

Choose a reason for hiding this comment

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

right. It's a typo and I no test fails. This seems awkward to me. I'll add a test case for this behavior

Copy link
Member Author

Choose a reason for hiding this comment

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

I took a look again since the code was confusing. await(...) is called only in regular mode (pipeline=false and queuing=false). This means isMulti is in await(...) always false.

Another issue that I noticed is:

Issuing MULTI via exec on a regular connection (connection.execute("MULTI")) with await(...) will return an empty List. All following commands will be triggered within the MULTI on Redis but won't provide a result on the final EXEC. This is because lettuce queues all MULTI-related outputs in an internal
MultiOutput. The MultiOutput in case of a EXEC using execute(...) is empty and has no definition about the data structures that come back.

So coming back to await(...) it means that the if-clause can be removed safely.

Does it make sense?

@christophstrobl
Copy link
Member

thx @mp911de that looks pretty decent - as this is quite a big shift I'd ask you to give us a little time to think things through in detail.

@mp911de
Copy link
Member Author

mp911de commented Sep 25, 2014

Sure. I'll provide the changes mentioned above. Take as long as you need. If you need any changes to lettuce, come back to me.

@thomasdarimont
Copy link

Hi Mark,

would you mind rebasing this on the current master? I wanted to give it a spin - but I couldn't apply your patch.

Cheers,
Thomas

Btw. I just read on your site that you're from Weinheim - I'm often near Viernheim - let me know if you want to grab a beer ;-)

@mp911de
Copy link
Member Author

mp911de commented Nov 14, 2014

Hi Thomas,
I'll do so. Guess, you'll need a new PR then, right? Hit me up if you're in the area.

@thomasdarimont
Copy link

Hi,
I think it already works of you just update and push the branch again that you used to issue the PR.
http://stackoverflow.com/questions/7947322/preferred-github-workflow-for-updating-a-pull-request-after-code-review

Great looking forward to meet you :)

Conflicts:
	src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnection.java
	src/test/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionIntegrationTests.java
@mp911de
Copy link
Member Author

mp911de commented Nov 14, 2014

Merged master into DATAREDIS-348. I also created a rebased branch (https://github.com/mp911de/spring-data-redis/tree/issue/DATAREDIS-348b, see https://github.com/mp911de/spring-data-redis/compare/issue/DATAREDIS-348b for comparison) since I'm not quite sure wether the merge results in what we expect.

@mp911de
Copy link
Member Author

mp911de commented May 19, 2015

@christophstrobl @thomasdarimont still interested in the lettuce 3.x upgrade or should I abandon this PR?

@thomasdarimont
Copy link

Hi Mark,

sorry for the radio silence - we worked on different projects for a while and Christoph currently is and I will be on holiday for the next 2 weeks.
Would you be so kind to rebase this PR again on the latest SD Redis master?
I just tried to apply the PR as a patch but it failed due to some code shifting here and there that took place in the meantime :-(.

Although we focus on using the jedis driver in SD Redis internally, it would be helpful to have an updated lettuce alternative at hand, especially given that the lettuce driver we currently use was last updated in 2013...
Since we still have Lettuce support in SD Redis and your fork is the most active and well maintained (and comes with support for Redis cluster) I'd vote to definitely upgrade to this.

@christophstrobl @olivergierke thoughts?

Cheers,
Thomas

@odrotbohm
Copy link
Member

I am not too much in the details but it worries me that this PR seems to introduce a lot of dependencies to the Lattice driver in types that didn't have driver dependencies before. Is that by purpose?

@mp911de
Copy link
Member Author

mp911de commented May 20, 2015

I'm not quite sure which types you're talking about. Do you mean netty or the massive change within the import sections?

I could not find types in which imports to com.lambdaworks.redis were added and that did not contain previously imports to com.lambdaworks.redis.

@odrotbohm
Copy link
Member

Looks like the imports are ordered differently. They showed additions but the removals further below (which I oversaw). All good.

mp911de added 5 commits May 23, 2015 18:10
…DATAREDIS-348c

Conflicts:
	gradle.properties
	src/asciidoc/reference/redis.adoc
	src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConverters.java
…DATAREDIS-348c

Conflicts:
	gradle.properties
	src/asciidoc/reference/redis.adoc
	src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConverters.java
@mp911de
Copy link
Member Author

mp911de commented Jun 2, 2015

Rebased this PR to the most recent master. Added support for HLL and ZRANGEBYLEX

@christophstrobl
Copy link
Member

thanks @mp911de!

odrotbohm pushed a commit that referenced this pull request Aug 4, 2015
Updated lettuce redis client to latest snapshot, adopt changed API and use API for commands which were emulated using LUA script

Implemente Sentinel support using lettuce library, adopt finer grained exceptions and aligned exception behavior to match other libraries. Added shutdown-timeout property in order to control shutdown duration of the netty framework which reduces test run duration. Documentation updated as well. Contains also a fix to use psetex instead of setex (typo).

Switch to Jedis for Redis Version discovery in tests. Polished documentation. Use LettuceConverter and native time() method.

Original pull request: #144.
Related pull request: #104.
christophstrobl added a commit that referenced this pull request Aug 4, 2015
Fixed connection problems leaving sockets open. Added missing JUnit rules for Sentinels. Added missing author information update, license header and Javadoc.

Upgraded test script to use Redis 3.0.2. Upgrade test script to shut down Redis in case of test errors. Added Redis 3.0 to TestProfileValueSource. Enabled ZRANGEBYLEX tests for lettuce.

Original pull request: #144.
Related pull request: #104.
@mp911de
Copy link
Member Author

mp911de commented Sep 2, 2015

This PR could be closed, lettuce 3.0 was merged to master with #144. WDYT?

@christophstrobl
Copy link
Member

fixed in #144

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.

4 participants