diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp index cbae3ee896beaa..11e2635047b291 100644 --- a/be/src/common/config.cpp +++ b/be/src/common/config.cpp @@ -312,7 +312,7 @@ DEFINE_mInt32(garbage_sweep_batch_size, "100"); DEFINE_mInt32(snapshot_expire_time_sec, "172800"); // It is only a recommended value. When the disk space is insufficient, // the file storage period under trash dose not have to comply with this parameter. -DEFINE_mInt32(trash_file_expire_time_sec, "259200"); +DEFINE_mInt32(trash_file_expire_time_sec, "86400"); // minimum file descriptor number // modify them upon necessity DEFINE_Int32(min_file_descriptor_number, "60000"); diff --git a/be/src/olap/data_dir.cpp b/be/src/olap/data_dir.cpp index 37dd76c848c4a4..98bc721c048fbe 100644 --- a/be/src/olap/data_dir.cpp +++ b/be/src/olap/data_dir.cpp @@ -927,8 +927,14 @@ void DataDir::disks_compaction_num_increment(int64_t delta) { } Status DataDir::move_to_trash(const std::string& tablet_path) { - Status res = Status::OK(); + if (config::trash_file_expire_time_sec <= 0) { + LOG(INFO) << "delete tablet dir " << tablet_path + << " directly due to trash_file_expire_time_sec is 0"; + RETURN_IF_ERROR(io::global_local_filesystem()->delete_directory(tablet_path)); + return delete_tablet_parent_path_if_empty(tablet_path); + } + Status res = Status::OK(); // 1. get timestamp string string time_str; if ((res = gen_timestamp_string(&time_str)) != Status::OK()) {