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

[Fetch Migration] Add track_total_hits parameter to doc-count operation #474

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

kartg
Copy link
Member

@kartg kartg commented Dec 13, 2023

Description

The track_total_hits parameter forces an accurate doc-count even when the hit count for _search is above the default 10K limit. This resolves a bug where the total doc count was not being computed properly. Unit tests have also been updated to match the new path.

  • Category: Bug fix

Testing

Tested emperically by performing a Fetch Migration between clusters, including an index with nested documents.
Unit tests:

$ python -m coverage report --omit "*/tests/*"
Name                           Stmts   Miss  Cover
--------------------------------------------------
endpoint_info.py                  24      0   100%
endpoint_utils.py                106      1    99%
fetch_orchestrator.py             72      0   100%
fetch_orchestrator_params.py      22      0   100%
index_diff.py                     20      0   100%
index_doc_count.py                 5      0   100%
index_operations.py               76      0   100%
metadata_migration.py             65      0   100%
metadata_migration_params.py       7      0   100%
metadata_migration_result.py       5      0   100%
migration_monitor.py              90      0   100%
migration_monitor_params.py        6      0   100%
progress_metrics.py               91      0   100%
utils.py                          13      0   100%
--------------------------------------------------
TOTAL                            602      1    99%

Check List

  • New functionality includes testing
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented
  • 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.

Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (17d1555) 73.55% compared to head (70b630f) 73.67%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #474      +/-   ##
============================================
+ Coverage     73.55%   73.67%   +0.12%     
+ Complexity     1182     1180       -2     
============================================
  Files           124      124              
  Lines          4886     4886              
  Branches        439      439              
============================================
+ Hits           3594     3600       +6     
+ Misses          998      992       -6     
  Partials        294      294              
Flag Coverage Δ
unittests 73.67% <ø> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This ensures an accurate doc-count above the default search limit of 10K hits.

Signed-off-by: Kartik Ganesh <[email protected]>
@kartg kartg force-pushed the fetch-doc-count-fix branch from 7c4f7dc to 70b630f Compare December 14, 2023 18:55
@kartg kartg merged commit c14529b into opensearch-project:main Dec 14, 2023
8 checks passed
@kartg kartg deleted the fetch-doc-count-fix branch December 14, 2023 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants