-
Notifications
You must be signed in to change notification settings - Fork 411
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
test: Add tests case when deltaMergeBySplit + { flushCache | split } occurs simultaneously #5454
Conversation
Signed-off-by: Wish <[email protected]>
Signed-off-by: Wish <[email protected]>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
/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
/run-all-tests |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
@JaySon-Huang Thanks for the recommendation! I have made updates. Here are the results: When throwing a [2022/07/26 14:39:18.803 +08:00] [ERROR] [Exception.cpp:85] ["virtual void DB::DM::tests::DeltaMergeStoreMergeDeltaBySegmentTest_RetryBySplit_Test::TestBody():std::exception. Code: 1001, type: std::exception, e.what() = std::exception"] [thread_id=1] /Users/breezewish/Work/tiflash/dbms/src/Storages/DeltaMerge/tests/gtest_dm_delta_merge_store.cpp:3884: Failure Failed When throwing a /Users/breezewish/Work/tiflash/dbms/src/Storages/DeltaMerge/tests/gtest_dm_delta_merge_store.cpp:3879: Failure Failed Code: 0. DB::Exception: foo Stack trace: 0x10d2cf7bc StackTrace::StackTrace() [gtests_dbms+4508202940] dbms/src/Common/StackTrace.cpp:23 0x10d2cf7f8 StackTrace::StackTrace() [gtests_dbms+4508203000] dbms/src/Common/StackTrace.cpp:22 0x10077e784 DB::Exception::Exception(std::__1::basic_string, std::__1::allocator > const&, int) [gtests_dbms+4295010180] dbms/src/Common/Exception.h:41 0x10077d88c DB::Exception::Exception(std::__1::basic_string, std::__1::allocator > const&, int) [gtests_dbms+4295006348] dbms/src/Common/Exception.h:43 0x1020de8a4 DB::DM::tests::DeltaMergeStoreMergeDeltaBySegmentTest_RetryBySplit_Test::TestBody() [gtests_dbms+4321618084] dbms/src/Storages/DeltaMerge/tests/gtest_dm_delta_merge_store.cpp:3809 0x108c8e300 void testing::internal::HandleSehExceptionsInMethodIfSupported(testing::Test*, void (testing::Test::*)(), char const*) [gtests_dbms+4434535168] contrib/googletest/googletest/src/gtest.cc:2443 0x108c60e34 void testing::internal::HandleExceptionsInMethodIfSupported(testing::Test*, void (testing::Test::*)(), char const*) [gtests_dbms+4434349620] contrib/googletest/googletest/src/gtest.cc:2479 0x108c60d84 testing::Test::Run() [gtests_dbms+4434349444] contrib/googletest/googletest/src/gtest.cc:2517 0x108c61d44 testing::TestInfo::Run() [gtests_dbms+4434353476] contrib/googletest/googletest/src/gtest.cc:2693 0x108c62b50 testing::TestCase::Run() [gtests_dbms+4434357072] contrib/googletest/googletest/src/gtest.cc:2811 0x108c6cfd0 testing::internal::UnitTestImpl::RunAllTests() [gtests_dbms+4434399184] contrib/googletest/googletest/src/gtest.cc:5177 0x108c931ac bool testing::internal::HandleSehExceptionsInMethodIfSupported(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) [gtests_dbms+4434555308] contrib/googletest/googletest/src/gtest.cc:2443 0x108c6cabc bool testing::internal::HandleExceptionsInMethodIfSupported(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) [gtests_dbms+4434397884] contrib/googletest/googletest/src/gtest.cc:2479 0x108c6c9ac testing::UnitTest::Run() [gtests_dbms+4434397612] contrib/googletest/googletest/src/gtest.cc:4786 0x1028d1760 RUN_ALL_TESTS() [gtests_dbms+4329953120] contrib/googletest/googletest/include/gtest/gtest.h:2341 0x1028d1464 main [gtests_dbms+4329952356] dbms/src/TestUtils/gtests_dbms_main.cpp:77 0x150d4d088 When libc++abi: terminating Received signal Abort trap: 6 0x111a22b7c StackTrace::StackTrace() [gtests_dbms+4508232572] dbms/src/Common/StackTrace.cpp:23 0x111a22bb8 StackTrace::StackTrace() [gtests_dbms+4508232632] dbms/src/Common/StackTrace.cpp:22 0x10702452c fault_signal_handler(int) [gtests_dbms+4329981228] dbms/src/TestUtils/gtests_dbms_main.cpp:32 0x1bf16d4c4 _OSAtomicTestAndClearBarrier [libsystem_platform.dylib+6445864132] 0x1bf155ee0 __pthread_atfork_prepare_handlers [libsystem_pthread.dylib+6445768416] 0x1bf090340 [libsystem_c.dylib+6444958528] 0x1bf110b08 [libc++abi.dylib+6445484808] 0x1bf100834 [libc++abi.dylib+6445418548] 0x1bf10fea4 [libc++abi.dylib+6445481636] 0x1bf10fe2c [libc++abi.dylib+6445481516] 0x10682b444 DB::DM::tests::DeltaMergeStoreMergeDeltaBySegmentTest_RetryBySplit_Test::TestBody() [gtests_dbms+4321621060] dbms/src/Storages/DeltaMerge/tests/gtest_dm_delta_merge_store.cpp:3810 0x10d3e16cc void testing::internal::HandleSehExceptionsInMethodIfSupported(testing::Test*, void (testing::Test::*)(), char const*) [gtests_dbms+4434564812] contrib/googletest/googletest/src/gtest.cc:2443 0x10d3b4200 void testing::internal::HandleExceptionsInMethodIfSupported(testing::Test*, void (testing::Test::*)(), char const*) [gtests_dbms+4434379264] contrib/googletest/googletest/src/gtest.cc:2479 0x10d3b4150 testing::Test::Run() [gtests_dbms+4434379088] contrib/googletest/googletest/src/gtest.cc:2517 0x10d3b5110 testing::TestInfo::Run() [gtests_dbms+4434383120] contrib/googletest/googletest/src/gtest.cc:2693 0x10d3b5f1c testing::TestCase::Run() [gtests_dbms+4434386716] contrib/googletest/googletest/src/gtest.cc:2811 0x10d3c039c testing::internal::UnitTestImpl::RunAllTests() [gtests_dbms+4434428828] contrib/googletest/googletest/src/gtest.cc:5177 0x10d3e6578 bool testing::internal::HandleSehExceptionsInMethodIfSupported(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) [gtests_dbms+4434584952] contrib/googletest/googletest/src/gtest.cc:2443 0x10d3bfe88 bool testing::internal::HandleExceptionsInMethodIfSupported(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) [gtests_dbms+4434427528] contrib/googletest/googletest/src/gtest.cc:2479 0x10d3bfd78 testing::UnitTest::Run() [gtests_dbms+4434427256] contrib/googletest/googletest/src/gtest.cc:4786 0x107024b10 RUN_ALL_TESTS() [gtests_dbms+4329982736] contrib/googletest/googletest/include/gtest/gtest.h:2341 0x107024814 main [gtests_dbms+4329981972] dbms/src/TestUtils/gtests_dbms_main.cpp:77 0x155431088 [1] 58158 abort /Users/breezewish/Work/tiflash/cmake-build-debug/dbms/gtests_dbms |
Signed-off-by: Wish <[email protected]>
/run-all-tests |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
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.
Some small comment
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 with previous minor comments
Signed-off-by: Wish <[email protected]>
/merge |
@breezewish: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger 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. |
This pull request has been accepted and is ready to merge. Commit hash: 59e4321
|
@breezewish: 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. |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created: #5485. |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created: #5486. |
…occurs simultaneously (pingcap#5454) Signed-off-by: Wish <[email protected]>
What problem does this PR solve?
Issue Number: ref #5409
Problem Summary: For now we lack some tests to test the behavior when multiple operations occurred at the same time.
What is changed and how it works?
Introduced a new facility called
SyncPoint
, which can be used to control the arbitrary business logical flow to suspend and continue.Added or modified existing ManualCompaction tests based on the new
SyncPoint
:Modified: BasicManualCompactTest/DuplicatedLogicalId
Previously this test uses sleep(500ms) to expect specific code logic is finished. Now this sleep is substituted with SyncPoint, so that expected code logic is always finished and the test can continue without waiting for useless time.
Added: DeltaMergeStoreMergeDeltaBySegmentTest/RetryByFlushCache
Added: DeltaMergeStoreMergeDeltaBySegmentTest/RetryBySplit
The two new cases above tests whether everything works fine when there are mergeDeltaBySplit and flushCache (or split) happening simultaneously, based on the SyncPoint.
Added more guards in gtest_main:
Failures are now turned into exceptions by default, so that when writing ASSERT in sub-functions it will break the test immediately. This is particularly useful in SyncPoint tests, as when there are failures in previous sync point steps, it is very likely that the rest step will not work as expected, result in infinite wait. By turning into exceptions, we these test cases fail fast.
Added stack output when the program is unexpected terminated in fault signals like SIG_ABORT (and also
std::terminate
). This helps locate the code of triggering these faults.Check List
Tests
Side effects
Documentation
Release note