gavinchou commented on code in PR #46393:
URL: https://github.com/apache/doris/pull/46393#discussion_r1910388678


##########
cloud/src/recycler/hdfs_accessor.cpp:
##########
@@ -356,8 +369,30 @@ int HdfsAccessor::init() {
 int HdfsAccessor::delete_prefix(const std::string& path_prefix, int64_t 
expiration_time) {
     auto uri = to_uri(path_prefix);
     LOG(INFO) << "delete prefix, uri=" << uri;
+    // If path prefix exists, assume it is a dir or a file.
+    if (exists(path_prefix) == 0) {
+        // try to delete path prefix as a dir or a file.
+        if (delete_directory(path_prefix) == 0) {

Review Comment:
   when and what if it fails to delete the directory. 
   line 373 already check that the existence of path_prefix 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to