HomePhabricator
Diffusion Comm 03f8f3e2324a

[report-service] Implement DB item size checks

Description

[report-service] Implement DB item size checks

Summary:
We're going to store ReportItems in DynamoDB. The maximum item size is 400 KiB. We need to ensure that the items we're storing are not larger than that.
In further diffs, such large reports will be stored in Blob service.

Depends on D8939

Test Plan:

  • Created a ReportItem with very long generated string content. Repeatedly increased length.
  • Printed value of total_size() and inserted the row to DDB.
  • Verified that for values slightly larger than 409600 (400 KiB) insertion failed with ItemTooLargeException.
    • When called ensure_size_constraints() for failing items, the todo!() was hit.
    • When called for smaller, non-failing items, the function returned early.

Reviewers: michal, patryk, varun, jon

Reviewed By: jon

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D8940

Details

Provenance
bartekAuthored on Aug 25 2023, 12:13 AM
Reviewer
jon
Differential Revision
D8940: [report-service] Implement DB item size checks
Parents
rCOMM8db98af8e3da: [report-service] Implement DB row item type
Branches
Unknown
Tags
Unknown