未验证 提交 21716878 编写于 作者: H hzcheng 提交者: GitHub

Merge pull request #1105 from taosdata/hotfix/slguan

TBASE-1398 #1073
......@@ -415,10 +415,10 @@ int vnodeProcessVPeerCfgRsp(char *msg, int msgLen, SMgmtObj *pMgmtObj) {
int32_t *pint = (int32_t *)pRsp->more;
int vnode = htonl(*pint);
if (vnode < TSDB_MAX_VNODES && vnodeList[vnode].lastKey != 0) {
dError("vnode:%d not configured, it shall be empty");
dError("vnode:%d not configured, it shall be empty, code:%d", vnode, pRsp->code);
vnodeRemoveVnode(vnode);
} else {
dTrace("vnode:%d is invalid", vnode);
dError("vnode:%d is invalid, code:%d", vnode, pRsp->code);
}
}
......
......@@ -657,7 +657,10 @@ int mgmtCreateMeter(SDbObj *pDb, SCreateTableMsg *pCreate) {
return TSDB_CODE_NO_ENOUGH_DNODES;
}
if (pDb->vgStatus < TSDB_VG_STATUS_FULL && pDb->vgStatus > TSDB_CODE_ACTION_IN_PROGRESS) {
if (pDb->vgStatus == TSDB_VG_STATUS_NO_DISK_PERMISSIONS ||
pDb->vgStatus == TSDB_VG_STATUS_SERVER_NO_PACE ||
pDb->vgStatus == TSDB_VG_STATUS_SERV_OUT_OF_MEMORY ||
pDb->vgStatus == TSDB_VG_STATUS_INIT_FAILED ) {
mgmtDestroyMeter(pMeter);
mError("table:%s, vgroup init failed, reason:%d %s", pCreate->meterId, pDb->vgStatus, taosGetVgroupStatusStr(pDb->vgStatus));
return pDb->vgStatus;
......
......@@ -79,7 +79,7 @@ int vnodeCreateMeterObjFile(int vnode) {
sprintf(fileName, "%s/vnode%d/meterObj.v%d", tsDirectory, vnode, vnode);
fp = fopen(fileName, "w+");
if (fp == NULL) {
dError("failed to create vnode:%d file:%s, reason:%s", vnode, fileName, strerror(errno));
dError("failed to create vnode:%d file:%s, errno:%d, reason:%s", vnode, fileName, errno, strerror(errno));
if (errno == EACCES) {
return TSDB_CODE_NO_DISK_PERMISSIONS;
} else if (errno == ENOSPC) {
......
......@@ -186,10 +186,30 @@ int vnodeCreateVnode(int vnode, SVnodeCfg *pCfg, SVPeerDesc *pDesc) {
vnodeList[vnode].vnodeStatus = TSDB_VN_STATUS_CREATING;
sprintf(fileName, "%s/vnode%d", tsDirectory, vnode);
mkdir(fileName, 0755);
if (mkdir(fileName, 0755) != 0) {
dError("failed to create vnode:%d directory:%s, errno:%d, reason:%s", vnode, fileName, errno, strerror(errno));
if (errno == EACCES) {
return TSDB_CODE_NO_DISK_PERMISSIONS;
} else if (errno == ENOSPC) {
return TSDB_CODE_SERVER_NO_SPACE;
} else if (errno == EEXIST) {
} else {
return TSDB_CODE_VG_INIT_FAILED;
}
}
sprintf(fileName, "%s/vnode%d/db", tsDirectory, vnode);
mkdir(fileName, 0755);
if (mkdir(fileName, 0755) != 0) {
dError("failed to create vnode:%d directory:%s, errno:%d, reason:%s", vnode, fileName, errno, strerror(errno));
if (errno == EACCES) {
return TSDB_CODE_NO_DISK_PERMISSIONS;
} else if (errno == ENOSPC) {
return TSDB_CODE_SERVER_NO_SPACE;
} else if (errno == EEXIST) {
} else {
return TSDB_CODE_VG_INIT_FAILED;
}
}
vnodeList[vnode].cfg = *pCfg;
int code = vnodeCreateMeterObjFile(vnode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册