diff --git a/src/dbms_simulator.cpp b/src/dbms_simulator.cpp index f4b2565..06332c4 100644 --- a/src/dbms_simulator.cpp +++ b/src/dbms_simulator.cpp @@ -57,7 +57,7 @@ public: dbms_storage_engine() : mutex_() , transactions_() - , alg_freq_(100) + , alg_freq_(0) , bf_aborts_() { } @@ -343,6 +343,7 @@ private: } int commit(trrep::transaction_context& transaction_context) override { + assert(mode() == trrep::client_context::m_applier); int ret(0); ret = transaction_context.before_commit(); ret = ret || transaction_context.ordered_commit(); @@ -461,7 +462,7 @@ private: void report_progress(size_t i) const { - if ((i % 100) == 0) + if ((i % 1000) == 0) { trrep::log() << "client: " << id().get() << " transactions: " << i diff --git a/src/mock_provider.hpp b/src/mock_provider.hpp index 80fe8c8..e35759e 100644 --- a/src/mock_provider.hpp +++ b/src/mock_provider.hpp @@ -105,14 +105,23 @@ namespace trrep int replay(wsrep_ws_handle_t*, void*) { ::abort(); /* not impl */} + int sst_sent(const wsrep_gtid_t&, int) { return 0; } + int sst_received(const wsrep_gtid_t&, int) { return 0; } + + std::vector status() const + { + return std::vector(); + } + + // Methods to modify mock state - // Inject BF abort event into the provider. - // - // @param bf_seqno Aborter sequence number - // @param trx_id Trx id to be aborted - // @param[out] victim_seqno - // + /*! Inject BF abort event into the provider. + * + * \param bf_seqno Aborter sequence number + * \param trx_id Trx id to be aborted + * \param[out] victim_seqno + */ wsrep_status_t bf_abort(wsrep_seqno_t bf_seqno, wsrep_trx_id_t trx_id, wsrep_seqno_t* victim_seqno) @@ -127,13 +136,11 @@ namespace trrep return WSREP_OK; } - int sst_sent(const wsrep_gtid_t&, int) { return 0; } - int sst_received(const wsrep_gtid_t&, int) { return 0; } - - std::vector status() const - { - return std::vector(); - } + /*! + * \todo Inject an error so that the next call to any + * provider call will return the given error. + */ + void inject_error(wsrep_status_t); private: wsrep_uuid_t group_id_; wsrep_uuid_t node_id_; diff --git a/src/transaction_context.cpp b/src/transaction_context.cpp index 76f234f..bc6bacc 100644 --- a/src/transaction_context.cpp +++ b/src/transaction_context.cpp @@ -189,6 +189,8 @@ int trrep::transaction_context::before_commit() state() == s_committing || state() == s_must_abort || state() == s_replaying); + assert((client_context_.mode() == trrep::client_context::m_replicating && + state() == s_executing) || certified()); switch (client_context_.mode()) {