Page MenuHomePhabricator

[backup] Update LogItem struct
ClosedPublic

Authored by michal on Dec 19 2023, 7:16 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jul 5, 7:51 AM
Unknown Object (File)
Tue, Jul 2, 3:33 AM
Unknown Object (File)
Sun, Jun 30, 2:36 AM
Unknown Object (File)
Fri, Jun 28, 1:58 PM
Unknown Object (File)
Thu, Jun 27, 7:24 AM
Unknown Object (File)
Tue, Jun 25, 4:32 AM
Unknown Object (File)
Sat, Jun 22, 8:23 AM
Unknown Object (File)
Sat, Jun 22, 8:15 AM
Subscribers

Details

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.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek added inline comments.
services/terraform/modules/shared/dynamodb.tf
44 ↗(On Diff #34847)

Please remember about terraform apply on prod and staging when landing this 😉

This revision is now accepted and ready to land.Dec 20 2023, 12:22 AM