-
Notifications
You must be signed in to change notification settings - Fork 129
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
fix index mapping #384
fix index mapping #384
Conversation
Codecov Report
@@ Coverage Diff @@
## main #384 +/- ##
============================================
- Coverage 92.09% 91.43% -0.67%
- Complexity 519 528 +9
============================================
Files 58 59 +1
Lines 1481 1529 +48
Branches 116 122 +6
============================================
+ Hits 1364 1398 +34
- Misses 78 89 +11
- Partials 39 42 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. |
Signed-off-by: Yaliang Wu <ylwu@amazon.com>
d11c539
to
932ed31
Compare
} else { | ||
listener.onFailure(new MLException("Failed to update index: " + indexName)); | ||
} | ||
}, exception -> { |
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.
Should we set indexMappingUpdated to false explicitly when getting an exception? I am not sure if there is a chance that we get an exception after setting indexMappingUpdated to true. So I recommend set to false here.
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.
The indexMappingUpdated
flag is to make sure we only update the index mapping for first request. indexMappingUpdated
was initialized as false, check line 44-45. We will set the flag as true if
- Index doesn't exist. When create index, it will use latest mapping.
- Index exists but its mapping is already latest (for example, some other request/node already updated the index mapping), then no need to update it.
- Index mapping is old, and we updated its mapping successfully.
For case 1 and 2, they map to line 104-105.
For case3, it maps to line 92.
When we set indexMappingUpdated
as true, that means the index mapping already updated. No matter what happened later, no need to set indexMappingUpdated
as false and update mapping again.
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.
Thanks for the explanation.
listener.onResponse(true); | ||
} | ||
}, e -> { | ||
log.error("Failed to update index mapping", e); |
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.
Same as above.
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.
LGTM, thanks.
Signed-off-by: Yaliang Wu <ylwu@amazon.com> (cherry picked from commit b9036b1)
Signed-off-by: Yaliang Wu <ylwu@amazon.com> (cherry picked from commit b9036b1)
Signed-off-by: Yaliang Wu ylwu@amazon.com
Description
ML model content stored as text by mistake in index. This PR fixed index mapping and store model content as binary.
Issues Resolved
[List any issues this PR will resolve]
Check List
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.