-
Notifications
You must be signed in to change notification settings - Fork 122
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 memory leak of pfs keys #444
Open
prohaska7
wants to merge
12
commits into
percona:master
Choose a base branch
from
prohaska7:apr2020-leak-pfs-keys
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tokuft test version. rename tokuft test version to avoid conflict.
…parameter instead.
… permissions were changed in commit 5aca29f.
bug when the lock memory use is over the limit. The ydb tests show that DB->put normally returns TOKUDB_OUT_OF_LOCKS when the lock memory use is over the limit.
retry occurs and the lock memory use is over the limit, then pending lock requests should be completed with TOKUDB_OUT_OF_LOCKS result. The current code does not handle this case and crashes. This commit fixes this case and is sufficient to fix PS-4328.
and drd scheduler with fairness (--fair-sched=try). This should reduce execution time from minutes to seconds.
should intentially abort instead.
…anitizer. This allows the tests to run.
It causes helgrind to report false positive data races on tests, specifically the helgrind_helgrind tests. 4101: ==17113== Possible data race during read of size 1 at 0x52FA980 by thread #1 4101: ==17113== Locks held: 1, at address 0x4C126C0 4101: ==17113== at 0x483E99C: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) 4101: ==17113== by 0x483EC4A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) 4101: ==17113== by 0x4A95654: toku_mutex_destroy(toku_mutex_t*) (toku_pthread.h:427) 4101: ==17113== by 0x4B6CF5C: bjm_destroy(background_job_manager_struct*) (background_job_manager.cc:67) 4101: ==17113== by 0x4ABE119: write_dirty_pairs_for_close(cachetable*, cachefile*) (cachetable.cc:2406) 4101: ==17113== by 0x4ABE308: cachetable_flush_cachefile(cachetable*, cachefile*, bool) (cachetable.cc:2493) 4101: ==17113== by 0x4AB99BE: toku_cachefile_close(cachefile**, bool, __toku_lsn) (cachetable.cc:529) 4101: ==17113== by 0x4ACD7C2: toku_ft_evict_from_memory(ft*, bool, __toku_lsn) (ft.cc:499) 4101: ==17113== by 0x4ACEADD: toku_ft_remove_reference(ft*, bool, __toku_lsn, void (*)(ft*, void*), void*) (ft.cc:949) 4101: ==17113== by 0x4AE9B21: ft_handle_close(ft_handle*, bool, __toku_lsn) (ft-ops.cc:3272) 4101: ==17113== by 0x4AE9B54: toku_ft_handle_close(ft_handle*) (ft-ops.cc:3280) 4101: ==17113== by 0x4A8CD68: toku_db_close(__toku_db*) (ydb_db.cc:212) 4101: ==17113== 4101: ==17113== This conflicts with a previous write of size 4 by thread #10 4101: ==17113== Locks held: none 4101: ==17113== at 0x4C557A1: __pthread_mutex_unlock_usercnt (pthread_mutex_unlock.c:51) 4101: ==17113== by 0x4C557A1: pthread_mutex_unlock (pthread_mutex_unlock.c:357) 4101: ==17113== by 0x483F458: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) 4101: ==17113== by 0x4A84508: toku_mutex_unlock(toku_mutex_t*) (toku_pthread.h:256) 4101: ==17113== by 0x4B6D0EC: bjm_remove_background_job(background_job_manager_struct*) (background_job_manager.cc:98) 4101: ==17113== by 0x4ABDCDD: cachetable_flush_pair_for_close(void*) (cachetable.cc:2327) 4101: ==17113== by 0x4B7D785: work_on_kibbutz(void*) (kibbutz.cc:154) 4101: ==17113== by 0x4841B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) 4101: ==17113== by 0x4C51668: start_thread (pthread_create.c:479)
… destroy functions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Valgrind finds memory leaks of pfs keys for some ydb tests. These tests create an environment, manipulate it, and close it. These tests do not open the environment. The bug is that the flag that controls the toku_ydb_destroy function is only set true if the environment is opened. The flag should be set in the toku_ydb_init function.
Reproduce:
ctest -R ydb/test_cachesize -D ExperimentalMemCheck
Tools:
Ubuntu 19.10, Clang 7,8,9, Gcc 7,8,9, Cmake 3.14
Copyright (c) 2020, Rik Prohaska
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.