You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/10/22 15:14:05 UTC

[GitHub] [incubator-kvrocks] mapleFU commented on a diff in pull request #1026: Support `config set backup-dir new-dir`

mapleFU commented on code in PR #1026:
URL: https://github.com/apache/incubator-kvrocks/pull/1026#discussion_r1002506324


##########
src/storage/storage.cc:
##########
@@ -333,9 +333,11 @@ Status Storage::OpenForReadOnly() { return Open(true); }
 
 Status Storage::CreateBackup() {
   LOG(INFO) << "[storage] Start to create new backup";
-  std::lock_guard<std::mutex> lg(backup_mu_);
+  std::lock_guard<std::mutex> lg(config_->backup_mu_);
+  // Note: `config_->backup_dir` may change, so we should use same dir during the task.
+  std::string task_backup_dir = config_->backup_dir;

Review Comment:
   Yes, at the begining I want to use a shorter critical section, but currently it leave it here.



-- 
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: issues-unsubscribe@kvrocks.apache.org

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