Skip to content

Commit

Permalink
fix: snapshot-daemon.sh and log-level in client
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-hanqing authored and xu-chaojie committed Mar 16, 2021
1 parent 1866c38 commit ce0e56f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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应该没有起来
Expand Down
2 changes: 1 addition & 1 deletion curve-snapshotcloneserver/home/nbs/snapshot-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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应该没有起来
Expand Down
12 changes: 10 additions & 2 deletions src/client/libcurve_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ce0e56f

Please sign in to comment.