Page MenuHomePhabricator

[blob] Add struct for representing unchecked blobs
ClosedPublic

Authored by bartek on Oct 4 2023, 3:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 28, 12:20 PM
Unknown Object (File)
Sun, Oct 27, 4:25 PM
Unknown Object (File)
Fri, Oct 18, 4:00 AM
Unknown Object (File)
Thu, Oct 17, 10:13 PM
Unknown Object (File)
Sat, Oct 12, 9:26 PM
Unknown Object (File)
Sat, Oct 12, 2:34 PM
Unknown Object (File)
Sep 28 2024, 12:24 AM
Unknown Object (File)
Sep 28 2024, 12:24 AM
Subscribers

Details

Summary

Added a struct for representing unchecked items in database. It greatly simplifies the cleanup job.
It is used in the next two diffs

Depends on D9349

Test Plan

Code compiles, implementation is tested in the next two diffs.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Oct 4 2023, 3:20 AM
tomek added 1 blocking reviewer(s): michal.
michal added inline comments.
services/blob/src/service.rs
232–235 ↗(On Diff #31786)

From looking at the later code it seems like we could just have:

struct UncheckedItem {
  has_hash: bool,
  holders: Vec<String>,
};

but it's fine the way it is now.

If dynamodb allowed deletion with just partition key we could even just have has_holders: bool...

277 ↗(On Diff #31786)

Can you add a comment (or a type alias) that explains what a String is in this case?

This revision is now accepted and ready to land.Oct 10 2023, 6:09 AM
services/blob/src/service.rs
232–235 ↗(On Diff #31786)

Theoretically yes, at some point I even considered that. However, I wanted each UncheckedItem to be independent: to contain full information about blob, regardless if it's inside or outside a map-like collection.

Address feedback: Add type alias for blob hash, use ref instead of cloning.