Skip to content

Conversation

crepererum
Copy link
Collaborator

Under certain conditions it MAY happen that metadata cache invalidation races, e.g.:

Thread 1 Thread 2
get metadata
get metadata
invalidate
get metadata
invalidate

Here the 2nd invalidation is unnecessary. It's not a correctness issue, but we throw away cached data that is perfectly fine.

To work around this, we now track a "generation" for data that we get from the metadata cache and check this during invalidation requests.

Ref #62. (not closing, need to do the same for the broker connection cache)

Under certain conditions it MAY happen that metadata cache invalidation
races, e.g.:

| Thread 1     | Thread 2     |
| ------------ | ------------ |
| get metadata |              |
|              | get metadata |
| invalidate   |              |
| get metadata |              |
|              | invalidate   |

Here the 2nd invalidation is unnecessary. It's not a correctness issue,
but we throw away cached data that is perfectly fine.

To work around this, we now track a "generation" for data that we get
from the metadata cache and check this during invalidation requests.

Ref #62. (not closing, need to do the same for the broker connection
cache)
Copy link
Contributor

@domodwyer domodwyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@crepererum crepererum added the automerge Instruct kodiak to merge the PR label Oct 28, 2022
@kodiakhq kodiakhq bot merged commit 821c23b into main Oct 28, 2022
@kodiakhq kodiakhq bot deleted the crepererum/issue62a branch October 28, 2022 09:20
crepererum added a commit that referenced this pull request Oct 28, 2022
crepererum added a commit that referenced this pull request Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Instruct kodiak to merge the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants