-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Upgrade to Jedis 5.0 #2612
Comments
I just did a quick evaluation on upgrading Spring Data Redis to Jedis
|
@christophstrobl can you assign this to me, want to give this a try! |
Jedis 5 seems a major rewrite, judging from the amount of breaking changes: https://github.com/redis/jedis/releases/tag/v5.0.0-beta2 |
Jedis 5.0 is GA now ,any progress? |
@lzysuqianqiu the team is evaluating the impact associated with the quite extensive list of breaking changes. |
okay,get it |
I have adapted SD Redis on the mainline (issue/2612 topic branch) to Jedis However, there are still test failures (errors) in the Redis Pipelining and Transactional tests: [INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] JedisClusterConnectionTests.bzPopMaxShouldWorkCorrectly:2309 » RedisSystem Unknown redis exception
[ERROR] JedisClusterConnectionTests.bzPopMinShouldWorkCorrectly:2282 » RedisSystem Unknown redis exception
[ERROR] JedisConnectionPipelineIntegrationTests>AbstractConnectionIntegrationTests.testZDiff:2039->AbstractConnectionPipelineIntegrationTests.verifyResults:175->AbstractConnectionPipelineIntegrationTests.getResults:189 » ClassCast class java.util.ArrayList cannot be cast to class java.util.Set (java.util.ArrayList and java.util.Set are in module java.base of loader 'bootstrap')
[ERROR] JedisConnectionPipelineIntegrationTests>AbstractConnectionIntegrationTests.testZInter:2068->AbstractConnectionPipelineIntegrationTests.verifyResults:175->AbstractConnectionPipelineIntegrationTests.getResults:189 » ClassCast class java.util.ArrayList cannot be cast to class java.util.Set (java.util.ArrayList and java.util.Set are in module java.base of loader 'bootstrap')
[ERROR] JedisConnectionPipelineIntegrationTests>AbstractConnectionIntegrationTests.testZInterAggWeights:2085->AbstractConnectionPipelineIntegrationTests.verifyResults:175->AbstractConnectionPipelineIntegrationTests.getResults:189 » ClassCast class java.util.ArrayList cannot be cast to class java.util.Set (java.util.ArrayList and java.util.Set are in module java.base of loader 'bootstrap')
[ERROR] JedisConnectionPipelineIntegrationTests>AbstractConnectionIntegrationTests.testZUnion:2377->AbstractConnectionPipelineIntegrationTests.verifyResults:175->AbstractConnectionPipelineIntegrationTests.getResults:189 » ClassCast class java.util.ArrayList cannot be cast to class java.util.Set (java.util.ArrayList and java.util.Set are in module java.base of loader 'bootstrap')
[ERROR] JedisConnectionPipelineIntegrationTests>AbstractConnectionIntegrationTests.testZUnionAggWeights:2394->AbstractConnectionPipelineIntegrationTests.verifyResults:175->AbstractConnectionPipelineIntegrationTests.getResults:189 » ClassCast class java.util.ArrayList cannot be cast to class java.util.Set (java.util.ArrayList and java.util.Set are in module java.base of loader 'bootstrap')
[ERROR] JedisConnectionTransactionIntegrationTests>AbstractConnectionIntegrationTests.testZDiff:2039->AbstractConnectionTransactionIntegrationTests.verifyResults:175->AbstractConnectionTransactionIntegrationTests.getResults:165 » ClassCast class java.util.ArrayList cannot be cast to class java.util.Set (java.util.ArrayList and java.util.Set are in module java.base of loader 'bootstrap')
[ERROR] JedisConnectionTransactionIntegrationTests>AbstractConnectionIntegrationTests.testZInter:2068->AbstractConnectionTransactionIntegrationTests.verifyResults:175->AbstractConnectionTransactionIntegrationTests.getResults:165 » ClassCast class java.util.ArrayList cannot be cast to class java.util.Set (java.util.ArrayList and java.util.Set are in module java.base of loader 'bootstrap')
[ERROR] JedisConnectionTransactionIntegrationTests>AbstractConnectionIntegrationTests.testZInterAggWeights:2085->AbstractConnectionTransactionIntegrationTests.verifyResults:175->AbstractConnectionTransactionIntegrationTests.getResults:165 » ClassCast class java.util.ArrayList cannot be cast to class java.util.Set (java.util.ArrayList and java.util.Set are in module java.base of loader 'bootstrap')
[ERROR] JedisConnectionTransactionIntegrationTests>AbstractConnectionIntegrationTests.testZUnion:2377->AbstractConnectionTransactionIntegrationTests.verifyResults:175->AbstractConnectionTransactionIntegrationTests.getResults:165 » ClassCast class java.util.ArrayList cannot be cast to class java.util.Set (java.util.ArrayList and java.util.Set are in module java.base of loader 'bootstrap')
[ERROR] JedisConnectionTransactionIntegrationTests>AbstractConnectionIntegrationTests.testZUnionAggWeights:2394->AbstractConnectionTransactionIntegrationTests.verifyResults:175->AbstractConnectionTransactionIntegrationTests.getResults:165 » ClassCast class java.util.ArrayList cannot be cast to class java.util.Set (java.util.ArrayList and java.util.Set are in module java.base of loader 'bootstrap')
[ERROR] org.springframework.data.redis.core.DefaultStreamOperationsIntegrationTests.pendingShouldReadMessageDetails
[INFO] Run 1: PASS And: [ERROR] Run 10: DefaultStreamOperationsIntegrationTests.pendingShouldReadMessageDetails:409 » RedisSystem Unknown redis exception
[ERROR] Run 11: DefaultStreamOperationsIntegrationTests.pendingShouldReadMessageDetails:409 » RedisSystem Unknown redis exception
[ERROR] Run 12: DefaultStreamOperationsIntegrationTests.pendingShouldReadMessageDetails:409 » RedisSystem Unknown redis exception
[ERROR] Run 13: DefaultStreamOperationsIntegrationTests.pendingShouldReadMessageDetails:409 » RedisSystem Unknown redis exception
[ERROR] Run 14: DefaultStreamOperationsIntegrationTests.pendingShouldReadMessageDetails:409 » RedisSystem Unknown redis exception
[ERROR] Run 15: DefaultStreamOperationsIntegrationTests.pendingShouldReadMessageDetails:409 » RedisSystem Unknown redis exception
[ERROR] Run 16: DefaultStreamOperationsIntegrationTests.pendingShouldReadMessageDetails:409 » RedisSystem Unknown redis exception
[ERROR] Run 17: DefaultStreamOperationsIntegrationTests.pendingShouldReadMessageDetails:409 » RedisSystem Unknown redis exception
[ERROR] Run 18: DefaultStreamOperationsIntegrationTests.pendingShouldReadMessageDetails:409 » RedisSystem Unknown redis exception And, finally: [ERROR] Tests run: 17174, Failures: 0, Errors: 13, Skipped: 444
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:57 min
[INFO] Finished at: 2023-09-18T11:41:39-07:00
[INFO] ------------------------------------------------------------------------ It seems if I solve the problem with either the SD Redis Pipelining, or the Transactional Integration Tests, I will solve the problem for the other (or be able to solve it in the same way) given the underlying problem is a I am currently trying to track the cause of these errors/failures down. |
The SD Redis org.springframework.data.redis.RedisSystemException: Unknown redis exception
at org.springframework.data.redis.FallbackExceptionTranslationStrategy.getFallback(FallbackExceptionTranslationStrategy.java:49)
at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:39)
at org.springframework.data.redis.connection.jedis.JedisClusterConnection.convertJedisAccessException(JedisClusterConnection.java:635)
at org.springframework.data.redis.connection.jedis.JedisClusterZSetCommands.convertJedisAccessException(JedisClusterZSetCommands.java:1166)
at org.springframework.data.redis.connection.jedis.JedisClusterZSetCommands.bZPopMax(JedisClusterZSetCommands.java:397)
at org.springframework.data.redis.connection.DefaultedRedisConnection.bZPopMax(DefaultedRedisConnection.java:1015)
at org.springframework.data.redis.connection.jedis.JedisClusterConnectionTests.bzPopMaxShouldWorkCorrectly(JedisClusterConnectionTests.java:2309)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.isEmpty()" because "l" is null
at redis.clients.jedis.BuilderFactory$37.build(BuilderFactory.java:616)
at redis.clients.jedis.BuilderFactory$37.build(BuilderFactory.java:611)
at redis.clients.jedis.Connection.executeCommand(Connection.java:142)
at redis.clients.jedis.executors.ClusterCommandExecutor.execute(ClusterCommandExecutor.java:139)
at redis.clients.jedis.executors.ClusterCommandExecutor.executeCommand(ClusterCommandExecutor.java:93)
at redis.clients.jedis.UnifiedJedis.executeCommand(UnifiedJedis.java:244)
at redis.clients.jedis.UnifiedJedis.bzpopmax(UnifiedJedis.java:2360)
at org.springframework.data.redis.connection.jedis.JedisClusterZSetCommands.bZPopMax(JedisClusterZSetCommands.java:395)
... 5 more Of course, this could caused by our test setup. |
The org.springframework.data.redis.RedisSystemException: Unknown redis exception
at org.springframework.data.redis.FallbackExceptionTranslationStrategy.getFallback(FallbackExceptionTranslationStrategy.java:49)
at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:39)
at org.springframework.data.redis.connection.jedis.JedisClusterConnection.convertJedisAccessException(JedisClusterConnection.java:635)
at org.springframework.data.redis.connection.jedis.JedisClusterZSetCommands.convertJedisAccessException(JedisClusterZSetCommands.java:1166)
at org.springframework.data.redis.connection.jedis.JedisClusterZSetCommands.bZPopMin(JedisClusterZSetCommands.java:356)
at org.springframework.data.redis.connection.DefaultedRedisConnection.bZPopMin(DefaultedRedisConnection.java:994)
at org.springframework.data.redis.connection.jedis.JedisClusterConnectionTests.bzPopMinShouldWorkCorrectly(JedisClusterConnectionTests.java:2282)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.isEmpty()" because "l" is null
at redis.clients.jedis.BuilderFactory$37.build(BuilderFactory.java:616)
at redis.clients.jedis.BuilderFactory$37.build(BuilderFactory.java:611)
at redis.clients.jedis.Connection.executeCommand(Connection.java:142)
at redis.clients.jedis.executors.ClusterCommandExecutor.execute(ClusterCommandExecutor.java:139)
at redis.clients.jedis.executors.ClusterCommandExecutor.executeCommand(ClusterCommandExecutor.java:93)
at redis.clients.jedis.UnifiedJedis.executeCommand(UnifiedJedis.java:244)
at redis.clients.jedis.UnifiedJedis.bzpopmin(UnifiedJedis.java:2365)
at org.springframework.data.redis.connection.jedis.JedisClusterZSetCommands.bZPopMin(JedisClusterZSetCommands.java:354)
... 5 more Upon closer inspection, it would simply seem that Jedis Therefore, you cannot attempt to "pop" anything from a sorted set when the set is empty.
This seems like a bug in Jedis |
… tests in JedisClusterConnectionTests. Jedis 5.0 changed the bzpopmax and bzpopmin Redis commands to no longer return an empty (Array)List internally when evaluating and popping from an empty sorted set. A NullPointerException will be thrown if either bzpopmax or bzpopmin commands are executd on an empty Redis sorted set in Jedis 5.0 (vs. Jedis 4.x): Caused by: java.lang.NullPointerException: Cannot invoke 'java.util.List.isEmpty()' because l is null: at redis.clients.jedis.BuilderFactory7.build(BuilderFactory.java:616) This seems like a bug in Jedis. It is safe to execute zcard(key) to return the cardinality of (number of elements in) the sorted set before the test executes, ensuring a clean, reliable run. Closes spring-projects#2612
…ests in JedisClusterConnectionTests. Jedis 5.0 changed the bzpopmax and bzpopmin Redis commands to no longer return an empty (Array)List internally when evaluating and popping from an empty sorted set. A NullPointerException will be thrown if either bzpopmax or bzpopmin commands are executd on an empty Redis sorted set in Jedis 5.0 (vs. Jedis 4.x): Caused by: java.lang.NullPointerException: Cannot invoke 'java.util.List.isEmpty()' because l is null: at redis.clients.jedis.BuilderFactory7.build(BuilderFactory.java:616) This seems like a bug in Jedis. It is safe to execute zcard(key) to return the cardinality of (number of elements in) the sorted set before the test executes, ensuring a clean, reliable run. Closes spring-projects#2612
…ests in JedisClusterConnectionTests. Jedis 5.0 changed the bzpopmax and bzpopmin Redis commands to no longer return an empty (Array)List internally when evaluating and popping from an empty sorted set. A NullPointerException will be thrown if either bzpopmax or bzpopmin commands are executd on an empty Redis sorted set in Jedis 5.0 (vs. Jedis 4.x): Caused by: java.lang.NullPointerException: Cannot invoke 'java.util.List.isEmpty()' because l is null: at redis.clients.jedis.BuilderFactory7.build(BuilderFactory.java:616) This seems like a bug in Jedis. It is safe to execute zcard(key) to return the cardinality of (number of elements in) the sorted set before the test executes, ensuring a clean, reliable run. Closes spring-projects#2612
Both the java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.util.Set (java.util.ArrayList and java.util.Set are in module java.base of loader 'bootstrap')
at org.springframework.data.redis.connection.convert.SetConverter.convert(SetConverter.java:34)
at org.springframework.data.redis.connection.DefaultStringRedisConnection.convertResults(DefaultStringRedisConnection.java:3084)
at org.springframework.data.redis.connection.DefaultStringRedisConnection.closePipeline(DefaultStringRedisConnection.java:2456)
at org.springframework.data.redis.connection.AbstractConnectionPipelineIntegrationTests.getResults(AbstractConnectionPipelineIntegrationTests.java:189)
at org.springframework.data.redis.connection.AbstractConnectionPipelineIntegrationTests.verifyResults(AbstractConnectionPipelineIntegrationTests.java:175)
at org.springframework.data.redis.connection.AbstractConnectionIntegrationTests.testZDiff(AbstractConnectionIntegrationTests.java:2039)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) Internally, when Jedis returns the "pipelined" (or transactional / "queued") results for the sorted set diff, interaction and union operations, it is returning an |
Previous versions had that kind of deviation as well. We then typically compensate for such differences via |
Refactor and cleanup compiler warnings. Organize source. Closes spring-projects#2612
…ctionIntegrationTests. Closes spring-projects#2612
It is technically more involved than that. When the Redis Pipeline is (finally) closed, the results are then converted, but are done so in the You can see an early solution I was working on yesterday in my cloned, alternative topic branch. Obviously, this fixes Jedis, but breaks Lettuce! Technically, this re-breaks the non-Pipelined, non-Transactional Jedis tests, too. So, even Jedis is inconsistent in it's return values, where sorted set operations are concerned, at least.
I also think part of the problem is that Spring Data Redis itself does not have a enough separation between Jedis and Lettuce, for example, I now need to reconsider where the changes need to (can) be applied to appease Jedis and not break Lettuce, which is a sure sign of a design issue in SDR. |
…ests in JedisClusterConnectionTests. Jedis 5.0 changed the bzpopmax and bzpopmin Redis commands to no longer return an empty (Array)List internally when evaluating and popping from an empty sorted set. A NullPointerException will be thrown if either bzpopmax or bzpopmin commands are executd on an empty Redis sorted set in Jedis 5.0 (vs. Jedis 4.x): Caused by: java.lang.NullPointerException: Cannot invoke 'java.util.List.isEmpty()' because l is null: at redis.clients.jedis.BuilderFactory7.build(BuilderFactory.java:616) This seems like a bug in Jedis. It is safe to execute zcard(key) to return the cardinality of (number of elements in) the sorted set before the test executes, ensuring a clean, reliable run. Closes spring-projects#2612
…ests in JedisClusterConnectionTests. Jedis 5.0 changed the bzpopmax and bzpopmin Redis commands to no longer return an empty (Array)List internally when evaluating and popping from an empty sorted set. A NullPointerException will be thrown if either bzpopmax or bzpopmin commands are executd on an empty Redis sorted set in Jedis 5.0 (vs. Jedis 4.x): Caused by: java.lang.NullPointerException: Cannot invoke 'java.util.List.isEmpty()' because l is null: at redis.clients.jedis.BuilderFactory7.build(BuilderFactory.java:616) This seems like a bug in Jedis. It is safe to execute zcard(key) to return the cardinality of (number of elements in) the sorted set before the test executes, ensuring a clean, reliable run. Closes spring-projects#2612
…ests in JedisClusterConnectionTests. Jedis 5.0 changed the bzpopmax and bzpopmin Redis commands to no longer return an empty (Array)List internally when evaluating and popping from an empty sorted set. A NullPointerException will be thrown if either bzpopmax or bzpopmin commands are executd on an empty Redis sorted set in Jedis 5.0 (vs. Jedis 4.x): Caused by: java.lang.NullPointerException: Cannot invoke 'java.util.List.isEmpty()' because l is null: at redis.clients.jedis.BuilderFactory7.build(BuilderFactory.java:616) This seems like a bug in Jedis. It is safe to execute zcard(key) to return the cardinality of (number of elements in) the sorted set before the test executes, ensuring a clean, reliable run. Closes spring-projects#2612
Alright! I have dwindled the Spring Data Redis build issues (compilation and tests) down to a single test case failure involving The org.springframework.data.redis.RedisSystemException: Unknown redis exception
at org.springframework.data.redis.FallbackExceptionTranslationStrategy.getFallback(FallbackExceptionTranslationStrategy.java:49)
at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:39)
at org.springframework.data.redis.connection.jedis.JedisClusterConnection.convertJedisAccessException(JedisClusterConnection.java:635)
at org.springframework.data.redis.connection.jedis.JedisClusterStreamCommands.convertJedisAccessException(JedisClusterStreamCommands.java:399)
at org.springframework.data.redis.connection.jedis.JedisClusterStreamCommands.xPending(JedisClusterStreamCommands.java:294)
at org.springframework.data.redis.connection.DefaultedRedisConnection.xPending(DefaultedRedisConnection.java:580)
at org.springframework.data.redis.connection.DefaultStringRedisConnection.xPending(DefaultStringRedisConnection.java:2993)
at org.springframework.data.redis.connection.RedisStreamCommands.xPending(RedisStreamCommands.java:707)
at org.springframework.data.redis.core.DefaultStreamOperations.lambda$pending$9(DefaultStreamOperations.java:205)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:406)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:373)
at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:97)
at org.springframework.data.redis.core.DefaultStreamOperations.pending(DefaultStreamOperations.java:205)
at org.springframework.data.redis.core.DefaultStreamOperationsIntegrationTests.pendingShouldReadMessageDetails(DefaultStreamOperationsIntegrationTests.java:410)
....
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at redis.clients.jedis.StreamEntryID.<init>(StreamEntryID.java:24)
at redis.clients.jedis.StreamEntryID.<init>(StreamEntryID.java:19)
at org.springframework.data.redis.connection.jedis.JedisClusterStreamCommands.xPending(JedisClusterStreamCommands.java:283)
... 64 more
|
…ests in JedisClusterConnectionTests. Jedis 5.0 changed the bzpopmax and bzpopmin Redis commands to no longer return an empty (Array)List internally when evaluating and popping from an empty sorted set. A NullPointerException will be thrown if either bzpopmax or bzpopmin commands are executd on an empty Redis sorted set in Jedis 5.0 (vs. Jedis 4.x): Caused by: java.lang.NullPointerException: Cannot invoke 'java.util.List.isEmpty()' because l is null: at redis.clients.jedis.BuilderFactory7.build(BuilderFactory.java:616) This seems like a bug in Jedis. It is safe to execute zcard(key) to return the cardinality of (number of elements in) the sorted set before the test executes, ensuring a clean, reliable run. Closes spring-projects#2612
…ests in JedisClusterConnectionTests. Jedis 5.0 changed the bzpopmax and bzpopmin Redis commands to no longer return an empty (Array)List internally when evaluating and popping from an empty sorted set. A NullPointerException will be thrown if either bzpopmax or bzpopmin commands are executd on an empty Redis sorted set in Jedis 5.0 (vs. Jedis 4.x): Caused by: java.lang.NullPointerException: Cannot invoke 'java.util.List.isEmpty()' because l is null: at redis.clients.jedis.BuilderFactory7.build(BuilderFactory.java:616) This seems like a bug in Jedis. It is safe to execute zcard(key) to return the cardinality of (number of elements in) the sorted set before the test executes, ensuring a clean, reliable run. Closes spring-projects#2612
Spring Data Redis to Jedis |
…ests in JedisClusterConnectionTests. Jedis 5.0 changed the bzpopmax and bzpopmin Redis commands to no longer return an empty (Array)List internally when evaluating and popping from an empty sorted set. A NullPointerException will be thrown if either bzpopmax or bzpopmin commands are executd on an empty Redis sorted set in Jedis 5.0 (vs. Jedis 4.x): Caused by: java.lang.NullPointerException: Cannot invoke 'java.util.List.isEmpty()' because l is null: at redis.clients.jedis.BuilderFactory7.build(BuilderFactory.java:616) This seems like a bug in Jedis. It is safe to execute zcard(key) to return the cardinality of (number of elements in) the sorted set before the test executes, ensuring a clean, reliable run. Closes spring-projects#2612
…ests in JedisClusterConnectionTests. Jedis 5.0 changed the bzpopmax and bzpopmin Redis commands to no longer return an empty (Array)List internally when evaluating and popping from an empty sorted set. A NullPointerException will be thrown if either bzpopmax or bzpopmin commands are executd on an empty Redis sorted set in Jedis 5.0 (vs. Jedis 4.x): Caused by: java.lang.NullPointerException: Cannot invoke 'java.util.List.isEmpty()' because l is null: at redis.clients.jedis.BuilderFactory7.build(BuilderFactory.java:616) This seems like a bug in Jedis. It is safe to execute zcard(key) to return the cardinality of (number of elements in) the sorted set before the test executes, ensuring a clean, reliable run. Closes spring-projects#2612
Upgrading to Jedis |
Closes spring-projects#2612 Original pull request: spring-projects#2716
Jedis 5 already released its 2nd beta so we could follow along on current main line till the GA is out.
The text was updated successfully, but these errors were encountered: