Skip to content

Commit

Permalink
Fix history corruption due to deletion of events (uber#1087)
Browse files Browse the repository at this point in the history
* Fix history corruption due to deletion of events
  • Loading branch information
samarabbas authored Sep 5, 2018
1 parent e488d84 commit 986e93c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion service/history/historyReplicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ func (r *historyReplicator) replicateWorkflowStarted(ctx context.Context, contex
return nil
}
if _, ok := err.(*persistence.WorkflowExecutionAlreadyStartedError); !ok {
deleteHistory()
logger.WithField(logging.TagErr, err).Info("Create workflow failed after appending history events.")
return err
}

Expand Down
1 change: 0 additions & 1 deletion service/history/historyReplicator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,6 @@ func (s *historyReplicatorSuite) TestReplicateWorkflowStarted_ISE() {
sBuilder.On("getTransferTasks").Return(transferTasks)
sBuilder.On("getTimerTasks").Return(timerTasks)
s.mockShardManager.On("UpdateShard", mock.Anything).Return(nil).Once() // this is called when err is returned, and shard will try to update
s.mockHistoryMgr.On("DeleteWorkflowExecutionHistory", mock.Anything).Return(nil).Once()

errRet := &shared.InternalServiceError{}
// the test above already assert the create workflow request, so here jsut use anyting
Expand Down

0 comments on commit 986e93c

Please sign in to comment.