Fix eventsV2 detecting corrupted history too aggressive
@@ -333,13 +333,13 @@ func (m *historyV2ManagerImpl) readHistoryBranch(byBatch bool, request *ReadHist
continue
}
- if *fe.EventId == token.LastEventID {
+ if *fe.EventId <= token.LastEventID {
// we could see it because of batch with smaller txn_id
logger.Infof("Stale event batch with eventID: %v", *fe.EventId)
continue
}
if *fe.EventId != token.LastEventID+1 {
- logger.Errorf("Corrupted incontinouous event batch, %v, %v, %v, %v, %v", *fe.Version, *le.Version, *fe.EventId, *le.EventId, el)
+ logger.Errorf("Corrupted incontinouous event batch, %v, %v, %v, %v, %v, %v", *fe.Version, *le.Version, *fe.EventId, *le.EventId, el, token.LastEventID)
return nil, nil, nil, 0, 0, &workflow.InternalServiceError{
Message: fmt.Sprintf("corrupted history event batch, eventID is not continouous"),
}
