Skip to content

Commit 60ce88c

Browse files
authored
fix: make retention path tenant aware (#1838)
1 parent bbbb79e commit 60ce88c

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎src/storage/retention.rs‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ impl From<Retention> for Vec<TaskView> {
207207
}
208208

209209
mod action {
210-
use crate::catalog::remove_manifest_from_snapshot;
211210
use crate::parseable::PARSEABLE;
212211
use crate::tenants::TENANT_METADATA;
212+
use crate::{catalog::remove_manifest_from_snapshot, parseable::DEFAULT_TENANT};
213213
use chrono::{Days, NaiveDate, Utc};
214214
use futures::{StreamExt, stream::FuturesUnordered};
215215
use itertools::Itertools;
@@ -251,7 +251,15 @@ mod action {
251251
}
252252

253253
for date in dates_to_delete {
254-
let path = RelativePathBuf::from_iter([&stream_name, &date]);
254+
// path should be tenant aware
255+
let tenant = if let Some(tenant) = tenant_id
256+
&& tenant != DEFAULT_TENANT
257+
{
258+
tenant
259+
} else {
260+
""
261+
};
262+
let path = RelativePathBuf::from_iter([tenant, &stream_name, &date]);
255263
delete_tasks.push(async move {
256264
PARSEABLE
257265
.storage

0 commit comments

Comments
 (0)