Skip to content

Commit

Permalink
Workaround for query-consistency-strong which is presently partially …
Browse files Browse the repository at this point in the history
…broken (#5928)

Provides a workaround for query-consistency-strong which is presently partially broken.
  • Loading branch information
davidporter-id-au authored Apr 24, 2024
1 parent fb26a4c commit 44b1f59
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions common/client/versionChecker.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ func (vc *versionChecker) SupportsStickyQuery(clientImpl string, clientFeatureVe
// SupportsConsistentQuery returns error if consistent query is not supported otherwise nil.
// In case client version lookup fails assume the client does not support feature.
func (vc *versionChecker) SupportsConsistentQuery(clientImpl string, clientFeatureVersion string) error {

return vc.featureSupported(clientImpl, clientFeatureVersion, consistentQuery)
}

Expand Down
10 changes: 9 additions & 1 deletion service/history/decision/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,15 @@ func (handler *handlerImpl) handleBufferedQueries(

// Consistent query requires both server and client worker support. If a consistent query was requested (meaning there are
// buffered queries) but worker does not support consistent query then all buffered queries should be failed.
if versionErr := handler.versionChecker.SupportsConsistentQuery(clientImpl, clientFeatureVersion); versionErr != nil {
versionErr := handler.versionChecker.SupportsConsistentQuery(clientImpl, clientFeatureVersion)
// todo (David.Porter) remove the skip on version check for
// clientImpl and clientFeatureVersion where they're nil
// There's a bug, probably in matching somewhere which isn't
// forwarding the client headers for version
// info correctly making this call erroneously fail sometimes.
// https://t3.uberinternal.com/browse/CDNC-8641
// So defaulting just this flow to fail-open in the absence of headers.
if versionErr != nil && clientImpl != "" && clientFeatureVersion != "" {
scope.IncCounter(metrics.WorkerNotSupportsConsistentQueryCount)
failedTerminationState := &query.TerminationState{
TerminationType: query.TerminationTypeFailed,
Expand Down

0 comments on commit 44b1f59

Please sign in to comment.