Replace _id sort with _seq_no in JobSweeper to fix fielddata error - #2039
Conversation
|
_seq_no gives an ordering of write operations on a shard |
AWSHurneyt
left a comment
There was a problem hiding this comment.
Approving. @manaswini1920 could we take adding those integ tests as a fast follow-up item? Those seem like important cases to catch.
948abb1 to
754b8eb
Compare
Updated the PR with unmappedType and try catch changes. Ran integ tests locally : |
754b8eb to
33de4e3
Compare
@AWSHurneyt Added these in latest revision : both passed locally :
|
When indices.id_field_data.enabled is set to false, the JobSweeper fails
with 'Fielddata access on the _id field is disallowed' because it sorts
by _id during search_after pagination.
This replaces FieldSortBuilder("_id") with FieldSortBuilder("_seq_no").
_seq_no has doc_values enabled by default (no fielddata needed) and is
unique per shard, which the sweeper already scopes to via _shards preference.
Resolves opensearch-project#2037
Signed-off-by: Manaswini Ragamouni <ragamanu@amazon.com>
33de4e3 to
e3735a7
Compare
Description
When indices.id_field_data.enabled is set to false, the JobSweeper fails with Fielddata access on the _id field is disallowed because it sorts by _id during search_after pagination.
This replaces FieldSortBuilder("_id") with FieldSortBuilder("_seq_no"). _seq_no has doc_values enabled by default (no fielddata needed) and is unique per shard, which the sweeper already scopes to via _shards preference.
Resolves #2037
Related Issues
Resolves #2037
Testing
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.