Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/hottier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use crate::{
handlers::http::cluster::PMETA_STREAM_NAME,
parseable::PARSEABLE,
storage::{ObjectStorageError, field_stats::DATASET_STATS_STREAM_NAME},
tenants::TENANT_METADATA,
utils::{extract_datetime, human_size::bytes_to_human_size},
validator::error::HotTierValidationError,
};
Expand Down Expand Up @@ -787,6 +788,13 @@ impl HotTierManager {
};

for tenant_id in tenants {
// Skip suspended tenants — their hot tier directories are cleaned up on suspension
if let Some(tid) = tenant_id.as_ref()
&& TENANT_METADATA.is_workspace_suspended(tid)
{
continue;
}

if !self.check_stream_hot_tier_exists(PMETA_STREAM_NAME, &tenant_id) {
let mut stream_hot_tier = StreamHotTier {
version: Some(CURRENT_HOT_TIER_VERSION.to_string()),
Expand All @@ -810,6 +818,13 @@ impl HotTierManager {
vec![None]
};
for tenant_id in tenants {
// Skip suspended tenants — their hot tier directories are cleaned up on suspension
if let Some(tid) = tenant_id.as_ref()
&& TENANT_METADATA.is_workspace_suspended(tid)
{
continue;
}

// Check if pstats hot tier already exists
if !self.check_stream_hot_tier_exists(DATASET_STATS_STREAM_NAME, &tenant_id) {
// Check if pstats stream exists in storage by attempting to load it
Expand Down
7 changes: 7 additions & 0 deletions src/tenants/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ impl TenantMetadata {
}
}

pub fn is_workspace_suspended(&self, tenant_id: &str) -> bool {
self.tenants
.get(tenant_id)
.map(|t| t.suspended_services.contains(&Service::Workspace))
.unwrap_or(false)
}

pub fn get_tenants(&self) -> Vec<(String, StorageMetadata)> {
self.tenants
.iter()
Expand Down
Loading