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
1 change: 1 addition & 0 deletions rust/lance/src/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ impl Dataset {
/// # Returns
///
/// * `RemovalStats` - Statistics about the removal operation
#[instrument(level = "debug", skip(self))]
pub fn cleanup_old_versions(
&self,
older_than: Duration,
Expand Down
8 changes: 7 additions & 1 deletion rust/lance/src/dataset/cleanup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use std::{
future,
sync::{Mutex, MutexGuard},
};
use tracing::info;
use tracing::{info, instrument, Span};

use crate::{utils::temporal::utc_now, Dataset};

Expand Down Expand Up @@ -150,6 +150,7 @@ impl<'a> CleanupTask<'a> {
self.delete_unreferenced_files(inspection).await
}

#[instrument(level = "debug", skip_all)]
async fn process_manifests(
&'a self,
tagged_versions: &HashSet<u64>,
Expand Down Expand Up @@ -246,6 +247,7 @@ impl<'a> CleanupTask<'a> {
Ok(())
}

#[instrument(level = "debug", skip_all, fields(old_versions = inspection.old_manifests.len(), bytes_removed = tracing::field::Empty))]
async fn delete_unreferenced_files(
&self,
inspection: CleanupInspection,
Expand Down Expand Up @@ -306,6 +308,10 @@ impl<'a> CleanupTask<'a> {
let mut removal_stats = removal_stats.into_inner().unwrap();
removal_stats.old_versions = num_old_manifests as u64;
removal_stats.bytes_removed += manifest_bytes_removed?;

let span = Span::current();
span.record("bytes_removed", removal_stats.bytes_removed);

Ok(removal_stats)
}

Expand Down
Loading