Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure shard is initialized before auditing
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Stuewe <stuewe@mit.edu>
HalosGhost committed Jul 27, 2023
1 parent b920881 commit 61c85ed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/uhs/twophase/locking_shard/controller.cpp
Original file line number Diff line number Diff line change
@@ -51,10 +51,6 @@ namespace cbdc::locking_shard {
return false;
}

m_audit_thread = std::thread([this]() {
audit();
});

auto params = nuraft::raft_params();
params.election_timeout_lower_bound_
= static_cast<int>(m_opts.m_election_timeout_lower);
@@ -79,6 +75,10 @@ namespace cbdc::locking_shard {

m_shard = m_state_machine->get_shard_instance();

m_audit_thread = std::thread([this]() {
audit();
});

if(m_shard_id > (m_opts.m_locking_shard_raft_endpoints.size() - 1)) {
m_logger->error("The shard ID is out of range "
"of the m_locking_shard_raft_endpoints vector.");

0 comments on commit 61c85ed

Please sign in to comment.