Skip to content

DATAREDIS-988 - Consider transaction participation when releasing connections. #453

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 3 commits into from

Conversation

mp911de
Copy link
Member

@mp911de mp911de commented Jun 3, 2019

We now check on connection release whether a connection is in MULTI state. If so, then we discard (rollback) the transaction to reset the connection to a fresh state.

We now consider RedisTemplate's enableTransactionSupport configuration when releasing connections. Previously, we released bound connections when being in a read-only transaction regardless of the configuration in RedisTemplate. This broke session callbacks that expected to remain on the same connection all but the first command were executed on a different connection.

Releasing a connection now no longer unbinds a connection if transaction support is disabled.


Related ticket: DATAREDIS-988.
Should be forward-ported.

mp911de added 3 commits June 3, 2019 10:20
We now check on connection release whether a connection is in MULTI state. If so, then we discard (rollback) the transaction to reset the connection to a fresh state.
…nections.

We now consider RedisTemplate's enableTransactionSupport configuration when releasing connections. Previously, we released bound connections when being in a read-only transaction regardless the configuration in RedisTemplate. This broke session callbacks that expected to remain on the same connection all but the first command were executed on a different connection.

Releasing a connection now no longer unbinds a connection if transaction support is disabled.
@quaff
Copy link
Contributor

quaff commented Jun 6, 2019

Failed tests: 
  LettuceReactiveRedisConnectionUnitTests.multipleCallsInProgressShouldConnectOnlyOnce:171 
Wanted but not invoked:
connectionProvider.getConnection(
    interface io.lettuce.core.api.StatefulConnection
);
-> at org.springframework.data.redis.connection.lettuce.LettuceReactiveRedisConnectionUnitTests.multipleCallsInProgressShouldConnectOnlyOnce(LettuceReactiveRedisConnectionUnitTests.java:171)
Actually, there were zero interactions with this mock.

@quaff
Copy link
Contributor

quaff commented Jun 13, 2019

ping

christophstrobl pushed a commit that referenced this pull request Jul 3, 2019
We now check on connection release whether a connection is in MULTI state. If so, then we discard (rollback) the transaction to reset the connection to a fresh state.

Original Pull Request: #453
christophstrobl pushed a commit that referenced this pull request Jul 3, 2019
…nections.

We now consider RedisTemplate's enableTransactionSupport configuration when releasing connections. Previously, we released bound connections when being in a read-only transaction regardless the configuration in RedisTemplate. This broke session callbacks that expected to remain on the same connection all but the first command were executed on a different connection.

Releasing a connection now no longer unbinds a connection if transaction support is disabled.

Original Pull Request: #453
christophstrobl added a commit that referenced this pull request Jul 3, 2019
Original Pull Request: #453
christophstrobl pushed a commit that referenced this pull request Jul 3, 2019
We now check on connection release whether a connection is in MULTI state. If so, then we discard (rollback) the transaction to reset the connection to a fresh state.

Original Pull Request: #453
christophstrobl pushed a commit that referenced this pull request Jul 3, 2019
…nections.

We now consider RedisTemplate's enableTransactionSupport configuration when releasing connections. Previously, we released bound connections when being in a read-only transaction regardless the configuration in RedisTemplate. This broke session callbacks that expected to remain on the same connection all but the first command were executed on a different connection.

Releasing a connection now no longer unbinds a connection if transaction support is disabled.

Original Pull Request: #453
christophstrobl added a commit that referenced this pull request Jul 3, 2019
Original Pull Request: #453
@christophstrobl christophstrobl deleted the issue/2.1.x/DATAREDIS-988 branch July 3, 2019 07:31
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.

3 participants