-
Notifications
You must be signed in to change notification settings - Fork 144
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
Add index operation listener to update translog source #2629
Add index operation listener to update translog source #2629
Conversation
a7e5c58
to
45f159c
Compare
45f159c
to
1cac747
Compare
1cac747
to
50e57c4
Compare
...va/org/opensearch/knn/index/codec/KNN10010Codec/KNN10010DerivedSourceStoredFieldsWriter.java
Show resolved
Hide resolved
...n/java/org/opensearch/knn/index/codec/derivedsource/DerivedSourceIndexOperationListener.java
Show resolved
Hide resolved
...n/java/org/opensearch/knn/index/codec/derivedsource/DerivedSourceIndexOperationListener.java
Show resolved
Hide resolved
...n/java/org/opensearch/knn/index/codec/derivedsource/DerivedSourceIndexOperationListener.java
Show resolved
Hide resolved
6915d4c
to
da2376d
Compare
Also wondering, if the performance is concerning, do we need to quickly run a small benchmark to have tentative numbers on the impact? |
f3a0284
to
0401483
Compare
@@ -48,7 +48,7 @@ public KNN10010DerivedSourceStoredFieldsWriter(StoredFieldsWriter delegate, List | |||
if (vectorFieldTypes.isEmpty() == false) { | |||
this.vectorMask = XContentMapValues.transform( | |||
vectorFieldTypes.stream().collect(Collectors.toMap(k -> k, k -> (Object o) -> o == null ? o : MASK)), | |||
false | |||
true |
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.
Performing in place map modification - we create and own the lifecycle of the map so we can do this.
...va/org/opensearch/knn/index/codec/KNN10010Codec/KNN10010DerivedSourceStoredFieldsWriter.java
Show resolved
Hide resolved
...n/java/org/opensearch/knn/index/codec/derivedsource/DerivedSourceIndexOperationListener.java
Show resolved
Hide resolved
...n/java/org/opensearch/knn/index/codec/derivedsource/DerivedSourceIndexOperationListener.java
Show resolved
Hide resolved
...n/java/org/opensearch/knn/index/codec/derivedsource/DerivedSourceIndexOperationListener.java
Show resolved
Hide resolved
93b4066
to
f7d0d4d
Compare
Yes, Im going to run some benchmarks after I get it working functionally. |
23ec8f4
to
4e85167
Compare
Adds an index operation listener to update the source to match the source getting stored to the stored fields. This ensures that on certain recovery events, we can be sure that duplicate operations do not cause conflicts. Along with this, updated integration tests to be more robust. Signed-off-by: John Mazanec <[email protected]>
4e85167
to
1027836
Compare
Description
Adds an index operation listener to update the source to match the source getting stored to the stored fields. This ensures that on certain recovery events, we can be sure that duplicate operations do not cause conflicts.
Along with this, updated integration tests to be more robust. See DerivedSourceTestCase for cases covered so far. Logic is shared with the bwc test.
Also, as part of #2626, I made source changes in place.
In future PR, I will add more optimizations and also add logic for blocking in certain cases.
Related Issues
Resolves #2625
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.