1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-28 20:02:00 +03:00

Check local sequential consistency in dbsim

- Release commit time critical section in callback
- Check the consistency inside commit order critical section

Other: Add 2pc switch to dbsim
This commit is contained in:
Teemu Ollakka
2024-11-28 12:33:21 +02:00
parent 3de594b662
commit 7994288534
8 changed files with 116 additions and 43 deletions

View File

@ -68,6 +68,9 @@ db::server::server(simulator& simulator,
, appliers_()
, clients_()
, client_threads_()
, commit_mutex_()
, next_commit_seqno_()
, committed_seqno_()
{
wsrep::log::logger_fn(logger_fn);
}
@ -165,3 +168,16 @@ void db::server::log_state_change(enum wsrep::server_state::state from,
wsrep::log_info() << "State changed " << from << " -> " << to;
reporter_.report_state(to);
}
void db::server::check_sequential_consistency(wsrep::client_id client_id,
uint64_t commit_seqno)
{
if (committed_seqno_ >= commit_seqno)
{
wsrep::log_error() << "Sequentiality violation for " << client_id
<< " commit seqno " << commit_seqno << " previous "
<< committed_seqno_;
::abort();
}
committed_seqno_ = commit_seqno;
}