提交 4eecd7fd 编写于 作者: H Hongze Cheng

more code

上级 579af54c
...@@ -28,13 +28,24 @@ int vnodeCreate(const char *path, SVnodeCfg *pCfg, STfs *pTfs) { ...@@ -28,13 +28,24 @@ int vnodeCreate(const char *path, SVnodeCfg *pCfg, STfs *pTfs) {
} }
// create vnode env // create vnode env
if (tfsMkdirAt(pTfs, path, (SDiskID){0}) < 0) { if (pTfs) {
vError("vgId:%d, failed to create vnode since:%s", pCfg->vgId, tstrerror(terrno)); if (tfsMkdirAt(pTfs, path, (SDiskID){0}) < 0) {
return -1; vError("vgId:%d, failed to create vnode since:%s", pCfg->vgId, tstrerror(terrno));
return -1;
}
snprintf(dir, TSDB_FILENAME_LEN, "%s%s%s", tfsGetPrimaryPath(pTfs), TD_DIRSEP, path);
} else {
if (taosMkDir(path)) {
return TAOS_SYSTEM_ERROR(errno);
}
strcpy(dir, path);
}
if (pCfg) {
info.config = *pCfg;
} else {
info.config = vnodeCfgDefault;
} }
snprintf(dir, TSDB_FILENAME_LEN, "%s%s%s", tfsGetPrimaryPath(pTfs), TD_DIRSEP, path);
info.config = *pCfg;
info.state.committed = -1; info.state.committed = -1;
info.state.applied = -1; info.state.applied = -1;
info.state.commitID = 0; info.state.commitID = 0;
...@@ -44,7 +55,7 @@ int vnodeCreate(const char *path, SVnodeCfg *pCfg, STfs *pTfs) { ...@@ -44,7 +55,7 @@ int vnodeCreate(const char *path, SVnodeCfg *pCfg, STfs *pTfs) {
return -1; return -1;
} }
vInfo("vgId:%d, vnode is created", pCfg->vgId); vInfo("vgId:%d, vnode is created", info.config.vgId);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册