You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/02/12 01:39:00 UTC

[GitHub] [incubator-doris] lingbin opened a new pull request #2884: Add `sync_dir` interface to Env

lingbin opened a new pull request #2884: Add `sync_dir` interface to Env
URL: https://github.com/apache/incubator-doris/pull/2884
 
 
   when we need to ensure that **a newly-created file** is fully
   synchronized back to disk, we should call `fsync()` on the parent
   directory—that is, the directory containing the newly-created file.
   That is to say, In this situation, we should call `fsync()` on
   both the newly-created file and its parent directory.
   
   Unfortunately, currently in Doris, in any scenario, directories
   are not fsynced.
   
   This patch adds `sync_dir()` interface first, laying the goundwork
   for future fixes.
   
   This patch also remove unneeded private method `dir_exists()`.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] lingbin merged pull request #2884: Add `sync_dir` interface to Env

Posted by GitBox <gi...@apache.org>.
lingbin merged pull request #2884: Add `sync_dir` interface to Env
URL: https://github.com/apache/incubator-doris/pull/2884
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] lingbin commented on a change in pull request #2884: Add `sync_dir` interface to Env

Posted by GitBox <gi...@apache.org>.
lingbin commented on a change in pull request #2884: Add `sync_dir` interface to Env
URL: https://github.com/apache/incubator-doris/pull/2884#discussion_r378052044
 
 

 ##########
 File path: be/src/env/env.h
 ##########
 @@ -139,9 +138,21 @@ class Env {
     // Delete the named file.
     virtual Status delete_file(const std::string& fname) = 0;
 
-    // Create the specified directory. Returns error if directory exists.
+    // Create the specified directory.
+    // NOTE: It will return error if the path already exist(not necessarily as a directory)
     virtual Status create_dir(const std::string& dirname) = 0;
 
 Review comment:
   You may be misunderstood, `"not necessarily as a directory"` means for the case where pathname is a symbolic link, dangling, and so on,  this method will return error too.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] chaoyli commented on a change in pull request #2884: Add `sync_dir` interface to Env

Posted by GitBox <gi...@apache.org>.
chaoyli commented on a change in pull request #2884: Add `sync_dir` interface to Env
URL: https://github.com/apache/incubator-doris/pull/2884#discussion_r378039268
 
 

 ##########
 File path: be/src/env/env.h
 ##########
 @@ -139,9 +138,21 @@ class Env {
     // Delete the named file.
     virtual Status delete_file(const std::string& fname) = 0;
 
-    // Create the specified directory. Returns error if directory exists.
+    // Create the specified directory.
+    // NOTE: It will return error if the path already exist(not necessarily as a directory)
     virtual Status create_dir(const std::string& dirname) = 0;
 
 Review comment:
   necessity or not depends application logic. Is not depends on API

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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