-
Notifications
You must be signed in to change notification settings - Fork 911
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
Change Scan API to have no Order(ES) #4134
Change Scan API to have no Order(ES) #4134
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add some validation in the Scan aPI to return an error if the query has an custom ORDER BY.
cc: @yiminc
common/persistence/visibility/store/elasticsearch/visibility_store.go
Outdated
Show resolved
Hide resolved
common/persistence/visibility/store/elasticsearch/visibility_store.go
Outdated
Show resolved
Hide resolved
common/persistence/visibility/store/elasticsearch/visibility_store_read_test.go
Outdated
Show resolved
Hide resolved
In that case, it might be better to refactor these functions a bit and also get rid of the control flag. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have Scan implementation for SQL store?
common/persistence/visibility/store/elasticsearch/visibility_store.go
Outdated
Show resolved
Hide resolved
common/persistence/visibility/store/elasticsearch/visibility_store.go
Outdated
Show resolved
Hide resolved
Not yet, I will add that in a separate PR |
|
||
func (s *visibilityStore) getFieldSorter(fieldSorts []*elastic.FieldSort) []elastic.Sorter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only used by getListFieldSorter
, no need to be a separate function.
|
||
searchParameterBuilder struct { | ||
store *visibilityStore | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not used anywhere. Remove it.
* Change Scan API to have no Order(ES) * Refactoring based on PR comments * PR comments * Fix return order
What changed?
Changed ElasticSearch Scan API to have no order (use "_doc").
Why?
Using sort order "_doc" when using Scan API has some optimizations in ES that
makes it faster to iterate over all workflows.
How did you test it?
Added unit tests
Potential risks
N/A
Is hotfix candidate?
No