diff --git a/dtmgrpc/workflow/imp.go b/dtmgrpc/workflow/imp.go index 3477151..d58a320 100644 --- a/dtmgrpc/workflow/imp.go +++ b/dtmgrpc/workflow/imp.go @@ -160,9 +160,10 @@ func (wf *Workflow) callPhase2(branchID string, fn WfPhase2Func) error { func (wf *Workflow) recordedDo(fn func(bb *dtmcli.BranchBarrier) *stepResult) *stepResult { sr := wf.recordedDoInner(fn) // if options not enabled, only successful branch need to be compensated - if !wf.Options.CompensateErrorBranch && wf.currentRollbackItem != nil && sr.Status == dtmcli.ResultSuccess { + if !wf.Options.CompensateErrorBranch && wf.currentRollbackItem != nil && sr.Status == dtmcli.StatusSucceed { wf.failedOps = append(wf.failedOps, *wf.currentRollbackItem) } + wf.currentRollbackItem = nil return sr }