-
Notifications
You must be signed in to change notification settings - Fork 131
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 iter may not be Released in some cases #722
Conversation
/run-all-tests |
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
A not release iter
will not affect compaction, but the files it references will not be deleted even it's compacted. Because the iter creates a snapshot to get a consistent view of data, once it's released and the reference count of the file drop to be 0 the file will be delete.
Besides goleveldb use runtime.SetFinalizer
to make sure the Release()
will be called...so even in the error case it will be Release
finally.
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
@suzaku PTAL |
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.
Rest LGTM.
Co-Authored-By: satoru <satorulogic@gmail.com>
/run-all-tests |
/run-all-tests |
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
What problem does this PR solve?
When error happened in loop, iter may not be released. And when
l0Num >= l0Trigger
, we better release the iter, it may be affect compaction operation.What is changed and how it works?
Check List
Tests
Code changes
Side effects
Related changes
tidb-ansible
repository