Skip to content
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

Race condition when using secondary index #2

Open
RokLenarcic opened this issue Jul 27, 2023 · 0 comments
Open

Race condition when using secondary index #2

RokLenarcic opened this issue Jul 27, 2023 · 0 comments

Comments

@RokLenarcic
Copy link
Owner

Problem

The order of operations when loading a value is such:

  • promise is added for key
  • value is calculated
  • keys are added to secondary index

This opens up a race condition, where if someone is to invalidate by tag ID of the entry after it's been added to cache, but before it's been added to secondary index, the entry will not be removed because it's not present in secondary cache yet.

It is questionable how important is this invalidation miss. It is not possible to know before calculating the value if secondary index will be used.

Approaches

We would need some sort of recent tag invalidations check, which would be consulted to drop cached value as it's loaded.

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

No branches or pull requests

1 participant