Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3489943
D11355.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11355.diff
View Options
diff --git a/services/backup/src/database/mod.rs b/services/backup/src/database/mod.rs
--- a/services/backup/src/database/mod.rs
+++ b/services/backup/src/database/mod.rs
@@ -229,14 +229,19 @@
/// Backup log functions
impl DatabaseClient {
- pub async fn put_log_item(&self, log_item: LogItem) -> Result<(), Error> {
+ pub async fn put_log_item(
+ &self,
+ log_item: LogItem,
+ blob_client: &BlobServiceClient,
+ ) -> Result<(), Error> {
let item = log_item.into();
- self
+ let result = self
.client
.put_item()
.table_name(log_table::TABLE_NAME)
.set_item(Some(item))
+ .return_values(ReturnValue::AllOld)
.send()
.await
.map_err(|e| {
@@ -244,6 +249,17 @@
Error::AwsSdk(e.into())
})?;
+ let Some(replaced_log_attrs) = result.attributes else {
+ return Ok(());
+ };
+
+ let Ok(replaced_log) = LogItem::try_from(replaced_log_attrs) else {
+ warn!("Couldn't parse replaced log item");
+ return Ok(());
+ };
+
+ replaced_log.revoke_holders(blob_client);
+
Ok(())
}
diff --git a/services/backup/src/http/handlers/log.rs b/services/backup/src/http/handlers/log.rs
--- a/services/backup/src/http/handlers/log.rs
+++ b/services/backup/src/http/handlers/log.rs
@@ -170,7 +170,7 @@
};
log_item.ensure_size_constraints(&blob_client).await?;
- db_client.put_log_item(log_item).await?;
+ db_client.put_log_item(log_item, &blob_client).await?;
Ok(vec![LogWSResponse::LogUploaded { backup_id, log_id }])
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 2:12 PM (18 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2677654
Default Alt Text
D11355.diff (1 KB)
Attached To
Mode
D11355: [backup] Revoke holders of replaced log items
Attached
Detach File
Event Timeline
Log In to Comment