Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Clean up duplicate empty task id #3490

Merged
merged 1 commit into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ const (
LastBlobNextPageToken = -1
// EndMessageID is the id of the end message, here we use the int64 max
EndMessageID int64 = 1<<63 - 1
// EmptyTaskID is the id of the empty task
EmptyTaskID int64 = 0
)

const (
Expand Down
16 changes: 8 additions & 8 deletions service/history/ndc/history_replicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ func (r *HistoryReplicatorImpl) backfillHistory(
}
case *serviceerror.NotFound:
default:
return nil, common.EmptyTaskID, err
return nil, common.EmptyEventTaskID, err
}
}

Expand All @@ -871,11 +871,11 @@ func (r *HistoryReplicatorImpl) backfillHistory(
},
)
if err != nil {
return nil, common.EmptyTaskID, err
return nil, common.EmptyEventTaskID, err
}
historyBranch := resp.BranchInfo

prevTxnID := common.EmptyTaskID
prevTxnID := common.EmptyEventTaskID
var lastHistoryBatch *commonpb.DataBlob
var prevBranchID string
sortedAncestors := sortAncestors(historyBranch.GetAncestors())
Expand All @@ -886,7 +886,7 @@ BackfillLoop:
for remoteHistoryIterator.HasNext() {
historyBlob, err := remoteHistoryIterator.Next()
if err != nil {
return nil, common.EmptyTaskID, err
return nil, common.EmptyEventTaskID, err
}

if historyBlob.nodeID <= lastBatchNodeID {
Expand All @@ -907,7 +907,7 @@ BackfillLoop:
currentAncestor = sortedAncestors[sortedAncestorsIdx]
branchID = currentAncestor.GetBranchId()
if historyBlob.nodeID < currentAncestor.GetBeginNodeId() || historyBlob.nodeID >= currentAncestor.GetEndNodeId() {
return nil, common.EmptyTaskID, serviceerror.NewInternal(
return nil, common.EmptyEventTaskID, serviceerror.NewInternal(
fmt.Sprintf("The backfill history blob node id %d is not in acestoer range [%d, %d]",
historyBlob.nodeID,
currentAncestor.GetBeginNodeId(),
Expand All @@ -928,11 +928,11 @@ BackfillLoop:
},
})
if err != nil {
return nil, common.EmptyTaskID, err
return nil, common.EmptyEventTaskID, err
}
txnID, err := r.shard.GenerateTaskID()
if err != nil {
return nil, common.EmptyTaskID, err
return nil, common.EmptyEventTaskID, err
}
_, err = r.executionMgr.AppendRawHistoryNodes(ctx, &persistence.AppendRawHistoryNodesRequest{
ShardID: r.shard.GetShardID(),
Expand All @@ -949,7 +949,7 @@ BackfillLoop:
),
})
if err != nil {
return nil, common.EmptyTaskID, err
return nil, common.EmptyEventTaskID, err
}
prevTxnID = txnID
prevBranchID = branchID
Expand Down