Skip to content

Commit

Permalink
Once again change wounding logic
Browse files Browse the repository at this point in the history
  • Loading branch information
rescrv committed Apr 3, 2017
1 parent 5fb53c2 commit 431deb6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion txman/daemon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -871,10 +871,10 @@ daemon :: process_wound(comm_id, std::auto_ptr<e::buffer> msg, e::unpacker up)
transaction_group tg;
up = up >> tg;
CHECK_UNPACK(TXMAN_WOUND, up);
LOG_IF(INFO, s_debug_mode) << transaction_group::log(tg) << " wounding " << tg;

if (get_config()->is_member(tg.group, m_us.id))
{
LOG_IF(INFO, s_debug_mode) << transaction_group::log(tg) << " wounding local transaction";
// wound the local voter
local_voter_map_t::state_reference lvsr;
local_voter* lv = m_local_voters.get_or_create_state(tg, &lvsr);
Expand All @@ -896,6 +896,7 @@ daemon :: process_wound(comm_id, std::auto_ptr<e::buffer> msg, e::unpacker up)
}
else
{
LOG_IF(INFO, s_debug_mode) << transaction_group::log(tg) << " forwarding wound message to group";
send(tg.group, msg);
}
}
Expand Down
5 changes: 3 additions & 2 deletions txman/local_voter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,9 @@ local_voter :: work_state_machine(daemon* d)

// XXX this is not robust if the coordinator totally goes missing
// XXX this may have leader thrashing; think about it
if (d->get_config()->get_state(m_group.members[idx]) == txman_state::ONLINE ||
(!m_has_preferred_vote && !m_wounded))
if (!m_wounded &&
(d->get_config()->get_state(m_group.members[idx]) == txman_state::ONLINE ||
!m_has_preferred_vote))
{
break;
}
Expand Down

0 comments on commit 431deb6

Please sign in to comment.