Page MenuHomePhabricator

[blob] Add struct for representing unchecked blobs
ClosedPublic

Authored by bartek on Oct 4 2023, 3:02 AM.
Tags
None
Referenced Files
F3366468: D9350.diff
Mon, Nov 25, 11:34 AM
Unknown Object (File)
Thu, Nov 21, 4:28 AM
Unknown Object (File)
Tue, Nov 19, 8:55 PM
Unknown Object (File)
Fri, Nov 15, 8:03 AM
Unknown Object (File)
Mon, Oct 28, 12:20 PM
Unknown Object (File)
Sun, Oct 27, 4:25 PM
Unknown Object (File)
Oct 18 2024, 4:00 AM
Unknown Object (File)
Oct 17 2024, 10:13 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.