fix/TS-5507-config-generate-ley-and-add-more-log
This commit is contained in:
parent
2ed4aeb0da
commit
1e87baf730
|
@ -1725,6 +1725,7 @@ int32_t taosReadDataFolder(const char *cfgDir, const char **envCmd, const char *
|
||||||
TAOS_CHECK_RETURN(cfgInit(&pCfg));
|
TAOS_CHECK_RETURN(cfgInit(&pCfg));
|
||||||
|
|
||||||
TAOS_CHECK_GOTO(cfgAddDir(pCfg, "dataDir", tsDataDir, CFG_SCOPE_SERVER, CFG_DYN_NONE), NULL, _exit);
|
TAOS_CHECK_GOTO(cfgAddDir(pCfg, "dataDir", tsDataDir, CFG_SCOPE_SERVER, CFG_DYN_NONE), NULL, _exit);
|
||||||
|
TAOS_CHECK_GOTO(cfgAddInt32(pCfg, "debugFlag", dDebugFlag, 0, 255, CFG_SCOPE_SERVER, CFG_DYN_SERVER), NULL, _exit);
|
||||||
TAOS_CHECK_GOTO(cfgAddInt32(pCfg, "dDebugFlag", dDebugFlag, 0, 255, CFG_SCOPE_SERVER, CFG_DYN_SERVER) ,NULL, _exit);
|
TAOS_CHECK_GOTO(cfgAddInt32(pCfg, "dDebugFlag", dDebugFlag, 0, 255, CFG_SCOPE_SERVER, CFG_DYN_SERVER) ,NULL, _exit);
|
||||||
|
|
||||||
if ((code = taosLoadCfg(pCfg, envCmd, cfgDir, envFile, apolloUrl)) != 0) {
|
if ((code = taosLoadCfg(pCfg, envCmd, cfgDir, envFile, apolloUrl)) != 0) {
|
||||||
|
|
|
@ -575,6 +575,8 @@ static int32_t mndOpenSdb(SMnode *pMnode) {
|
||||||
code = sdbReadFile(pMnode->pSdb);
|
code = sdbReadFile(pMnode->pSdb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mInfo("vgId:1, mnode sdb is opened, with applied index:%" PRId64, pMnode->pSdb->commitIndex);
|
||||||
|
|
||||||
atomic_store_64(&pMnode->applied, pMnode->pSdb->commitIndex);
|
atomic_store_64(&pMnode->applied, pMnode->pSdb->commitIndex);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -637,7 +637,7 @@ void mndSyncStop(SMnode *pMnode) {
|
||||||
|
|
||||||
(void)taosThreadMutexLock(&pMgmt->lock);
|
(void)taosThreadMutexLock(&pMgmt->lock);
|
||||||
if (pMgmt->transId != 0) {
|
if (pMgmt->transId != 0) {
|
||||||
mInfo("vgId:1, is stopped and post sem, trans:%d", pMgmt->transId);
|
mInfo("vgId:1, trans:%d, is stopped and post sem", pMgmt->transId);
|
||||||
pMgmt->transId = 0;
|
pMgmt->transId = 0;
|
||||||
pMgmt->transSec = 0;
|
pMgmt->transSec = 0;
|
||||||
pMgmt->errCode = TSDB_CODE_APP_IS_STOPPING;
|
pMgmt->errCode = TSDB_CODE_APP_IS_STOPPING;
|
||||||
|
|
|
@ -589,6 +589,7 @@ STrans *mndAcquireTrans(SMnode *pMnode, int32_t transId) {
|
||||||
|
|
||||||
void mndReleaseTrans(SMnode *pMnode, STrans *pTrans) {
|
void mndReleaseTrans(SMnode *pMnode, STrans *pTrans) {
|
||||||
SSdb *pSdb = pMnode->pSdb;
|
SSdb *pSdb = pMnode->pSdb;
|
||||||
|
if (pTrans != NULL) mInfo("vgId:1, trans:%d, release transaction", pTrans->id);
|
||||||
sdbRelease(pSdb, pTrans);
|
sdbRelease(pSdb, pTrans);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1131,10 +1132,11 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) {
|
||||||
if (!sendRsp) {
|
if (!sendRsp) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
mInfo("trans:%d, send rsp, stage:%s failedTimes:%d code:0x%x", pTrans->id, mndTransStr(pTrans->stage),
|
mInfo("vgId:1, trans:%d, start to send rsp, stage:%s failedTimes:%d code:0x%x", pTrans->id,
|
||||||
pTrans->failedTimes, code);
|
mndTransStr(pTrans->stage), pTrans->failedTimes, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mInfo("vgId:1, trans:%d, start to lock rpc array", pTrans->id);
|
||||||
taosWLockLatch(&pTrans->lockRpcArray);
|
taosWLockLatch(&pTrans->lockRpcArray);
|
||||||
int32_t size = taosArrayGetSize(pTrans->pRpcArray);
|
int32_t size = taosArrayGetSize(pTrans->pRpcArray);
|
||||||
if (size <= 0) {
|
if (size <= 0) {
|
||||||
|
@ -1155,8 +1157,8 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) {
|
||||||
if (i != 0 && code == 0) {
|
if (i != 0 && code == 0) {
|
||||||
code = TSDB_CODE_MNODE_NOT_FOUND;
|
code = TSDB_CODE_MNODE_NOT_FOUND;
|
||||||
}
|
}
|
||||||
mInfo("trans:%d, client:%d send rsp, code:0x%x stage:%s app:%p", pTrans->id, i, code, mndTransStr(pTrans->stage),
|
mInfo("vgId:1, trans:%d, client:%d start to send rsp, code:0x%x stage:%s app:%p", pTrans->id, i, code,
|
||||||
pInfo->ahandle);
|
mndTransStr(pTrans->stage), pInfo->ahandle);
|
||||||
|
|
||||||
SRpcMsg rspMsg = {.code = code, .info = *pInfo};
|
SRpcMsg rspMsg = {.code = code, .info = *pInfo};
|
||||||
|
|
||||||
|
@ -1199,6 +1201,9 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) {
|
||||||
}
|
}
|
||||||
|
|
||||||
tmsgSendRsp(&rspMsg);
|
tmsgSendRsp(&rspMsg);
|
||||||
|
|
||||||
|
mInfo("vgId:1, trans:%d, client:%d send rsp finished, code:0x%x stage:%s app:%p", pTrans->id, i, code,
|
||||||
|
mndTransStr(pTrans->stage), pInfo->ahandle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
taosArrayClear(pTrans->pRpcArray);
|
taosArrayClear(pTrans->pRpcArray);
|
||||||
|
|
|
@ -168,11 +168,10 @@ static int32_t sdbCreateDir(SSdb *pSdb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sdbSetApplyInfo(SSdb *pSdb, int64_t index, int64_t term, int64_t config) {
|
void sdbSetApplyInfo(SSdb *pSdb, int64_t index, int64_t term, int64_t config) {
|
||||||
#if 1
|
mInfo("vgId:1, mnode apply info changed from index:%" PRId64 " term:%" PRId64 " config:%" PRId64 " to index:%" PRId64
|
||||||
mTrace("mnode apply info changed from index:%" PRId64 " term:%" PRId64 " config:%" PRId64 " to index:%" PRId64
|
" term:%" PRId64 " config:%" PRId64,
|
||||||
" term:%" PRId64 " config:%" PRId64,
|
pSdb->applyIndex, pSdb->applyTerm, pSdb->applyConfig, index, term, config);
|
||||||
pSdb->applyIndex, pSdb->applyTerm, pSdb->applyConfig, index, term, config);
|
|
||||||
#endif
|
|
||||||
pSdb->applyIndex = index;
|
pSdb->applyIndex = index;
|
||||||
pSdb->applyTerm = term;
|
pSdb->applyTerm = term;
|
||||||
pSdb->applyConfig = config;
|
pSdb->applyConfig = config;
|
||||||
|
|
|
@ -207,6 +207,8 @@ static int32_t sdbWriteFileHead(SSdb *pSdb, TdFilePtr pFile) {
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mInfo("vgId:1, write sdb file with sdb applyIndex:%" PRId64 " term:%" PRId64 " config:%" PRId64, pSdb->applyIndex,
|
||||||
|
pSdb->applyTerm, pSdb->applyConfig);
|
||||||
if (taosWriteFile(pFile, &pSdb->applyIndex, sizeof(int64_t)) != sizeof(int64_t)) {
|
if (taosWriteFile(pFile, &pSdb->applyIndex, sizeof(int64_t)) != sizeof(int64_t)) {
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
@ -607,6 +609,9 @@ int32_t sdbWriteFile(SSdb *pSdb, int32_t delta) {
|
||||||
}
|
}
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
mError("failed to write sdb file since %s", tstrerror(code));
|
mError("failed to write sdb file since %s", tstrerror(code));
|
||||||
|
} else {
|
||||||
|
mInfo("write sdb file success, apply index:%" PRId64 " term:%" PRId64 " config:%" PRId64, pSdb->applyIndex,
|
||||||
|
pSdb->applyTerm, pSdb->applyConfig);
|
||||||
}
|
}
|
||||||
(void)taosThreadMutexUnlock(&pSdb->filelock);
|
(void)taosThreadMutexUnlock(&pSdb->filelock);
|
||||||
return code;
|
return code;
|
||||||
|
|
|
@ -42,6 +42,7 @@ void sdbFreeRow(SSdb *pSdb, SSdbRow *pRow, bool callFunc) {
|
||||||
// remove attached object such as trans
|
// remove attached object such as trans
|
||||||
SdbDeleteFp deleteFp = pSdb->deleteFps[pRow->type];
|
SdbDeleteFp deleteFp = pSdb->deleteFps[pRow->type];
|
||||||
if (deleteFp != NULL) {
|
if (deleteFp != NULL) {
|
||||||
|
mInfo("vgId:1, deleteFp:%p, type:%s", deleteFp, sdbTableName(pRow->type));
|
||||||
(void)(*deleteFp)(pSdb, pRow->pObj, callFunc);
|
(void)(*deleteFp)(pSdb, pRow->pObj, callFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue