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
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use tracing::{info, warn};

use crate::storage_engines::sketch_db::backfill::{BackfillRegistry, BackfillStatus};
use crate::storage_engines::sketch_db::index::SketchStore;
use super::{AggStatus, SchemaRegistry};
use crate::storage_engines::sketch_db::schema::{AggStatus, SchemaRegistry};

/// Configuration for the eviction loop. Separate from
/// `SchemaRegistry`'s `retirement_retention` because the service
Expand Down
27 changes: 27 additions & 0 deletions data_plane/src/storage_engines/sketch_db/lifecycle/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//! Sid lifecycle — `Active`/`Retired`/`Expired` over per-sid metadata,
//! eviction services, and the ingest barrier.
//!
//! Post-M2.3 reorg #5. The sid-level lifecycle state itself (the
//! `retired_at_ms` / `expires_at_ms` fields on
//! [`crate::storage_engines::sketch_db::index::SketchInstanceMetadata`],
//! plus `force_retire` / `force_expire` / `is_writable` / `list_by_status`
//! / `remove_instance` / `remove_instances_for_agg_config` methods on
//! `SketchStore`) lives in `index/` next to the data it gates. This
//! module owns the **services** that drive lifecycle transitions:
//!
//! - [`eviction::SchemaEvictionService`] — background tokio task that
//! sweeps `Expired` agg-configs (from the `SchemaRegistry`) and
//! removes their residual sids from `SketchStore` via
//! `remove_instances_for_agg_config`. Schedule-driven half of the
//! "controller dropped a config → its sids go away" flow.
//!
//! Future content:
//! - `reconcile_from_streaming_config` — once schema/ is retired, the
//! "controller-reconcile-driven bulk-retire" entrypoint moves here
//! and operates on sids directly.

pub mod eviction;

pub use eviction::{
warn_if_retention_inverted, SchemaEvictionConfig, SchemaEvictionHandle, SchemaEvictionService,
};
1 change: 1 addition & 0 deletions data_plane/src/storage_engines/sketch_db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub mod accuracy;
pub mod backfill;
pub mod data;
pub mod index;
pub mod lifecycle;
pub mod metrics;
pub mod persistence;
pub mod query;
Expand Down
7 changes: 4 additions & 3 deletions data_plane/src/storage_engines/sketch_db/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1276,8 +1276,9 @@ mod tests {
}
}

// 2026-05 reorg: schema_eviction.rs moved alongside as a submodule.
pub mod eviction;
pub use eviction::{
// Post-M2.3 reorg: eviction moved to `sketch_db::lifecycle::eviction`.
// Legacy re-exports keep `sketch_db::schema::SchemaEvictionService` callers
// compiling until they migrate to `sketch_db::lifecycle::*`.
pub use crate::storage_engines::sketch_db::lifecycle::{
warn_if_retention_inverted, SchemaEvictionConfig, SchemaEvictionHandle, SchemaEvictionService,
};