@@ -1539,6 +1539,55 @@ BOOST_FIXTURE_TEST_CASE(
15391539 BOOST_REQUIRE (sc.provider ().commit_fragments () == 1 );
15401540}
15411541
1542+ //
1543+ // Test a streaming transaction which gets BF aborted inside provider before
1544+ // certification result is known. Replaying will be successful
1545+ //
1546+ BOOST_FIXTURE_TEST_CASE (
1547+ transaction_row_streaming_bf_before_cert_result_replay_success,
1548+ streaming_client_fixture_row)
1549+ {
1550+ BOOST_REQUIRE (cc.start_transaction (wsrep::transaction_id (1 )) == 0 );
1551+ BOOST_REQUIRE (cc.after_row () == 0 );
1552+ BOOST_REQUIRE (tc.streaming_context ().fragments_certified () == 1 );
1553+
1554+ sc.provider ().certify_result_ = wsrep::provider::error_bf_abort;
1555+ sc.provider ().replay_result_ = wsrep::provider::success;
1556+
1557+ BOOST_REQUIRE (cc.before_commit ());
1558+ BOOST_REQUIRE (tc.state () == wsrep::transaction::s_must_replay);
1559+ BOOST_REQUIRE (cc.will_replay_called () == true );
1560+ BOOST_REQUIRE (cc.after_statement () == 0 );
1561+ BOOST_REQUIRE (tc.state () == wsrep::transaction::s_committed);
1562+ BOOST_REQUIRE (cc.current_error () == wsrep::e_success);
1563+ }
1564+
1565+ //
1566+ // Test a streaming transaction which gets BF aborted inside provider before
1567+ // certification result is known. Replaying will fail because of
1568+ // certification failure.
1569+ //
1570+ BOOST_FIXTURE_TEST_CASE (
1571+ transaction_row_streaming_bf_before_cert_result_replay_cert_fail,
1572+ streaming_client_fixture_row)
1573+ {
1574+ BOOST_REQUIRE (cc.start_transaction (wsrep::transaction_id (1 )) == 0 );
1575+ BOOST_REQUIRE (cc.after_row () == 0 );
1576+ BOOST_REQUIRE (tc.streaming_context ().fragments_certified () == 1 );
1577+
1578+ sc.provider ().certify_result_ = wsrep::provider::error_bf_abort;
1579+ sc.provider ().replay_result_ = wsrep::provider::error_certification_failed;
1580+
1581+ BOOST_REQUIRE (cc.before_commit ());
1582+ BOOST_REQUIRE (tc.state () == wsrep::transaction::s_must_replay);
1583+ BOOST_REQUIRE (cc.will_replay_called () == true );
1584+ BOOST_REQUIRE (cc.after_statement () );
1585+ BOOST_REQUIRE (tc.state () == wsrep::transaction::s_aborted);
1586+ BOOST_REQUIRE (cc.current_error () == wsrep::e_deadlock_error);
1587+ BOOST_REQUIRE (tc.active () == false );
1588+ }
1589+
1590+
15421591BOOST_FIXTURE_TEST_CASE (transaction_byte_streaming_1pc_commit,
15431592 streaming_client_fixture_byte)
15441593{
0 commit comments