Fix handling of deletes during leading segment merge#242
Conversation
1a86b39 to
ef6ffa2
Compare
|
I'm mostly done with the main code, barring a few tweaks. I'm still planning to add better tests. |
|
This PR is essentially done, but there are conflicts because of the revert that was just merged. |
…ch-project#240)" This reverts commit 4453ba9. Reverting the revert to be able to apply the fix. Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com>
Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com>
These commits will all be squashed anyway, so this change helps reduce the splash zone of the final squashed commit without affecting functionality. Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com>
6a8e24d to
a1159ed
Compare
Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com>
|
|
how do we disable this feature in production if we had to? Is it possible to enable/disable it via a config? This is to avoid a repeat of what happened in our scale test environment. |
|
Leading segment merge is automatically disabled once the number of live vectors involved the merge crosses the threshold for using PQ. One way to turn it off completely is to set a PQ threshold below the minimum segment size. Note that the error you saw in the test environment wasn't because of leading segment merge per se, rather because of a bug in the way that ord <-> docId mappings were being saved. The bug was introduced as part of the changes to support deletions in the context of leading segment merge. |
Thanks for alleviating my concern here. Yes, understand the bug was due to the ordinal mappings, which your PR addresses. |
bbff4cb to
909cc32
Compare
Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com>
Also tweak some logs Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com>
909cc32 to
755ee43
Compare
|
I added a configuration parameter Note that I added this by looking at how the other parameters were configured. It should be enough to allow the configuration to be set in Opensearch and propagated to the plugin, and the test in |
f33bb41
into
opensearch-project:main
* Revert "Revert of support deletes for incremental insertion (#240)" This reverts commit 4453ba9. Reverting the revert to be able to apply the fix. Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> * Fix leading segment merge under deletions Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> * Refine the "undo revert" commit These commits will all be squashed anyway, so this change helps reduce the splash zone of the final squashed commit without affecting functionality. Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> * Add/fix changelog entries Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> * Review comment updates Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> * Add config to disable leading segment merge Also tweak some logs Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> --------- Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> (cherry picked from commit f33bb41)
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-3.3 3.3
# Navigate to the new working tree
cd .worktrees/backport-3.3
# Create a new branch
git switch --create backport/backport-242-to-3.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 f33bb417ae2a63d5902426bbf0f8d7aa07d80e7d
# Push it to GitHub
git push --set-upstream origin backport/backport-242-to-3.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-3.3Then, create a pull request where the |
* Revert "Revert of support deletes for incremental insertion (#240)" This reverts commit 4453ba9. Reverting the revert to be able to apply the fix. Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> * Fix leading segment merge under deletions Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> * Refine the "undo revert" commit These commits will all be squashed anyway, so this change helps reduce the splash zone of the final squashed commit without affecting functionality. Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> * Add/fix changelog entries Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> * Review comment updates Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> * Add config to disable leading segment merge Also tweak some logs Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> --------- Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> (cherry picked from commit f33bb41)
* Revert "Revert of support deletes for incremental insertion (#240)" This reverts commit 4453ba9. Reverting the revert to be able to apply the fix. * Fix leading segment merge under deletions * Refine the "undo revert" commit These commits will all be squashed anyway, so this change helps reduce the splash zone of the final squashed commit without affecting functionality. * Add/fix changelog entries * Review comment updates * Add config to disable leading segment merge Also tweak some logs --------- (cherry picked from commit f33bb41) Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> Co-authored-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com>
…ect#242) * Revert "Revert of support deletes for incremental insertion (opensearch-project#240)" This reverts commit 4453ba9. Reverting the revert to be able to apply the fix. Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> * Fix leading segment merge under deletions Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> * Refine the "undo revert" commit These commits will all be squashed anyway, so this change helps reduce the splash zone of the final squashed commit without affecting functionality. Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> * Add/fix changelog entries Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> * Review comment updates Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> * Add config to disable leading segment merge Also tweak some logs Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> --------- Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> (cherry picked from commit f33bb41)
* Revert "Revert of support deletes for incremental insertion (#240)" This reverts commit 4453ba9. Reverting the revert to be able to apply the fix. * Fix leading segment merge under deletions * Refine the "undo revert" commit These commits will all be squashed anyway, so this change helps reduce the splash zone of the final squashed commit without affecting functionality. * Add/fix changelog entries * Review comment updates * Add config to disable leading segment merge Also tweak some logs --------- (cherry picked from commit f33bb41) Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> Co-authored-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> Co-authored-by: Akash Shankaran <akash.shankaran1@gmail.com>
* Revert "Revert of support deletes for incremental insertion (#240)" This reverts commit 4453ba9. Reverting the revert to be able to apply the fix. * Fix leading segment merge under deletions * Refine the "undo revert" commit These commits will all be squashed anyway, so this change helps reduce the splash zone of the final squashed commit without affecting functionality. * Add/fix changelog entries * Review comment updates * Add config to disable leading segment merge Also tweak some logs --------- (cherry picked from commit f33bb41) Signed-off-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com> Co-authored-by: Ashwin Krishna Kumar <nebulousmagneticwind@outlook.com>
Description
This PR fixes the issues with the leading segment merge logic which show up when delete operations are involved. A set of test cases are added which fail in the absence of the changes in this PR (prior to the revert).
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
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.