pub trait PurgeExecutor:
Send
+ Sync
+ 'static {
// Required method
fn execute_purge<'life0, 'async_trait>(
&'life0 self,
last_included: LogId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn validate_purge<'life0, 'async_trait>(
&'life0 self,
last_included: LogId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn pre_purge<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn post_purge<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Defines the behavior for log entry compaction and physical deletion.
§Safety Requirements
Implementations MUST guarantee:
- All entries up to
last_included.indexare preserved in snapshots - No concurrent modifications during purge execution
- Atomic persistence of purge metadata
Required Methods§
Provided Methods§
Sourcefn validate_purge<'life0, 'async_trait>(
&'life0 self,
last_included: LogId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn validate_purge<'life0, 'async_trait>(
&'life0 self,
last_included: LogId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Validates if purge can be safely executed
§Key Characteristics
- Stateless: Does NOT validate Raft protocol state (commit index/purge order/cluster progress)
- Storage-focused: Performs physical storage checks (disk space/snapshot integrity/I/O health)
Default implementation checks:
- No pending purge operations