Page MenuHomePhabricator

[blob] Batch check if blob exists
ClosedPublic

Authored by bartek on Thu, Sep 26, 12:35 AM.
Tags
None
Referenced Files
F2840561: D13481.id44586.diff
Sun, Sep 29, 6:21 AM
F2840055: D13481.diff
Sun, Sep 29, 4:45 AM
F2840004: D13481.diff
Sun, Sep 29, 4:23 AM
Unknown Object (File)
Fri, Sep 27, 7:25 AM
Unknown Object (File)
Fri, Sep 27, 7:06 AM
Unknown Object (File)
Thu, Sep 26, 3:38 PM
Unknown Object (File)
Thu, Sep 26, 1:18 AM
Unknown Object (File)
Thu, Sep 26, 1:15 AM
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.Thu, Sep 26, 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.Fri, Sep 27, 2:45 AM
This revision was automatically updated to reflect the committed changes.