HomePhabricator
Diffusion Comm 1d7761d230c4

[backup] Update LogItem struct

Description

[backup] Update LogItem struct

Summary:
Update the current log item implementation:

  • Changed log id to number (the only dynamodb change)
  • Used BlobOrDBContent for content and Vec<BlobInfo> for attachments
  • Added ensure_size_constraints function
  • Implemented From and TryFrom for AttributeValue
  • Removed existing db operations for log items (the new improved version will be included in the later diffs)
  • Improved constants

Depends on D10405

Test Plan:
Created log item:

LogItem {
  backup_id: "backup_id".to_string(),
  log_id: 124,
  content: BlobOrDBContent::new(vec![0; 2000]),
  attachments: vec![],
};

Called ensure_size_constraints, uploaded it to dynamodb and downloaded it again.

  • Checked that blob service wasn't used in this case
  • Checked that the downloaded item was the same

Changed the dynamodb item size limit to a smaller value (200 bytes) and repeated the test. This time the content was uploaded to blob service.

Reviewers: bartek, kamil

Reviewed By: bartek

Subscribers: ashoat, tomek

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

Details

Provenance
Michal Gniadek <michal.gniadek@swmansion.com>Authored on Dec 14 2023, 4:45 AM
Reviewer
bartek
Differential Revision
D10406: [backup] Update LogItem struct
Parents
rCOMM3beaf4873912: [comm-lib] Function for calculating dynamodb item size
Branches
Unknown
Tags
Unknown

Event Timeline

Michal Gniadek <michal.gniadek@swmansion.com> committed rCOMM1d7761d230c4: [backup] Update LogItem struct (authored by Michal Gniadek <michal.gniadek@swmansion.com>).Jan 8 2024, 7:19 AM