Skip to content

Commit

Permalink
Only query on sticky task list when domain is active (#3661)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjdawson2016 committed Oct 19, 2020
1 parent e6ff5fd commit efcbcc8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion service/history/historyEngine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1212,11 +1212,22 @@ func (e *historyEngineImpl) queryDirectlyThroughMatching(
sw := scope.StartTimer(metrics.DirectQueryDispatchLatency)
defer sw.Stop()

// Sticky task list is not very useful in the standby cluster because the decider cache is
// not updated by dispatching tasks to it (it is only updated in the case of query).
// Additionally on the standby side we are not even able to clear sticky.
// Stickiness might be outdated if the customer did a restart of their nodes causing a query
// dispatched on the standby side on sticky to hang. We decided it made sense to simply not attempt
// query on sticky task list at all on the passive side.
de, err := e.shard.GetDomainCache().GetDomainByID(domainID)
if err != nil {
return nil, err
}
supportsStickyQuery := e.clientChecker.SupportsStickyQuery(msResp.GetClientImpl(), msResp.GetClientFeatureVersion()) == nil
if msResp.GetIsStickyTaskListEnabled() &&
len(msResp.GetStickyTaskList().GetName()) != 0 &&
supportsStickyQuery &&
e.config.EnableStickyQuery(queryRequest.GetDomain()) {
e.config.EnableStickyQuery(queryRequest.GetDomain()) &&
de.IsDomainActive() {

stickyMatchingRequest := &m.QueryWorkflowRequest{
DomainUUID: common.StringPtr(domainID),
Expand Down

0 comments on commit efcbcc8

Please sign in to comment.