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

Adding subshard work items on lease expiry #1198

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Adding subshard work items on lease expiry #1198

wants to merge 10 commits into from

Conversation

AndreKurait
Copy link
Member

Description

Continuation on #1160

Changes since #1160

  • Added LeaseExpirationTest that refreshes after every bulk put to synthetically generate more segments for the test case.
  • Added Binary search to more efficiently find the starting document segment
  • Modified initial segment sorting with error logging on equality

  • Added code to finish and create remainder work item when a lease expires.

Behavior changes is as follows:

  • Updates the LuceneDocumentsReader to sort the segments and emit docs in sequence, and skip until passed in startingDocId. Note: Docs within a segment are still read in parallel, just emitted in sequence once aggregated together.
  • Updates the RfsLuceneDocument to contain the luceneDocId (segmentBaseDoc + docId)
  • Updates the DocumentReindexer to emit a flux of the latest sequential docId processed.
  • Updates the DocumentsRunner to plum context from work item progress and cancellation to the LeaseEnd
  • Updates the OpenSearchWorkCoordinator to rename numAttempts to nextAcquisitionLeaseExponent (incrementing script version from poc -> 2.0)
  • Updates exitOnLeaseTimeout to handle cancelling document reindexing work, and creating successor work item based on progress checkpoint and shard work timing. Logic below.

The lease time increase logic has changed. Behavior is as follows:

  • If worker did not have enough time to process any docs, time is doubled for next run.
  • else
    • If worker spent more than 10% of time downloading/extracting the shard, double the lease time for the next run
    • else if worker spent less then 2.5% of time downloading/extracting the shard, half the lease time for next run
    • else keep lease time same for successive run

Added E2E test as follows:

  • Create docs with workload generator, set up toxiproxy and leases to ensure will take 8 40 second leases to finish shard with checkpoints. Verify exit codes and docs migrated

Issues Resolved

Testing

Tested in AWS and added new E2E test around the scenario

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 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.40%. Comparing base (d45f4f3) to head (c7a5ff7).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1198      +/-   ##
============================================
- Coverage     80.64%   80.40%   -0.24%     
- Complexity     3076     3098      +22     
============================================
  Files           421      423       +2     
  Lines         15610    15819     +209     
  Branches       1053     1066      +13     
============================================
+ Hits          12588    12719     +131     
- Misses         2381     2456      +75     
- Partials        641      644       +3     
Flag Coverage Δ
unittests 80.40% <ø> (-0.24%) ⬇️

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.

Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the holidays coming up - lets hold off on merging this until after we've got a fuller crew in house.

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