mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-07 04:25:54 +00:00
fix(ilm): notify on batch noncurrent version expiry (#7116)
The batch `NewerNoncurrentVersions` expiry path took a lifecycle event argument and ignored it: after `delete_objects` committed it only evicted the cache and scheduled replication deletes, so a successful noncurrent version expiry was invisible to notification subscribers while the equivalent current-version path emitted a lifecycle expiration event. Emit that event from the batch path too, reusing the existing lifecycle audit sink and event contract. Only entries that actually mutated something are announced, and cache eviction and replication scheduling keep their existing order and admission — the event is derived from the committed result and a send failure never rolls back a delete. "No error" is not enough to prove a mutation: the disk layer skips an absent version and reports success, so a batch entry for a version that was already gone came back indistinguishable from a committed delete. The delete plan already resolves whether the source exists, so carry that `source_missing` result on `DeletedObject` and let the lifecycle path stay silent for versions it did not remove. backlog#2202
This commit is contained in:
@@ -243,6 +243,16 @@ impl ObjectToDelete {
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct DeletedObject {
|
||||
pub delete_marker: bool,
|
||||
/// True when the delete plan looked the target up and found no such
|
||||
/// object or version.
|
||||
///
|
||||
/// The lookup only runs when the plan needs the source (Object Lock
|
||||
/// check, replication decision, tier journal, or an expected identity),
|
||||
/// so this proves absence and never proves presence: it stays false when
|
||||
/// no lookup ran. Callers that must not announce a delete that removed
|
||||
/// nothing need this, because the disk layer treats an absent version as
|
||||
/// an idempotent success and reports `found` regardless.
|
||||
pub source_missing: bool,
|
||||
pub delete_marker_version_id: Option<Uuid>,
|
||||
pub object_name: String,
|
||||
pub version_id: Option<Uuid>,
|
||||
|
||||
Reference in New Issue
Block a user