-
Notifications
You must be signed in to change notification settings - Fork 1.2k
DATAREDIS-1955 - Phantom copy is not persisted when entity ttl is changed from positive to negative, causing phantom copy not updated to no expire and counting down, then RedisKeyExpiredEvent publishing #1961
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
…nged from positive to negative, causing phantom copy not updated to no expire and counting down, then RedisKeyExpiredEvent publishing When updating an object that has a positive time to live to a negative time to live you must persist the phantom key. Otherwise, after expiring time to live of the phantom, which was created when object with a positive time to live was saved - the indices are dropped and the keys are deleted from the sets as if entity is expired.
@muchnik thanks for the PR! |
… partial update, when phantom key is not needed - it now deletes instead of persisting.
Nice idea, updated PR! |
This commit makes sure to clean up resources when a previously expiring entity is persisted by setting the time to live to zero or negative. In case a phantom copy exists for the changed entity, it is removed to free space on the server and prevent expiration events from being sent. See #1955 Original Pull Request: #1961 # Conflicts: # src/test/java/org/springframework/data/redis/core/RedisKeyValueAdapterTests.java
Introduce helper method to unify expiry check and simplify control flow. Original Pull Request: #1961
This commit makes sure to clean up resources when a previously expiring entity is persisted by setting the time to live to zero or negative. In case a phantom copy exists for the changed entity, it is removed to free space on the server and prevent expiration events from being sent. See #1955 Original Pull Request: #1961
Introduce helper method to unify expiry check and simplify control flow. Original Pull Request: #1961
This commit makes sure to clean up resources when a previously expiring entity is persisted by setting the time to live to zero or negative. In case a phantom copy exists for the changed entity, it is removed to free space on the server and prevent expiration events from being sent. Closes #1955 Original Pull Request: #1961
Introduce helper method to unify expiry check and simplify control flow. Original Pull Request: #1961
Thanks @muchnik! Merged to main branch and back ported to 2.3.x and 2.4.x. |
DATAREDIS-1955 - Phantom copy is not persisted when entity ttl is changed from positive to negative, causing phantom copy not updated to no expire and counting down, then RedisKeyExpiredEvent publishing.
When updating an object that has a positive time to live to a negative time to live you must persist the phantom key.
Otherwise, after expiring time to live of the phantom, which was created when object with a positive time to live was saved - the indices are dropped and the keys are deleted from the sets as if entity is expired.