Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

rangeWithScores methods returning not null in transactions #3225

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

Conversation

@LeeHyungGeol
Copy link
Contributor

@LeeHyungGeol LeeHyungGeol commented Sep 27, 2025

Fix. #3187

Summary

Add missing RedisCommand enum entries for ZSet WithScores methods.

The rangeWithScores family of methods (zRangeWithScores, zRangeByScoreWithScores, zRevRangeWithScores, zRevRangeByScoreWithScores) were missing from the RedisCommand enumeration, causing ConnectionSplittingInterceptor to resolve them as UNKNOWN commands.

This resulted in read-only methods being incorrectly queued in MULTI/EXEC blocks instead of executing immediately on separate connections, causing them to return null in transactional contexts.

Changes:

  • Add ZRANGEWITHSCORES, ZRANGEBYSCOREWITHSCORES, ZREVRANGEWITHSCORES, ZREVRANGEBYSCOREWITHSCORES enum entries in RedisCommand.java
  • Add regression test in TransactionalStringRedisTemplateTests.java

The fix ensures these read-only methods are properly recognized and execute
immediately in transactional contexts.

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

@LeeHyungGeol LeeHyungGeol force-pushed the fix/rangeWithScores-unknown-command-in-transaction branch from 8db154f to 7022c14 Compare September 27, 2025 10:42
...ANGEWITHSCORES, ZRANGEBYSCOREWITHSCORES, ZREVRANGEWITHSCORES, ZREVRANGEBYSCOREWITHSCORES
Signed-off-by: LeeHyungGeol <rjf1138@naver.com>
...dd author tags in the class header
Signed-off-by: LeeHyungGeol <rjf1138@naver.com>
...methods
Signed-off-by: LeeHyungGeol <rjf1138@naver.com>
@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 29, 2025
onobc pushed a commit that referenced this pull request Sep 30, 2025
The rangeWithScores family of methods (zRangeWithScores, zRangeByScoreWithScores, zRevRangeWithScores, zRevRangeByScoreWithScores) were missing from the RedisCommand enumeration, causing ConnectionSplittingInterceptor to resolve them as UNKNOWN commands.
This resulted in read-only methods being incorrectly queued in MULTI/EXEC blocks instead of executing immediately on separate connections, causing them to return null in transactional contexts.
This commit adds the ZRANGEWITHSCORES, ZRANGEBYSCOREWITHSCORES, ZREVRANGEWITHSCORES, ZREVRANGEBYSCOREWITHSCORES enum entries to RedisCommand.java as well as adds a regression test in TransactionalStringRedisTemplateTests.java.
The fix ensures these read-only methods are properly recognized and execute immediately in transactional contexts.
Original Pull Request: #3225
Fixes: #3187
Signed-off-by: LeeHyungGeol <rjf1138@naver.com>
Copy link
Contributor

onobc commented Sep 30, 2025

Thank you @LeeHyungGeol for the excellent contribution! I added a tiny polish commit to refactor out the verification method in the regression test (here).

Closing in favor of 96f250d

LeeHyungGeol reacted with thumbs up emoji

@onobc onobc closed this Sep 30, 2025
@onobc onobc added this to the 3.4.11 (2024年1月11日) milestone Sep 30, 2025
onobc added a commit that referenced this pull request Sep 30, 2025
...hods"
Adds convenience method to verify results in the newly added regression test in the previous commit.
Also removes a few warnings in the regression test by suppressing 'rawtypes' and 'unchecked' usages.
Original Pull Request: #3225
Related tickets: #3187
Signed-off-by: onobc <chris.bono@gmail.com>
onobc added a commit that referenced this pull request Sep 30, 2025
The rangeWithScores family of methods (zRangeWithScores, zRangeByScoreWithScores, zRevRangeWithScores, zRevRangeByScoreWithScores) were missing from the RedisCommand enumeration, causing ConnectionSplittingInterceptor to resolve them as UNKNOWN commands.
This resulted in read-only methods being incorrectly queued in MULTI/EXEC blocks instead of executing immediately on separate connections, causing them to return null in transactional contexts.
This commit adds the ZRANGEWITHSCORES, ZRANGEBYSCOREWITHSCORES, ZREVRANGEWITHSCORES, ZREVRANGEBYSCOREWITHSCORES enum entries to RedisCommand.java.
The fix ensures these read-only methods are properly recognized and execute immediately in transactional contexts.
Original Pull Request: #3225
Fixes: #3187
Signed-off-by: LeeHyungGeol <rjf1138@naver.com>
(cherry picked from commit 96f250d)
Signed-off-by: Chris Bono <chris.bono@broadcom.com>
onobc added a commit that referenced this pull request Sep 30, 2025
The rangeWithScores family of methods (zRangeWithScores, zRangeByScoreWithScores, zRevRangeWithScores, zRevRangeByScoreWithScores) were missing from the RedisCommand enumeration, causing ConnectionSplittingInterceptor to resolve them as UNKNOWN commands.
This resulted in read-only methods being incorrectly queued in MULTI/EXEC blocks instead of executing immediately on separate connections, causing them to return null in transactional contexts.
This commit adds the ZRANGEWITHSCORES, ZRANGEBYSCOREWITHSCORES, ZREVRANGEWITHSCORES, ZREVRANGEBYSCOREWITHSCORES enum entries to RedisCommand.java.
The fix ensures these read-only methods are properly recognized and execute immediately in transactional contexts.
Original Pull Request: #3225
Fixes: #3187
Signed-off-by: LeeHyungGeol <rjf1138@naver.com>
(cherry picked from commit 96f250d)
Signed-off-by: Chris Bono <chris.bono@broadcom.com>
onobc added a commit that referenced this pull request Sep 30, 2025
...hods"
Adds convenience method to verify results in the newly added regression test in the previous commit.
Also removes a few warnings in the regression test by suppressing 'rawtypes' and 'unchecked' usages.
Original Pull Request: #3225
Related tickets: #3187
Signed-off-by: Chris Bono <chris.bono@broadcom.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@onobc onobc Awaiting requested review from onobc

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rangeWithScores() resolves to RedisCommand.UNKNOWN inside transaction

AltStyle によって変換されたページ (->オリジナル) /