Skip to content
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

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

jmazanec15
Copy link
Member

@jmazanec15 jmazanec15 commented Mar 26, 2025

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

  • Commits are signed per the DCO using --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.

@jmazanec15 jmazanec15 force-pushed the derived-translog-fix branch 2 times, most recently from a7e5c58 to 45f159c Compare March 26, 2025 16:45
@jmazanec15 jmazanec15 marked this pull request as ready for review March 26, 2025 16:45
@jmazanec15 jmazanec15 force-pushed the derived-translog-fix branch from 45f159c to 1cac747 Compare March 26, 2025 16:46
@jmazanec15 jmazanec15 added Bug Fixes Changes to a system or product designed to handle a programming bug/glitch v3.0.0 and removed skip-changelog labels Mar 26, 2025
@jmazanec15 jmazanec15 force-pushed the derived-translog-fix branch from 1cac747 to 50e57c4 Compare March 26, 2025 18:09
@jmazanec15 jmazanec15 force-pushed the derived-translog-fix branch 2 times, most recently from 6915d4c to da2376d Compare March 26, 2025 18:47
@0ctopus13prime
Copy link
Collaborator

Also wondering, if the performance is concerning, do we need to quickly run a small benchmark to have tentative numbers on the impact?

@jmazanec15 jmazanec15 force-pushed the derived-translog-fix branch 2 times, most recently from f3a0284 to 0401483 Compare March 26, 2025 20:49
@@ -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
Copy link
Member Author

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.

@jmazanec15 jmazanec15 force-pushed the derived-translog-fix branch 2 times, most recently from 93b4066 to f7d0d4d Compare March 26, 2025 21:33
@jmazanec15
Copy link
Member Author

Also wondering, if the performance is concerning, do we need to quickly run a small benchmark to have tentative numbers on the impact?

Yes, Im going to run some benchmarks after I get it working functionally.

@jmazanec15 jmazanec15 force-pushed the derived-translog-fix branch 4 times, most recently from 23ec8f4 to 4e85167 Compare March 27, 2025 02:12
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]>
@jmazanec15 jmazanec15 merged commit f3f4767 into opensearch-project:main Mar 27, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fixes Changes to a system or product designed to handle a programming bug/glitch v3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Derived source feature can fail with Lucene based recovery
5 participants