This reverts commit 9fe7a50129
.
pull/24376/head
parent
e81ff1f4d5
commit
e9c8f40af2
|
@ -11,25 +11,16 @@ pub(crate) async fn perform(
|
||||||
sleep_interval_minutes: u64,
|
sleep_interval_minutes: u64,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
loop {
|
loop {
|
||||||
let parquet_file_flagged = catalog
|
let flagged = catalog
|
||||||
.repositories()
|
.repositories()
|
||||||
.await
|
.await
|
||||||
.parquet_files()
|
.parquet_files()
|
||||||
.flag_for_delete_by_retention()
|
.flag_for_delete_by_retention()
|
||||||
.await
|
.await
|
||||||
.context(ParquetFileFlaggingSnafu)?;
|
.context(FlaggingSnafu)?;
|
||||||
info!(parquet_file_flagged_count = %parquet_file_flagged.len(), "iox_catalog::parquet_file::flag_for_delete_by_retention()");
|
info!(flagged_count = %flagged.len(), "iox_catalog::flag_for_delete_by_retention()");
|
||||||
|
|
||||||
let partition_flagged = catalog
|
if flagged.is_empty() {
|
||||||
.repositories()
|
|
||||||
.await
|
|
||||||
.partitions()
|
|
||||||
.flag_for_delete_by_retention()
|
|
||||||
.await
|
|
||||||
.context(PartitionFlaggingSnafu)?;
|
|
||||||
info!(partition_flagged_count = %partition_flagged.len(), "iox_catalog::partition::flag_for_delete_by_retention()");
|
|
||||||
|
|
||||||
if parquet_file_flagged.is_empty() && partition_flagged.is_empty() {
|
|
||||||
select! {
|
select! {
|
||||||
_ = shutdown.cancelled() => {
|
_ = shutdown.cancelled() => {
|
||||||
break
|
break
|
||||||
|
@ -47,12 +38,7 @@ pub(crate) async fn perform(
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[snafu(display("Failed to flag parquet files for deletion by retention policy"))]
|
#[snafu(display("Failed to flag parquet files for deletion by retention policy"))]
|
||||||
ParquetFileFlagging {
|
Flagging {
|
||||||
source: iox_catalog::interface::Error,
|
|
||||||
},
|
|
||||||
|
|
||||||
#[snafu(display("Failed to flag partitions for deletion by retention policy"))]
|
|
||||||
PartitionFlagging {
|
|
||||||
source: iox_catalog::interface::Error,
|
source: iox_catalog::interface::Error,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue