提交 530a7bf2 编写于 作者: C Cary Xu

naming optimization

上级 44e3a52a
......@@ -421,7 +421,7 @@ bool tsdbNoProblem(STsdbRepo* pRepo);
// unit of walSize: MB
int tsdbCheckWal(STsdbRepo *pRepo, uint32_t walSize);
int tsdbGetNumOfWaitCommit(STsdbRepo *pRepo, int *nNum);
int tsdbGetValOfWaitCommit(STsdbRepo *pRepo, int *nVal);
#ifdef __cplusplus
}
......
......@@ -199,8 +199,8 @@ int tsdbCheckCommit(STsdbRepo *pRepo) {
return 0;
}
int tsdbGetNumOfWaitCommit(STsdbRepo *pRepo, int *nNum) {
if (sem_getvalue(&pRepo->readyToCommit, nNum) != 0) {
int tsdbGetValOfWaitCommit(STsdbRepo *pRepo, int *nVal) {
if (sem_getvalue(&pRepo->readyToCommit, nVal) != 0) {
tsdbError("vgId:%d failed to sem_getvalue of readyToCommit", REPO_ID(pRepo));
return -1;
}
......
......@@ -169,14 +169,14 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR
}
static int32_t vnodeCheckWal(SVnodeObj *pVnode) {
// no need to check wal size to trigger commit if:
// 1) vnode in committing state;
// 2) other instance wait to commit;
int nWaitCommit = 0;
if (tsdbGetNumOfWaitCommit(pVnode->tsdb, &nWaitCommit) != 0) {
int nVal = 0;
if (tsdbGetValOfWaitCommit(pVnode->tsdb, &nVal) != 0) {
return -1;
}
if ((nWaitCommit > 0) && (pVnode->isCommiting == 0)) {
// no need to check wal size to trigger commit if:
// 1) have instances waiting to commit;
// or 2) vnode in committing state;
if ((nVal > 0) && (pVnode->isCommiting == 0)) {
return tsdbCheckWal(pVnode->tsdb, walGetFSize(pVnode->wal) >> 20);
}
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册