Documentation
¶
Index ¶
- Constants
- Variables
- func CommitXA(ctx context.Context, bc *mysql.BackendConnection) (proto.Result, error)
- func CreateTrxManager(tenant string) error
- func EndXA(ctx context.Context, bc *mysql.BackendConnection) (proto.Result, error)
- func NewXADeadLockDog() (runtime.DeadLockDog, error)
- func NewXAHook(tenant string, enable bool) (*xaHook, error)
- func PrepareXA(ctx context.Context, bc *mysql.BackendConnection) (proto.Result, error)
- func RollbackXA(ctx context.Context, bc *mysql.BackendConnection) (proto.Result, error)
- func StartXA(ctx context.Context, bc *mysql.BackendConnection) (proto.Result, error)
- type Condition
- type TrxLog
- type TrxManager
- type TrxParticipant
- type TxFaultDecisionExecutor
- type TxLogManager
Constants ¶
const ( Like dBOperation = "LIKE" Equal dBOperation = "=" NotEqual dBOperation = "<>" LessThan dBOperation = "<" LessEqualThan dBOperation = "<=" GreatThan dBOperation = ">" GrateEqualThan dBOperation = ">=" )
Variables ¶
var ( ErrorTrxManagerNotInitialize = errors.New("TrxManager not initialize") DefaultCleanLogDelay = 1 * time.Hour )
var ErrorInvalidTxId = errors.New("invalid transaction id")
Functions ¶
func CreateTrxManager ¶
CreateTrxManager inits TxFaultDecisionExecutor
func NewXADeadLockDog ¶
func NewXADeadLockDog() (runtime.DeadLockDog, error)
NewXADeadLockDog creates xa runtime.DeadLockDog
func RollbackXA ¶
RollbackXA do rollback xa transaction action
Types ¶
type Condition ¶
type Condition struct { FiledName string Operation dBOperation Value interface{} }
Condition sql query where condition
type TrxLog ¶
type TrxLog struct { TrxID string ServerID int32 State runtime.TxState Participants []TrxParticipant Tenant string }
TrxLog arana tx log
type TrxManager ¶
type TrxManager struct {
// contains filtered or unexported fields
}
func GetTrxManager ¶
func GetTrxManager(tenant string) (*TrxManager, error)
GetTrxManager returns *TrxManager
type TrxParticipant ¶
TrxParticipant join target trx all node info
type TxFaultDecisionExecutor ¶
type TxFaultDecisionExecutor struct {
// contains filtered or unexported fields
}
TxFaultDecisionExecutor Decisions of transaction pocket regularly scan the `__arana_tx_log` table to query the list of unfinished transactions case 1: If it is in the prepare state, if it exceeds a certain period of time, the transaction will be rolled back directly case 2: If it is in the Committing state, commit the transaction again and end the current transaction case 3: If it is in Aborting state, roll back the transaction again and end the current transaction important!!! the execution of this task requires distributed task preemption based on the metadata DB
func (*TxFaultDecisionExecutor) Run ¶
func (bm *TxFaultDecisionExecutor) Run()
Run Core logic of the decision -making decision -making at the bottom of the affairs
type TxLogManager ¶
type TxLogManager struct {
// contains filtered or unexported fields
}
TxLogManager Transaction log management
func (*TxLogManager) AddOrUpdateTxLog ¶
func (gm *TxLogManager) AddOrUpdateTxLog(l TrxLog) error
AddOrUpdateTxLog Add or update transaction log
func (*TxLogManager) DeleteTxLog ¶
func (gm *TxLogManager) DeleteTxLog(l TrxLog) error
DeleteTxLog Delete transaction log