Page MenuHomePhabricator

[backup] Update LogItem struct
ClosedPublic

Authored by michal on Dec 19 2023, 7:16 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 24, 5:00 AM
Unknown Object (File)
Sun, Dec 22, 11:24 PM
Unknown Object (File)
Sun, Dec 22, 11:24 PM
Unknown Object (File)
Sun, Dec 22, 11:23 PM
Unknown Object (File)
Sun, Dec 22, 11:23 PM
Unknown Object (File)
Nov 16 2024, 7:33 PM
Unknown Object (File)
Nov 16 2024, 7:33 PM
Unknown Object (File)
Nov 16 2024, 7:33 PM
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