more code
This commit is contained in:
parent
a4ca770449
commit
927f6861be
|
@ -189,13 +189,3 @@ option(
|
|||
"If build release version"
|
||||
OFF
|
||||
)
|
||||
|
||||
# open this flag to use dev code, make sure it is off in release version
|
||||
option(
|
||||
USE_DEV_CODE
|
||||
"If use dev code"
|
||||
ON
|
||||
)
|
||||
if (${USE_DEV_CODE})
|
||||
add_definitions(-DUSE_DEV_CODE)
|
||||
endif(USE_DEV_CODE)
|
|
@ -14,9 +14,7 @@
|
|||
*/
|
||||
|
||||
#include "tsdb.h"
|
||||
#ifdef USE_DEV_CODE
|
||||
#include "tsdbFS2.h"
|
||||
#endif
|
||||
|
||||
int32_t tsdbSetKeepCfg(STsdb *pTsdb, STsdbCfg *pCfg) {
|
||||
STsdbKeepCfg *pKeepCfg = &pTsdb->keepCfg;
|
||||
|
@ -68,16 +66,10 @@ int tsdbOpen(SVnode *pVnode, STsdb **ppTsdb, const char *dir, STsdbKeepCfg *pKee
|
|||
taosMkDir(pTsdb->path);
|
||||
}
|
||||
|
||||
// open tsdb
|
||||
#ifdef USE_DEV_CODE
|
||||
// open tsdb
|
||||
if (tsdbOpenFS(pTsdb, &pTsdb->pFS, rollback) < 0) {
|
||||
goto _err;
|
||||
}
|
||||
#else
|
||||
if (tsdbFSOpen(pTsdb, rollback) < 0) {
|
||||
goto _err;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (tsdbOpenCache(pTsdb) < 0) {
|
||||
goto _err;
|
||||
|
@ -103,11 +95,7 @@ int tsdbClose(STsdb **pTsdb) {
|
|||
|
||||
taosThreadRwlockDestroy(&(*pTsdb)->rwLock);
|
||||
|
||||
#ifndef USE_DEV_CODE
|
||||
tsdbFSClose(*pTsdb);
|
||||
#else
|
||||
tsdbCloseFS(&(*pTsdb)->pFS);
|
||||
#endif
|
||||
tsdbCloseCache(*pTsdb);
|
||||
taosMemoryFreeClear(*pTsdb);
|
||||
}
|
||||
|
|
|
@ -16,12 +16,10 @@
|
|||
#include "vnd.h"
|
||||
#include "vnodeInt.h"
|
||||
|
||||
#ifdef USE_DEV_CODE
|
||||
extern int32_t tsdbPreCommit(STsdb *pTsdb);
|
||||
extern int32_t tsdbCommitBegin(STsdb *pTsdb, SCommitInfo *pInfo);
|
||||
extern int32_t tsdbCommitCommit(STsdb *pTsdb);
|
||||
extern int32_t tsdbCommitAbort(STsdb *pTsdb);
|
||||
#endif
|
||||
|
||||
#define VND_INFO_FNAME_TMP "vnode_tmp.json"
|
||||
|
||||
|
@ -309,11 +307,7 @@ static int32_t vnodePrepareCommit(SVnode *pVnode, SCommitInfo *pInfo) {
|
|||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
}
|
||||
|
||||
#ifdef USE_DEV_CODE
|
||||
tsdbPreCommit(pVnode->pTsdb);
|
||||
#else
|
||||
tsdbPrepareCommit(pVnode->pTsdb);
|
||||
#endif
|
||||
|
||||
metaPrepareAsyncCommit(pVnode->pMeta);
|
||||
|
||||
|
@ -446,11 +440,7 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) {
|
|||
|
||||
syncBeginSnapshot(pVnode->sync, pInfo->info.state.committed);
|
||||
|
||||
#ifdef USE_DEV_CODE
|
||||
code = tsdbCommitBegin(pVnode->pTsdb, pInfo);
|
||||
#else
|
||||
code = tsdbCommit(pVnode->pTsdb, pInfo);
|
||||
#endif
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
|
||||
if (!TSDB_CACHE_NO(pVnode->config)) {
|
||||
|
@ -474,11 +464,7 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) {
|
|||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
}
|
||||
|
||||
#ifdef USE_DEV_CODE
|
||||
code = tsdbCommitCommit(pVnode->pTsdb);
|
||||
#else
|
||||
code = tsdbFinishCommit(pVnode->pTsdb);
|
||||
#endif
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
|
||||
if (VND_IS_RSMA(pVnode)) {
|
||||
|
|
Loading…
Reference in New Issue