Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Don't add error log when it is ES version conflicts #6652

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
19 changes: 9 additions & 10 deletions service/worker/indexer/esProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,6 @@ func (p *ESProcessorImpl) bulkAfterAction(id int64, requests []bulk.GenericBulka
continue
}
wid, rid, domainID := p.getMsgWithInfo(key)
p.logger.Error("ES request failed and is not retryable",
tag.ESResponseStatus(err.Status),
tag.ESRequest(request.String()),
tag.WorkflowID(wid),
tag.WorkflowRunID(rid),
tag.WorkflowDomainID(domainID))

// check if it is a delete request and status code
// 404 means the document does not exist
Expand All @@ -162,6 +156,7 @@ func (p *ESProcessorImpl) bulkAfterAction(id int64, requests []bulk.GenericBulka
tag.WorkflowRunID(rid),
tag.WorkflowDomainID(domainID))
p.ackKafkaMsg(key)
continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will miss failure metrics p.scope.IncCounter(metrics.ESProcessorFailures)

Copy link
Member Author

@neil-xie neil-xie Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These might not should be considered as failures, the version conflicts I found are caused by the disordered messages from Kafka, which mean we have short workflows, sometimes for example the closed messages published earlier than the upsert workflow execution calls, we will have version conflicts and we ack to prevent retry on purpose.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We used the taskID as the visibility message version, which can make sure the older messages won't override the newer ones. That is why we got these conflicts

} else if err.Status == 404 {
req, err := request.Source()
if err == nil && p.isDeleteRequest(req) {
Expand All @@ -171,15 +166,19 @@ func (p *ESProcessorImpl) bulkAfterAction(id int64, requests []bulk.GenericBulka
tag.WorkflowRunID(rid),
tag.WorkflowDomainID(domainID))
p.ackKafkaMsg(key)
continue
} else {
p.logger.Error("Get request source err.", tag.Error(err), tag.ESRequest(request.String()))
p.scope.IncCounter(metrics.ESProcessorCorruptedData)
p.nackKafkaMsg(key)
}
} else {
// For all other non-retryable errors, nack the message
p.nackKafkaMsg(key)
}
p.logger.Error("ES request failed and is not retryable",
tag.ESResponseStatus(err.Status),
tag.ESRequest(request.String()),
tag.WorkflowID(wid),
tag.WorkflowRunID(rid),
tag.WorkflowDomainID(domainID))
p.nackKafkaMsg(key)
}
p.scope.IncCounter(metrics.ESProcessorFailures)
}
Expand Down