diff --git a/curve-ansible/roles/install_package/templates/snapshot-daemon.sh.j2 b/curve-ansible/roles/install_package/templates/snapshot-daemon.sh.j2 index 256fb3cf72..a60a21f1ee 100644 --- a/curve-ansible/roles/install_package/templates/snapshot-daemon.sh.j2 +++ b/curve-ansible/roles/install_package/templates/snapshot-daemon.sh.j2 @@ -173,7 +173,7 @@ function show_status() { fi # 查询leader的IP - leaderAddr=`tac ${consoleLog}|grep -m 1 -B 1000000 "Logging before InitGoogleLogging()"|grep "leader"|grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"|head -n1` + leaderAddr=`tac ${consoleLog}|grep -a -m 1 -B 1000000 "Logging before InitGoogleLogging()"|grep "leader"|grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"|head -n1` # 如果load configuration之后的日志,没有leader相关日志 # 那么leaderAddr为空, snapshotcloneserver应该没有起来 diff --git a/curve-snapshotcloneserver/home/nbs/snapshot-daemon.sh b/curve-snapshotcloneserver/home/nbs/snapshot-daemon.sh index 5d5d672ed6..676b3fc2bf 100755 --- a/curve-snapshotcloneserver/home/nbs/snapshot-daemon.sh +++ b/curve-snapshotcloneserver/home/nbs/snapshot-daemon.sh @@ -189,7 +189,7 @@ function show_status() { fi # 查询leader的IP - leaderAddr=`tac ${consoleLog}|grep -m 1 -B 1000000 "Logging before InitGoogleLogging()"|grep "leader"|grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"|head -n1` + leaderAddr=`tac ${consoleLog}|grep -a -m 1 -B 1000000 "Logging before InitGoogleLogging()"|grep "leader"|grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"|head -n1` # 如果load configuration之后的日志,没有leader相关日志 # 那么leaderAddr为空, snapshotcloneserver应该没有起来 diff --git a/src/client/libcurve_file.cpp b/src/client/libcurve_file.cpp index 7ea2d98076..fab537cdd6 100644 --- a/src/client/libcurve_file.cpp +++ b/src/client/libcurve_file.cpp @@ -480,8 +480,16 @@ int FileClient::Mkdir(const std::string& dirpath, const UserInfo_t& userinfo) { LIBCURVE_ERROR ret; if (mdsClient_ != nullptr) { ret = mdsClient_->CreateFile(dirpath, userinfo, 0, false); - LOG_IF(ERROR, ret != LIBCURVE_ERROR::OK) - << "Create file failed, filename: " << dirpath << ", ret: " << ret; + if (ret != LIBCURVE_ERROR::OK) { + if (ret == LIBCURVE_ERROR::EXISTS) { + LOG(WARNING) << "Create directory failed, " << dirpath + << " already exists"; + } else { + LOG_IF(ERROR, ret != LIBCURVE_ERROR::OK) + << "Create directory failed, dir: " << dirpath + << ", ret: " << ret; + } + } } else { LOG(ERROR) << "global mds client not inited!"; return -LIBCURVE_ERROR::FAILED;