未验证 提交 ab898c06 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #3144 from taosdata/hotfix/not_remove_file

not remove tsdb dir
......@@ -71,7 +71,18 @@ static void tsdbStopStream(STsdbRepo *pRepo);
// Function declaration
int32_t tsdbCreateRepo(char *rootDir, STsdbCfg *pCfg) {
taosRemoveDir(rootDir);
DIR *dir = opendir(rootDir);
if (dir) {
tsdbDebug("repository %s already exists", rootDir);
closedir(dir);
return 0;
} else {
if (ENOENT != errno) {
tsdbError("failed to open directory %s since %s", rootDir, strerror(errno));
terrno = TAOS_SYSTEM_ERROR(errno);
return -1;
}
}
if (mkdir(rootDir, 0755) < 0) {
tsdbError("vgId:%d failed to create rootDir %s since %s", pCfg->tsdbId, rootDir, strerror(errno));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册