Skip to content

Count invalid server-generated upload IDs - #3304

Merged
nicolaslopezbravo merged 5 commits into
linkedin:masterfrom
nicolaslopezbravo:nbravo-linkedin-upload-blob-id-errors
Oct 8, 2026
Merged

nicolaslopezbravo merged 5 commits into
linkedin:masterfrom
nicolaslopezbravo:nbravo-linkedin-upload-blob-id-errors

Conversation

@nicolaslopezbravo

@nicolaslopezbravo nicolaslopezbravo commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add FrontendRestRequestService.GeneratedBlobIdError to count InvalidBlobId failures while consuming server-generated upload IDs, including ID conversion and permanent-blob finalization.

Track generated-ID processing stages so invalid client-supplied IDs, including stitch chunk IDs, are excluded from the counter.

HTTP status codes, SLO accounting, callback exceptions, storage writes, cleanup, and retry behavior remain unchanged.

Excluding client-supplied IDs

BLOB_ID_IS_SERVER_GENERATED is set only after a successful router upload/stitch result. Client-supplied stitch chunk IDs are validated before that point; failures propagate without setting the marker.

The counter increments only when both the marker is true and the error is RouterErrorCode.InvalidBlobId. The marker is cleared after successful generated-ID processing, before subsequent response handling.

Tests inject failures at router, ID-conversion, and TTL-finalization stages, verifying zero increments for router-stage input failures and one increment for qualifying generated-ID failures. These tests verify the callback boundary; they do not exercise malformed chunk IDs through the real stitch parser.

Testing Done

Validated on JDK 11:

  • 30 frontend tests and 2 router parameterizations passed.
  • 6 existing frontend-config tests passed.
  • Applied the complete patch to v0.5.194 and passed 4 focused frontend tests, 2 router parameterizations, and 6 config tests.

Coverage includes exactly-once metric increments, exclusion of client-supplied invalid IDs and unrelated failures, unchanged HTTP classification and exception causes, successful-path marker cleanup, and asynchronous ID conversion.

Copilot assisted with implementation and tests.

Nick Lopez and others added 4 commits September 28, 2026 17:33
Clients cannot correct malformed IDs produced during upload finalization.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Classify generated IDs at the existing REST mapping boundary so operation callbacks retain their original exceptions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Count invalid generated upload IDs independently of a trusted, default-off HTTP classification gate.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use a default-off frontend property to control HTTP classification while counting generated ID failures independently.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@codecov-commenter

codecov-commenter commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.83333% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.75%. Comparing base (52ba813) to head (cdd5d33).
⚠️ Report is 423 commits behind head on master.

Files with missing lines Patch % Lines
...hub/ambry/frontend/FrontendRestRequestService.java 40.00% 2 Missing and 1 partial ⚠️
...com/github/ambry/frontend/NamedBlobPutHandler.java 50.00% 3 Missing ⚠️
...ava/com/github/ambry/router/NonBlockingRouter.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #3304       +/-   ##
=============================================
- Coverage     64.24%   50.75%   -13.50%     
+ Complexity    10398     8713     -1685     
=============================================
  Files           840      939       +99     
  Lines         71755    80824     +9069     
  Branches       8611     9752     +1141     
=============================================
- Hits          46099    41022     -5077     
- Misses        23004    36399    +13395     
- Partials       2652     3403      +751     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Count server-generated invalid IDs separately while preserving HTTP status mapping and callback exceptions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@nicolaslopezbravo nicolaslopezbravo changed the title reclassify upload blob id errors Count invalid server-generated upload IDs Oct 8, 2026
@nicolaslopezbravo
nicolaslopezbravo merged commit e3de3ed into linkedin:master Oct 8, 2026
11 checks passed
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.

3 participants