public void handleCompleteTransactionMessage(CompleteTransactionMessage message) { if (m_isLeader) { CompleteTransactionMessage replmsg = new CompleteTransactionMessage(message); // Set the spHandle so that on repair the new master will set the max seen spHandle // correctly advanceTxnEgo(); replmsg.setSpHandle(getCurrentTxnId()); if (m_sendToHSIds.length > 0) { m_mailbox.send(m_sendToHSIds, replmsg); } } else { setMaxSeenTxnId(message.getSpHandle()); } TransactionState txn = m_outstandingTxns.get(message.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(message, m_mailbox.getHSId()); final CompleteTransactionTask task = new CompleteTransactionTask(txn, m_pendingTasks, message, m_drGateway); queueOrOfferMPTask(task); // If this is a restart, then we need to leave the transaction state around if (!message.isRestart()) { m_outstandingTxns.remove(message.getTxnId()); } } }