コード例 #1
0
ファイル: acceptor.go プロジェクト: chang290/server
func (adfd *acceptorDeleteFromDisk) deletionDone() {
	if adfd.currentState == adfd {
		adfd.nextState(nil)
		adfd.acceptorManager.AcceptorFinished(adfd.txnId)

		seg := capn.NewBuffer(nil)
		msg := msgs.NewRootMessage(seg)
		tgc := msgs.NewTxnGloballyComplete(seg)
		msg.SetTxnGloballyComplete(tgc)
		tgc.SetTxnId(adfd.txnId[:])
		server.Log(adfd.txnId, "Sending TGC to", adfd.tgcRecipients)
		NewOneShotSender(server.SegToBytes(seg), adfd.acceptorManager.ConnectionManager, adfd.tgcRecipients...)
	}
}
コード例 #2
0
ファイル: acceptormanager.go プロジェクト: chang290/server
func (am *AcceptorManager) TxnLocallyCompleteReceived(sender common.RMId, txnId *common.TxnId, tlc *msgs.TxnLocallyComplete) {
	if aInst, found := am.acceptors[*txnId]; found && aInst.acceptor != nil {
		server.Log(txnId, "TLC received from", sender, "(acceptor found)")
		aInst.acceptor.TxnLocallyCompleteReceived(sender)

	} else {
		// We must have deleted the acceptor state from disk,
		// immediately prior to sending TGC, and then died. Now we're
		// back up, the proposers have sent us more TLCs, and we should
		// just reply with TGCs.
		server.Log(txnId, "TLC received from", sender, "(acceptor not found)")
		seg := capn.NewBuffer(nil)
		msg := msgs.NewRootMessage(seg)
		tgc := msgs.NewTxnGloballyComplete(seg)
		msg.SetTxnGloballyComplete(tgc)
		tgc.SetTxnId(txnId[:])
		server.Log(txnId, "Sending single TGC to", sender)
		NewOneShotSender(server.SegToBytes(seg), am.ConnectionManager, sender)
	}
}