fix: check if entry is in indexer first before remove for deposit #547
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's changed and what's your intention?
Previously, when a deposit entry is released after no external reference, it will remove the key from the indexer without checking if the entry is still in it. When there is another insertion with the same key between a deposit entry is inserted and released, this behavior will mistakenly delete the new version of the key from the indexer. Then the new entry is not in the indexer but maybe in the eviction container, which breaks the assumptions and cause panic.
To reproduce:
Checklist
make all
(ormake fast
instead if the old tests are not modified) in my local environment.Related issues or PRs (optional)
fix #531
fix #525
risingwavelabs/risingwave#16869