diff --git a/influxdb3_clap_blocks/src/object_store.rs b/influxdb3_clap_blocks/src/object_store.rs index 5bb8b77ef3..5728902ad8 100644 --- a/influxdb3_clap_blocks/src/object_store.rs +++ b/influxdb3_clap_blocks/src/object_store.rs @@ -117,11 +117,14 @@ impl std::fmt::Display for LocalFileSystemWithSortedListOp { impl LocalFileSystemWithSortedListOp { fn new_with_prefix(prefix: impl AsRef) -> Result { Ok(Self { - inner: Arc::new(LocalFileSystem::new_with_prefix(prefix.as_ref()).context( - CreateLocalFileSystemSnafu { - path: prefix.as_ref().to_path_buf(), - }, - )?), + inner: Arc::new( + LocalFileSystem::new_with_prefix(prefix.as_ref()) + .context(CreateLocalFileSystemSnafu { + path: prefix.as_ref().to_path_buf(), + })? + // Clean up intermediate directories automatically. + .with_automatic_cleanup(true), + ), }) } }