spName.startsWith("@") &&
!spName.startsWith("@AdHoc") &&
!spName.startsWith("@LoadMultipartitionTable") &&
!spName.equals("@UpdateApplicationCatalog"))
{
InitiateResponseMessage errorResp = new InitiateResponseMessage(txn.m_initiationMsg);
errorResp.setResults(new ClientResponseImpl(ClientResponse.UNEXPECTED_FAILURE,
new VoltTable[] {},
"Failure while running system procedure " + txn.m_initiationMsg.getStoredProcedureName() +
", and system procedures can not be restarted."));
txn.setNeedsRollback();
completeInitiateTask(siteConnection);
errorResp.m_sourceHSId = m_initiator.getHSId();
m_initiator.deliver(errorResp);
hostLog.debug("SYSPROCFAIL: " + this);
return;
}
// Let's ensure that we flush any previous attempts of this transaction
// at the masters we're going to try to use this time around.
if (m_isRestart) {
CompleteTransactionMessage restart = new CompleteTransactionMessage(
m_initiator.getHSId(), // who is the "initiator" now??
m_initiator.getHSId(),
m_txnState.txnId,
m_txnState.isReadOnly(),
0,
true,
false, // really don't want to have ack the ack.
!m_txnState.isReadOnly(),
m_msg.isForReplay());
restart.setTruncationHandle(m_msg.getTruncationHandle());
restart.setOriginalTxnId(m_msg.getOriginalTxnId());
m_initiator.send(com.google_voltpatches.common.primitives.Longs.toArray(m_initiatorHSIds), restart);
}
final InitiateResponseMessage response = processInitiateTask(txn.m_initiationMsg, siteConnection);
// We currently don't want to restart read-only MP transactions because:
// 1) We're not writing the Iv2InitiateTaskMessage to the first
// FragmentTaskMessage in read-only case in the name of some unmeasured
// performance impact,
// 2) We don't want to perturb command logging and/or DR this close to the 3.0 release
// 3) We don't guarantee the restarted results returned to the client
// anyway, so not restarting the read is currently harmless.
// We could actually restart this here, since we have the invocation, but let's be consistent?
int status = response.getClientResponseData().getStatus();
if (status != ClientResponse.TXN_RESTART || (status == ClientResponse.TXN_RESTART && m_msg.isReadOnly())) {
if (!response.shouldCommit()) {
txn.setNeedsRollback();
}
completeInitiateTask(siteConnection);
// Set the source HSId (ugh) to ourselves so we track the message path correctly
response.m_sourceHSId = m_initiator.getHSId();