[DFAE] Fix memory allocation failure in write request path to fail request instead of shard#22415
[DFAE] Fix memory allocation failure in write request path to fail request instead of shard#22415mgodwan wants to merge 1 commit into
Conversation
…ather than shard Signed-off-by: Mohit Godwani <mgodwan@amazon.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
❌ Gradle check result for c647ecc: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22415 +/- ##
============================================
- Coverage 73.45% 73.43% -0.02%
+ Complexity 76153 76121 -32
============================================
Files 6076 6076
Lines 345518 345518
Branches 49733 49733
============================================
- Hits 253815 253747 -68
- Misses 71486 71515 +29
- Partials 20217 20256 +39 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| // Constrain the ingest pool so hard that the first VSR buffer allocation for a single | ||
| // document throws an Arrow OutOfMemoryException. No writer/VSR exists yet, so no ingest | ||
| // memory is in use at this point and lowering the limit is safe. | ||
| setIngestPoolLimit(0L, 1L); |
There was a problem hiding this comment.
Nit - can we also disable rebalancer to avoid flakiness ?
| @@ -151,7 +152,7 @@ public WriteResult addDoc(ParquetDocumentInput d) throws IOException { | |||
| // caller-driven rollback no-ops in the VSR and restores ACTIVE. | |||
| try { | |||
| vsrManager.addDocument(d); | |||
| } catch (MismatchedInputException e) { | |||
| } catch (MismatchedInputException | OutOfMemoryException e) { | |||
There was a problem hiding this comment.
While going through the rollback flow, noticed that we might enter into a corrupt state, as we are just setting row counts while rolling back our VSR. Any stale values are not cleared and if the same VSR is re-used (which it is as we change the status back to ACTIVE from PENDING_ROLLBACK after the reset the row count), values from previous document might remain (in case those fields are empty in the new doc).
Trying to validate this scenario using an IT, but since it is an existing issue, not blocking this PR - will open an issue once able to validate using IT.
Fix memory allocation failure in write request path to fail request instead of shard
Description
[Describe what this change achieves]
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
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.