Page MenuHomePhabricator

[blob] Batch check if blob exists
ClosedPublic

Authored by bartek on Sep 26 2024, 12:35 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 11:13 PM
Unknown Object (File)
Sun, Nov 10, 4:18 PM
Unknown Object (File)
Fri, Nov 8, 3:02 AM
Unknown Object (File)
Fri, Nov 8, 3:02 AM
Unknown Object (File)
Nov 1 2024, 4:22 PM
Unknown Object (File)
Nov 1 2024, 5:37 AM
Unknown Object (File)
Oct 31 2024, 11:12 AM
Unknown Object (File)
Oct 26 2024, 3:31 PM
Subscribers

Details

Summary

Instead of calling GetItem for each blob (and get all its data) just to see if it exists, we can re-use db.list_existing_keys() which internally uses BatchGetItem to only get primary keys, all at once.
This improves DDB performance and reduces costs.

Updated batch-add-holders endpoint to use this.

Depends on D13480

Test Plan

Repeated test plan from D13480 confirmed it works the same way.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Sep 26 2024, 12:55 AM
bartek added inline comments.
services/blob/src/http/handlers/holders.rs
54–55 ↗(On Diff #44586)

This part is updated in the next diff

services/blob/src/service.rs
289–291 ↗(On Diff #44586)

This should work too

This revision is now accepted and ready to land.Sep 27 2024, 2:45 AM
This revision was automatically updated to reflect the committed changes.