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)
Fri, Jun 14, 9:08 PM
Unknown Object (File)
Fri, Jun 14, 6:04 AM
Unknown Object (File)
Fri, Jun 14, 1:20 AM
Unknown Object (File)
Tue, Jun 11, 4:28 PM
Unknown Object (File)
Sat, May 25, 7:20 PM
Unknown Object (File)
Mon, May 20, 1:07 AM
Unknown Object (File)
May 10 2024, 12:40 AM
Unknown Object (File)
May 4 2024, 6:24 PM
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
Lint Not Applicable
Unit
Tests Not Applicable

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.