spring-projects / spring-projects/spring-data-redis

Null Elements Returned By CrudRepository.findAll() for Expired Keys [DATAREDIS-570]

Open
#1,145 18 comments 7 reactions 1 assignee View on GitHub

@christophstrobl is already working on this.

Since Dec 30, 2020.

in: repository type: bug
Dominant language
Java
Stars
1.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Brian Marcey opened DATAREDIS-570 and commented

The Redis documentation states that "if a key expires while the application is down the expiry event will not be processed which may lead to secondary indexes containing still references to the expired object."

I would expect this behavior and have indeed seen it while testing my code.

However, I have also noticed that if I restart my application after the above scenario occurs,
CrudRepostitory.findAll() will return a null value for each of the orphaned Ids. I didn't expect that and I can work around it, but it would be nice if SDR could detect this condition and not even include them in the returned Iterable. Note that CrudRepository.count() also returns an incorrect value under this scenario.

I can include more information if the above is not clear. Thank you!


Affects: 1.7.4 (Hopper SR4)

6 votes, 8 watchers

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.