Skip to content

Commit

Permalink
maxRedoCounterInstage1
Browse files Browse the repository at this point in the history
  • Loading branch information
setunapo committed May 5, 2022
1 parent a1b9eed commit ca838ee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const (
maxUnitSize = 10
dispatchPolicyStatic = 1
dispatchPolicyDynamic = 2 // not supported
maxRedoCounterInstage1 = 2 // try 2, 4, 10, or no limit?
)

var dispatchPolicy = dispatchPolicyStatic
Expand Down Expand Up @@ -923,6 +924,9 @@ func (p *ParallelStateProcessor) runConfirmLoop() {
if !p.confirmInStage2 && p.txReqExecuteCount == txSize {
log.Info("runConfirmLoop last txIndex received, enter stage 2", "txIndex", txIndex)
p.confirmInStage2 = true
for i := 0; i < txSize; i++ {
p.txReqExecuteRecord[txIndex] = 0 // clear it when enter stage2, for redo limit
}
}
// if no Tx is merged, we will skip the stage 2 check
if !newTxMerged {
Expand Down Expand Up @@ -1037,7 +1041,9 @@ func (p *ParallelStateProcessor) toConfirmTxIndex(targetTxIndex int, isStage2 bo
if !valid {
if resultsLen == 1 || isStage2 { // for Stage 2, we only check its latest result.
p.debugConflictRedoNum++
lastResult.txReq.runnable = 1 // needs redo
if !isStage2 || p.txReqExecuteRecord[lastResult.txReq.txIndex] < maxRedoCounterInstage1 {
lastResult.txReq.runnable = 1 // needs redo
}
slot := p.slotState[staticSlotIndex]
log.Debug("runConfirmLoop conflict",
"staticSlotIndex", staticSlotIndex,
Expand Down

0 comments on commit ca838ee

Please sign in to comment.