Skip to content

core/filtermaps: fix range delete deadlock #31704

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

Closed

Conversation

zsfelfoldi
Copy link
Contributor

This PR fixes a deadlock situation is deleteTailEpoch that might arise when range delete is running in iterator based fallback mode (either using leveldb database or the hashdb state storage scheme). In this case a stopCb callback is called periodically that does check events, including matcher sync requests, in which case it tries to acquire indexLock for write access, while deleteTailEpoch already held it for read access. This callback is called in every other case with indexLock unlocked so this PR unlocks it while the actual data removal is happening. Marking the old map range unindexed happens before the actual deletion and happens undex indexLock. Marking the epoch either clean or dirty depending on whether the deletion is finished is again happening while the lock is being held.

Fixes #31700

@zsfelfoldi
Copy link
Contributor Author

Replaced by #31708

@zsfelfoldi zsfelfoldi closed this Apr 25, 2025
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

Successfully merging this pull request may close these issues.

deadlock issue of v1.15.6 on eth_getLogs for filter & thus shutdown corruption
1 participant