fix(cluster): disable startup on create dir failed
This commit is contained in:
parent
bd70f5e104
commit
c5ea02c4ed
|
@ -53,7 +53,7 @@ int32_t bmProcessCreateReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (createReq.dnodeId != pDnode->data.dnodeId) {
|
if (pDnode->data.dnodeId != 0 && createReq.dnodeId != pDnode->data.dnodeId) {
|
||||||
terrno = TSDB_CODE_INVALID_OPTION;
|
terrno = TSDB_CODE_INVALID_OPTION;
|
||||||
dError("failed to create bnode since %s, input:%d cur:%d", terrstr(), createReq.dnodeId, pDnode->data.dnodeId);
|
dError("failed to create bnode since %s, input:%d cur:%d", terrstr(), createReq.dnodeId, pDnode->data.dnodeId);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -647,12 +647,13 @@ int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) {
|
||||||
taosCloseFile(&pFile);
|
taosCloseFile(&pFile);
|
||||||
if (line != NULL) taosMemoryFreeClear(line);
|
if (line != NULL) taosMemoryFreeClear(line);
|
||||||
|
|
||||||
if (code == 0) {
|
if (code == 0 || (code != 0 && terrno == TSDB_CODE_CFG_NOT_FOUND)) {
|
||||||
uInfo("load from cfg file %s success", filepath);
|
uInfo("load from cfg file %s success", filepath);
|
||||||
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
uError("failed to load from cfg file %s since %s", filepath, terrstr());
|
uError("failed to load from cfg file %s since %s", filepath, terrstr());
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
return code;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) {
|
int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) {
|
||||||
|
|
|
@ -137,7 +137,14 @@ static void taosStopLog() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void taosLogBuffDestroy() {
|
void taosCloseLog() {
|
||||||
|
if (tsLogObj.logHandle != NULL) {
|
||||||
|
taosStopLog();
|
||||||
|
if (tsLogObj.logHandle != NULL && taosCheckPthreadValid(tsLogObj.logHandle->asyncThread)) {
|
||||||
|
taosThreadJoin(tsLogObj.logHandle->asyncThread, NULL);
|
||||||
|
}
|
||||||
|
tsLogInited = 0;
|
||||||
|
|
||||||
taosThreadMutexDestroy(&tsLogObj.logHandle->buffMutex);
|
taosThreadMutexDestroy(&tsLogObj.logHandle->buffMutex);
|
||||||
taosCloseFile(&tsLogObj.logHandle->pFile);
|
taosCloseFile(&tsLogObj.logHandle->pFile);
|
||||||
taosMemoryFreeClear(tsLogObj.logHandle->buffer);
|
taosMemoryFreeClear(tsLogObj.logHandle->buffer);
|
||||||
|
@ -147,14 +154,6 @@ static void taosLogBuffDestroy() {
|
||||||
memset(&tsLogObj.logHandle, 0, sizeof(tsLogObj.logHandle));
|
memset(&tsLogObj.logHandle, 0, sizeof(tsLogObj.logHandle));
|
||||||
tsLogObj.logHandle = NULL;
|
tsLogObj.logHandle = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void taosCloseLog() {
|
|
||||||
taosStopLog();
|
|
||||||
if (taosCheckPthreadValid(tsLogObj.logHandle->asyncThread)) {
|
|
||||||
taosThreadJoin(tsLogObj.logHandle->asyncThread, NULL);
|
|
||||||
}
|
|
||||||
tsLogInited = 0;
|
|
||||||
taosLogBuffDestroy(tsLogObj.logHandle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool taosLockLogFile(TdFilePtr pFile) {
|
static bool taosLockLogFile(TdFilePtr pFile) {
|
||||||
|
|
Loading…
Reference in New Issue