Skip to content
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 some fail cases when enable TASN #5086

Merged
merged 6 commits into from
Jun 9, 2022
Merged

Conversation

jiaqizho
Copy link
Contributor

@jiaqizho jiaqizho commented Jun 8, 2022

What problem does this PR solve?

Issue Number: close #5085

Problem Summary:

[2022-06-07T18:08:51.401Z] ==================
[2022-06-07T18:08:51.401Z] WARNING: ThreadSanitizer: data race (pid=36394)
[2022-06-07T18:08:51.401Z]   Read of size 8 at 0x000011762fb8 by thread T26:
[2022-06-07T18:08:51.401Z]     #0 DB::DM::StoragePool::newDataPageIdForDTFile(DB::StableDiskDelegator&, char const*) /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/DeltaMerge/StoragePool.cpp:626:9 (gtests_dbms+0xc57ce94)
[2022-06-07T18:08:51.401Z]     #1 DB::DM::createNewStable(DB::DM::DMContext&, std::__1::shared_ptr<std::__1::vector<DB::DM::ColumnDefine, std::__1::allocator<DB::DM::ColumnDefine> > > const&, std::__1::shared_ptr<DB::IBlockInputStream> const&, unsigned long, DB::DM::WriteBatches&) /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/DeltaMerge/Segment.cpp:163:45 (gtests_dbms+0xc51d687)
[2022-06-07T18:08:51.401Z]     #2 DB::DM::Segment::prepareSplitPhysical(DB::DM::DMContext&, std::__1::shared_ptr<std::__1::vector<DB::DM::ColumnDefine, std::__1::allocator<DB::DM::ColumnDefine> > > const&, std::__1::shared_ptr<DB::DM::SegmentSnapshot> const&, DB::DM::WriteBatches&) const /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/DeltaMerge/Segment.cpp:1031:25 (gtests_dbms+0xc52d9de)
[2022-06-07T18:08:51.401Z]     #3 DB::DM::Segment::prepareSplit(DB::DM::DMContext&, std::__1::shared_ptr<std::__1::vector<DB::DM::ColumnDefine, std::__1::allocator<DB::DM::ColumnDefine> > > const&, std::__1::shared_ptr<DB::DM::SegmentSnapshot> const&, DB::DM::WriteBatches&) const /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/DeltaMerge/Segment.cpp:872:16 (gtests_dbms+0xc526476)
[2022-06-07T18:08:51.402Z]     #4 DB::DM::DeltaMergeStore::segmentSplit(DB::DM::DMContext&, std::__1::shared_ptr<DB::DM::Segment> const&, bool) /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp:1895:36 (gtests_dbms+0xc4e9850)
[2022-06-07T18:08:51.402Z]     #5 DB::DM::DeltaMergeStore::handleBackgroundTask(bool) /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp:1590:37 (gtests_dbms+0xc4e80bf)
[2022-06-07T18:08:51.402Z]     #6 DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65::operator()() const /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp:345:90 (gtests_dbms+0xc4f6cb8)
[2022-06-07T18:08:51.402Z]     #7 decltype(static_cast<DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65&>(fp)()) std::__1::__invoke<DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65&>(DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65&) /usr/local/bin/../include/c++/v1/type_traits:3918:1 (gtests_dbms+0xc4f6cb8)
[2022-06-07T18:08:51.402Z]     #8 bool std::__1::__invoke_void_return_wrapper<bool, false>::__call<DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65&>(DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65&) /usr/local/bin/../include/c++/v1/__functional/invoke.h:30:16 (gtests_dbms+0xc4f6cb8)
[2022-06-07T18:08:51.402Z]     #9 std::__1::__function::__alloc_func<DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65, std::__1::allocator<DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65>, bool ()>::operator()() /usr/local/bin/../include/c++/v1/__functional/function.h:171:16 (gtests_dbms+0xc4f6cb8)
[2022-06-07T18:08:51.402Z]     #10 std::__1::__function::__func<DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65, std::__1::allocator<DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65>, bool ()>::operator()() /usr/local/bin/../include/c++/v1/__functional/function.h:345:12 (gtests_dbms+0xc4f6cb8)
[2022-06-07T18:08:51.402Z]     #11 std::__1::__function::__value_func<bool ()>::operator()() const /usr/local/bin/../include/c++/v1/__functional/function.h:498:16 (gtests_dbms+0xc3c6c4a)
[2022-06-07T18:08:51.402Z]     #12 std::__1::function<bool ()>::operator()() const /usr/local/bin/../include/c++/v1/__functional/function.h:1175:12 (gtests_dbms+0xc3c6c4a)
[2022-06-07T18:08:51.402Z]     #13 DB::BackgroundProcessingPool::threadFunction() /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/BackgroundProcessingPool.cpp:233:33 (gtests_dbms+0xc3c6c4a)
[2022-06-07T18:08:51.402Z]     #14 DB::BackgroundProcessingPool::BackgroundProcessingPool(int)::$_2::operator()() const /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/BackgroundProcessingPool.cpp:94:39 (gtests_dbms+0xc3c77f0)
[2022-06-07T18:08:51.402Z]     #15 decltype(static_cast<DB::BackgroundProcessingPool::BackgroundProcessingPool(int)::$_2>(fp)()) std::__1::__invoke<DB::BackgroundProcessingPool::BackgroundProcessingPool(int)::$_2>(DB::BackgroundProcessingPool::BackgroundProcessingPool(int)::$_2&&) /usr/local/bin/../include/c++/v1/type_traits:3918:1 (gtests_dbms+0xc3c77f0)
[2022-06-07T18:08:51.402Z]     #16 void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, DB::BackgroundProcessingPool::BackgroundProcessingPool(int)::$_2>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, DB::BackgroundProcessingPool::BackgroundProcessingPool(int)::$_2>&, std::__1::__tuple_indices<>) /usr/local/bin/../include/c++/v1/thread:280:5 (gtests_dbms+0xc3c77f0)
[2022-06-07T18:08:51.402Z]     #17 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, DB::BackgroundProcessingPool::BackgroundProcessingPool(int)::$_2> >(void*) /usr/local/bin/../include/c++/v1/thread:291:5 (gtests_dbms+0xc3c77f0)
[2022-06-07T18:08:51.402Z] 
[2022-06-07T18:08:51.402Z]   Previous write of size 8 at 0x000011762fb8 by thread T19:
[2022-06-07T18:08:51.402Z]     #0 DB::DM::StoragePool::newDataPageIdForDTFile(DB::StableDiskDelegator&, char const*) /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/DeltaMerge/StoragePool.cpp:626:9 (gtests_dbms+0xc57cee9)
[2022-06-07T18:08:51.402Z]     #1 DB::DM::createNewStable(DB::DM::DMContext&, std::__1::shared_ptr<std::__1::vector<DB::DM::ColumnDefine, std::__1::allocator<DB::DM::ColumnDefine> > > const&, std::__1::shared_ptr<DB::IBlockInputStream> const&, unsigned long, DB::DM::WriteBatches&) /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/DeltaMerge/Segment.cpp:163:45 (gtests_dbms+0xc51d687)
[2022-06-07T18:08:51.402Z]     #2 DB::DM::Segment::prepareSplitPhysical(DB::DM::DMContext&, std::__1::shared_ptr<std::__1::vector<DB::DM::ColumnDefine, std::__1::allocator<DB::DM::ColumnDefine> > > const&, std::__1::shared_ptr<DB::DM::SegmentSnapshot> const&, DB::DM::WriteBatches&) const /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/DeltaMerge/Segment.cpp:1031:25 (gtests_dbms+0xc52d9de)
[2022-06-07T18:08:51.403Z]     #3 DB::DM::Segment::prepareSplit(DB::DM::DMContext&, std::__1::shared_ptr<std::__1::vector<DB::DM::ColumnDefine, std::__1::allocator<DB::DM::ColumnDefine> > > const&, std::__1::shared_ptr<DB::DM::SegmentSnapshot> const&, DB::DM::WriteBatches&) const /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/DeltaMerge/Segment.cpp:872:16 (gtests_dbms+0xc526476)
[2022-06-07T18:08:51.403Z]     #4 DB::DM::DeltaMergeStore::segmentSplit(DB::DM::DMContext&, std::__1::shared_ptr<DB::DM::Segment> const&, bool) /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp:1895:36 (gtests_dbms+0xc4e9850)
[2022-06-07T18:08:51.403Z]     #5 DB::DM::DeltaMergeStore::handleBackgroundTask(bool) /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp:1590:37 (gtests_dbms+0xc4e80bf)
[2022-06-07T18:08:51.403Z]     #6 DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65::operator()() const /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp:345:90 (gtests_dbms+0xc4f6cb8)
[2022-06-07T18:08:51.403Z]     #7 decltype(static_cast<DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65&>(fp)()) std::__1::__invoke<DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65&>(DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65&) /usr/local/bin/../include/c++/v1/type_traits:3918:1 (gtests_dbms+0xc4f6cb8)
[2022-06-07T18:08:51.403Z]     #8 bool std::__1::__invoke_void_return_wrapper<bool, false>::__call<DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65&>(DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65&) /usr/local/bin/../include/c++/v1/__functional/invoke.h:30:16 (gtests_dbms+0xc4f6cb8)
[2022-06-07T18:08:51.403Z]     #9 std::__1::__function::__alloc_func<DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65, std::__1::allocator<DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65>, bool ()>::operator()() /usr/local/bin/../include/c++/v1/__functional/function.h:171:16 (gtests_dbms+0xc4f6cb8)
[2022-06-07T18:08:51.403Z]     #10 std::__1::__function::__func<DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65, std::__1::allocator<DB::DM::DeltaMergeStore::setUpBackgroundTask(std::__1::shared_ptr<DB::DM::DMContext> const&)::$_65>, bool ()>::operator()() /usr/local/bin/../include/c++/v1/__functional/function.h:345:12 (gtests_dbms+0xc4f6cb8)
[2022-06-07T18:08:51.403Z]     #11 std::__1::__function::__value_func<bool ()>::operator()() const /usr/local/bin/../include/c++/v1/__functional/function.h:498:16 (gtests_dbms+0xc3c6c4a)
[2022-06-07T18:08:51.403Z]     #12 std::__1::function<bool ()>::operator()() const /usr/local/bin/../include/c++/v1/__functional/function.h:1175:12 (gtests_dbms+0xc3c6c4a)
[2022-06-07T18:08:51.403Z]     #13 DB::BackgroundProcessingPool::threadFunction() /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/BackgroundProcessingPool.cpp:233:33 (gtests_dbms+0xc3c6c4a)
[2022-06-07T18:08:51.403Z]     #14 DB::BackgroundProcessingPool::BackgroundProcessingPool(int)::$_2::operator()() const /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tiflash/dbms/src/Storages/BackgroundProcessingPool.cpp:94:39 (gtests_dbms+0xc3c77f0)
[2022-06-07T18:08:51.403Z]     #15 decltype(static_cast<DB::BackgroundProcessingPool::BackgroundProcessingPool(int)::$_2>(fp)()) std::__1::__invoke<DB::BackgroundProcessingPool::BackgroundProcessingPool(int)::$_2>(DB::BackgroundProcessingPool::BackgroundProcessingPool(int)::$_2&&) /usr/local/bin/../include/c++/v1/type_traits:3918:1 (gtests_dbms+0xc3c77f0)
[2022-06-07T18:08:51.403Z]     #16 void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, DB::BackgroundProcessingPool::BackgroundProcessingPool(int)::$_2>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, DB::BackgroundProcessingPool::BackgroundProcessingPool(int)::$_2>&, std::__1::__tuple_indices<>) /usr/local/bin/../include/c++/v1/thread:280:5 (gtests_dbms+0xc3c77f0)
[2022-06-07T18:08:51.403Z]     #17 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, DB::BackgroundProcessingPool::BackgroundProcessingPool(int)::$_2> >(void*) /usr/local/bin/../include/c++/v1/thread:291:5 (gtests_dbms+0xc3c77f0)
[2022-06-07T18:08:51.403Z] 
[2022-06-07T18:08:51.403Z]   Location is global 'DB::DM::StoragePool::newDataPageIdForDTFile(DB::StableDiskDelegator&, char const*)::fail_point_called' of size 8 at 0x000011762fb8 (gtests_dbms+0x000011762fb8)
[2022-06-07T18:08:51.403Z] 

