Skip to content

Commit

Permalink
Use namespace function to check active cluster (#2449)
Browse files Browse the repository at this point in the history
  • Loading branch information
yux0 authored Feb 2, 2022
1 parent 2503c84 commit a9ebd01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion service/history/historyEngine.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ func (e *historyEngineImpl) QueryWorkflow(
// 1. the namespace is not active, in this case history is immutable so a query dispatched at any time is consistent
// 2. the workflow is not running, whenever a workflow is not running dispatching query directly is consistent
// 3. if there is no pending or started workflow tasks it means no events came before query arrived, so its safe to dispatch directly
safeToDispatchDirectly := de.ActiveClusterName() != e.clusterMetadata.GetCurrentClusterName() ||
safeToDispatchDirectly := !de.ActiveInCluster(e.clusterMetadata.GetCurrentClusterName()) ||
!mutableState.IsWorkflowExecutionRunning() ||
(!mutableState.HasPendingWorkflowTask() && !mutableState.HasInFlightWorkflowTask())
if safeToDispatchDirectly {
Expand Down

0 comments on commit a9ebd01

Please sign in to comment.