-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix: ethhashlookup: clean-up query management and lifecycle #12235
Conversation
Running master along with #12236, my WAL is a reasonable size now. |
d43f6b4
to
acdc069
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - (some comments around leaving the responsibility of finishing DB operations before calling Close to the caller)
@rvagg Did this really reduce the size of your WAL ? How does that work ? IIUC, the only positive impact here should be reduced heap usage because of not leaking prepared statements anymore. |
@rvagg Just confirming that this was fixed and not rerun: |
Yes, fixed by changing the ordering of |
acdc069
to
66a0ccc
Compare
Closes: #12171
Prompted because I'm noticing that my WAL for both calibnet and mainnet nodes is ~32M, even with my calibnet node running master which has #12098 which should result in it being compacted earlier than that (suggests that queries may be remaining open?).
The main thing that stands out in this file is the use of the preparedstatement that's prepared each time it's used, and not closed. So that's what's probably retaining memory and perhaps it's also responsible for the WAL size (I'm not sure how though tbh).
This refactor makes all queries use preparedstatements that persist for the lifecycle of the index, so we get the efficiency gains from that.