What is changed and how it works?

  • Fix TASN build
  • Fix broken ut in TASN

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jun 8, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CalvinNeo
  • JaySon-Huang

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 8, 2022
@jiaqizho jiaqizho changed the title Fix some fail case when enable tasn Fix some fail cases when enable tasn Jun 8, 2022
@jiaqizho jiaqizho changed the title Fix some fail cases when enable tasn Fix some fail cases when enable TASN Jun 8, 2022
@jiaqizho jiaqizho requested a review from JaySon-Huang June 8, 2022 05:31
Copy link
Contributor

@JaySon-Huang JaySon-Huang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 9, 2022
@jiaqizho jiaqizho requested a review from CalvinNeo June 9, 2022 08:56
Copy link
Member

@CalvinNeo CalvinNeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 9, 2022
@jiaqizho
Copy link
Contributor Author

jiaqizho commented Jun 9, 2022

/merge

@ti-chi-bot
Copy link
Member

@jiaqizho: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: b47be23

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 9, 2022
@ti-chi-bot
Copy link
Member

@jiaqizho: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@sre-bot
Copy link
Collaborator

sre-bot commented Jun 9, 2022

Coverage for changed files

Filename                                                     Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Flash/Management/tests/gtest_manual_compact.cpp                  905               315    65.19%          16                 0   100.00%         250                 4    98.40%         264               141    46.59%
Storages/DeltaMerge/StoragePool.cpp                              223                98    56.05%          30                 8    73.33%         478               187    60.88%         146                78    46.58%
Storages/DeltaMerge/tests/MultiSegmentTestUtil.h                 286                74    74.13%           5                 0   100.00%          75                 0   100.00%          76                36    52.63%
Storages/DeltaMerge/tests/gtest_dm_delta_merge_store.cpp        6851              1829    73.30%          47                 1    97.87%        3058               103    96.63%        2262              1013    55.22%
Storages/Page/V3/tests/gtest_blob_store.cpp                     5488              1185    78.41%          27                 1    96.30%        1172                66    94.37%        1698               849    50.00%
Storages/Page/V3/tests/gtest_page_directory.cpp                10021              1821    81.83%          58                 0   100.00%        1859                 7    99.62%        3166              1603    49.37%
Storages/Page/V3/tests/gtest_wal_store.cpp                      2437               293    87.98%          13                 0   100.00%         546                13    97.62%         814               396    51.35%
TestUtils/ColumnsToTiPBExpr.cpp                                   55                 5    90.91%           6                 0   100.00%         124                12    90.32%          40                 7    82.50%
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                          26266              5620    78.60%         202                10    95.05%        7562               392    94.82%        8466              4123    51.30%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18327      9657             47.31%    205623  96710        52.97%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit 167d39f into pingcap:master Jun 9, 2022
JaySon-Huang pushed a commit to JaySon-Huang/tiflash that referenced this pull request Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some of UTs failed when enable TASN.
5 participants