m_mailbox.send(message.getDestinationSiteId(), message);
}
public void handleCompleteTransactionMessage(CompleteTransactionMessage message)
{
CompleteTransactionMessage msg = message;
if (m_isLeader) {
msg = new CompleteTransactionMessage(message);
// Set the spHandle so that on repair the new master will set the max seen spHandle
// correctly
if (!msg.isForReplay()) advanceTxnEgo();
msg.setSpHandle(getCurrentTxnId());
if (m_sendToHSIds.length > 0) {
m_mailbox.send(m_sendToHSIds, msg);
}
} else {
setMaxSeenTxnId(msg.getSpHandle());
}
TransactionState txn = m_outstandingTxns.get(msg.getTxnId());
// We can currently receive CompleteTransactionMessages for multipart procedures
// which only use the buddy site (replicated table read). Ignore them for
// now, fix that later.
if (txn != null)
{
Iv2Trace.logCompleteTransactionMessage(msg, m_mailbox.getHSId());
final CompleteTransactionTask task =
new CompleteTransactionTask(txn, m_pendingTasks, msg, m_drGateway);
queueOrOfferMPTask(task);
// If this is a restart, then we need to leave the transaction state around
if (!msg.isRestart()) {
m_outstandingTxns.remove(msg.getTxnId());
}
}
}