Skip to content

Commit

Permalink
fix: handle delete markers as delete events
Browse files Browse the repository at this point in the history
Delete markers can be signalled if the buckets is configured to do so, which is the case for app-sre environment. This ensures that index deletion works as expected in those environments.
  • Loading branch information
Ulf Lilleengen committed Oct 5, 2023
1 parent f1c6991 commit 141afe4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ pub struct ContinuationToken(Option<String>);
const PUT_EVENT: &str = "ObjectCreated:Put";
const MULTIPART_PUT_EVENT: &str = "ObjectCreated:CompleteMultipartUpload";
const DELETE_EVENT: &str = "ObjectRemoved:Delete";
const DELETE_MARKER_EVENT: &str = "ObjectRemoved:DeleteMarkerCreated";

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum EventType {
Expand All @@ -525,7 +526,7 @@ impl Record {
pub fn event_type(&self) -> EventType {
if self.event_name.ends_with(PUT_EVENT) || self.event_name.ends_with(MULTIPART_PUT_EVENT) {
EventType::Put
} else if self.event_name.ends_with(DELETE_EVENT) {
} else if self.event_name.ends_with(DELETE_EVENT) || self.event_name.ends_with(DELETE_MARKER_EVENT) {
EventType::Delete
} else {
EventType::Other
Expand Down

0 comments on commit 141afe4

Please sign in to comment.