Uh oh!
There was an error while loading. Please reload this page.
[test](ms) Add injection point to randomly fail in txn->commit() for test - #47336
Conversation
hello-stephen
commented
Jan 23, 2025
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
4a450e5 to
8e47f36CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
2200210 to
d68b384Comparebobhan1
commented
Feb 5, 2025
run buildall |
txn->commit() for testtxn->commit() for testUh oh!
There was an error while loading. Please reload this page.
520964c to
4da8f4fComparebobhan1
commented
Feb 11, 2025
run buildall |
doris-robot
commented
Feb 11, 2025
TeamCity cloud ut coverage result: |
bobhan1
commented
Feb 11, 2025
run cloud_p0 |
bobhan1
commented
Feb 11, 2025
run vault_p0 |
78db136 to
d8eee49Compared8eee49 to
48da2acCompare48da2ac to
0bc4a43Comparebobhan1
commented
Feb 12, 2025
run buildall |
doris-robot
commented
Feb 12, 2025
TeamCity cloud ut coverage result: |
| bool enable_inject_random_fault {false}; | ||
| TEST_INJECTION_POINT_CALLBACK("Transaction::commit.inject_random_fault", | ||
| &enable_inject_random_fault); | ||
| if (enable_inject_random_fault) [[unlikely]] { | ||
| std::mt19937 gen {std::random_device {}()}; | ||
| double p {-1.0}; | ||
| TEST_INJECTION_POINT_CALLBACK("Transaction::commit.inject_random_fault.set_p", &p); | ||
| if (p < 0 || p > 1.0) { | ||
| p = 0.01; // default injection possibility is 1% | ||
| } | ||
| std::bernoulli_distribution inject_fault {p}; | ||
| if (inject_fault(gen)) { | ||
| std::bernoulli_distribution err_type {0.5}; | ||
| TxnErrorCode inject_err = | ||
| (err_type(gen) ? TxnErrorCode::TXN_CONFLICT : TxnErrorCode::TXN_TOO_OLD); | ||
| LOG_WARNING("inject {} err when txn->commit()", inject_err); | ||
| return inject_err; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
| bool enable_inject_random_fault {false}; | |
| TEST_INJECTION_POINT_CALLBACK("Transaction::commit.inject_random_fault", | |
| &enable_inject_random_fault); | |
| if (enable_inject_random_fault) [[unlikely]] { | |
| std::mt19937 gen {std::random_device {}()}; | |
| double p {-1.0}; | |
| TEST_INJECTION_POINT_CALLBACK("Transaction::commit.inject_random_fault.set_p", &p); | |
| if (p < 0 || p > 1.0) { | |
| p = 0.01; // default injection possibility is 1% | |
| } | |
| std::bernoulli_distribution inject_fault {p}; | |
| if (inject_fault(gen)) { | |
| std::bernoulli_distribution err_type {0.5}; | |
| TxnErrorCode inject_err = | |
| (err_type(gen) ? TxnErrorCode::TXN_CONFLICT : TxnErrorCode::TXN_TOO_OLD); | |
| LOG_WARNING("inject {} err when txn->commit()", inject_err); | |
| return inject_err; | |
| } | |
| } | |
| TEST_INJECTION_POINT_RETURN_WITH_VALUE() |
gavinchou
commented
Feb 12, 2025
run buildall |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
doris-robot
commented
Feb 12, 2025
TeamCity cloud ut coverage result: |
…r test (#47336) Add random fault injection in `txn->commit()`
…r test (apache#47336) Add random fault injection in `txn->commit()`
…r test (apache#47336) Add random fault injection in `txn->commit()`
What problem does this PR solve?
Add random fault injection in
txn->commit()Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)