rename file
This commit is contained in:
parent
aac15d1822
commit
0b6d32a3d9
|
@ -89,10 +89,10 @@ typedef struct {
|
||||||
int vnodeInit(const SVnodeOpt *pOption);
|
int vnodeInit(const SVnodeOpt *pOption);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief clear a vnode
|
* @brief Cleanup the vnode module
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void vnodeClear();
|
void vnodeCleanup();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Open a VNODE.
|
* @brief Open a VNODE.
|
||||||
|
|
|
@ -49,7 +49,7 @@ typedef struct {
|
||||||
} STierMeta;
|
} STierMeta;
|
||||||
|
|
||||||
int tfsInit(SDiskCfg *pDiskCfg, int ndisk);
|
int tfsInit(SDiskCfg *pDiskCfg, int ndisk);
|
||||||
void tfsDestroy();
|
void tfsCleanup();
|
||||||
void tfsUpdateInfo(SFSMeta *pFSMeta, STierMeta *tierMetas, int8_t numLevels);
|
void tfsUpdateInfo(SFSMeta *pFSMeta, STierMeta *tierMetas, int8_t numLevels);
|
||||||
void tfsGetMeta(SFSMeta *pMeta);
|
void tfsGetMeta(SFSMeta *pMeta);
|
||||||
void tfsAllocDisk(int expLevel, int *level, int *id);
|
void tfsAllocDisk(int expLevel, int *level, int *id);
|
||||||
|
|
|
@ -173,18 +173,6 @@ SDnode *dndCreate(SDnodeObjCfg *pCfg) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rpcInit() != 0) {
|
|
||||||
dError("failed to init rpc since %s", terrstr());
|
|
||||||
dndClose(pDnode);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (walInit() != 0) {
|
|
||||||
dError("failed to init wal since %s", terrstr());
|
|
||||||
dndClose(pDnode);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
SDiskCfg dCfg;
|
SDiskCfg dCfg;
|
||||||
strcpy(dCfg.dir, pDnode->cfg.dataDir);
|
strcpy(dCfg.dir, pDnode->cfg.dataDir);
|
||||||
dCfg.level = 0;
|
dCfg.level = 0;
|
||||||
|
@ -277,10 +265,8 @@ void dndClose(SDnode *pDnode) {
|
||||||
dndCleanupQnode(pDnode);
|
dndCleanupQnode(pDnode);
|
||||||
dndCleanupVnodes(pDnode);
|
dndCleanupVnodes(pDnode);
|
||||||
dndCleanupMgmt(pDnode);
|
dndCleanupMgmt(pDnode);
|
||||||
vnodeClear();
|
vnodeCleanup();
|
||||||
tfsDestroy();
|
tfsCleanup();
|
||||||
walCleanUp();
|
|
||||||
rpcCleanup();
|
|
||||||
|
|
||||||
dndCloseImp(pDnode);
|
dndCloseImp(pDnode);
|
||||||
free(pDnode);
|
free(pDnode);
|
||||||
|
@ -298,6 +284,18 @@ int32_t dndInit(const SDnodeEnvCfg *pCfg) {
|
||||||
taosBlockSIGPIPE();
|
taosBlockSIGPIPE();
|
||||||
taosResolveCRC();
|
taosResolveCRC();
|
||||||
|
|
||||||
|
if (rpcInit() != 0) {
|
||||||
|
dError("failed to init rpc since %s", terrstr());
|
||||||
|
dndCleanup();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (walInit() != 0) {
|
||||||
|
dError("failed to init wal since %s", terrstr());
|
||||||
|
dndCleanup();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(&dndEnv.cfg, pCfg, sizeof(SDnodeEnvCfg));
|
memcpy(&dndEnv.cfg, pCfg, sizeof(SDnodeEnvCfg));
|
||||||
dInfo("dnode env is initialized");
|
dInfo("dnode env is initialized");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -309,6 +307,9 @@ void dndCleanup() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
walCleanUp();
|
||||||
|
rpcCleanup();
|
||||||
|
|
||||||
taosStopCacheRefreshWorker();
|
taosStopCacheRefreshWorker();
|
||||||
dInfo("dnode env is cleaned up");
|
dInfo("dnode env is cleaned up");
|
||||||
}
|
}
|
|
@ -56,7 +56,7 @@ int vnodeInit(const SVnodeOpt *pOption) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vnodeClear() {
|
void vnodeCleanup() {
|
||||||
if (TD_CHECK_AND_SET_MOD_CLEAR(&(vnodeMgr.vnodeInitFlag)) == TD_MOD_UNINITIALIZED) {
|
if (TD_CHECK_AND_SET_MOD_CLEAR(&(vnodeMgr.vnodeInitFlag)) == TD_MOD_UNINITIALIZED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,7 +227,7 @@ TEST(vnodeApiTest, vnode_simple_create_table_test) {
|
||||||
|
|
||||||
// CLOSE THE VNODE
|
// CLOSE THE VNODE
|
||||||
vnodeClose(pVnode);
|
vnodeClose(pVnode);
|
||||||
vnodeClear();
|
vnodeCleanup();
|
||||||
|
|
||||||
taosArrayDestroy(pMsgArr);
|
taosArrayDestroy(pMsgArr);
|
||||||
}
|
}
|
||||||
|
@ -279,7 +279,7 @@ TEST(vnodeApiTest, vnode_simple_insert_test) {
|
||||||
|
|
||||||
// Close the vnode
|
// Close the vnode
|
||||||
vnodeClose(pVnode);
|
vnodeClose(pVnode);
|
||||||
vnodeClear();
|
vnodeCleanup();
|
||||||
|
|
||||||
taosArrayDestroy(pMsgArr);
|
taosArrayDestroy(pMsgArr);
|
||||||
}
|
}
|
|
@ -85,19 +85,19 @@ int tfsInit(SDiskCfg *pDiskCfg, int ndisk) {
|
||||||
taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK);
|
taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK);
|
||||||
if (pfs->map == NULL) {
|
if (pfs->map == NULL) {
|
||||||
terrno = TSDB_CODE_FS_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_FS_OUT_OF_MEMORY;
|
||||||
tfsDestroy();
|
tfsCleanup();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int idisk = 0; idisk < ndisk; idisk++) {
|
for (int idisk = 0; idisk < ndisk; idisk++) {
|
||||||
if (tfsMount(pDiskCfg + idisk) < 0) {
|
if (tfsMount(pDiskCfg + idisk) < 0) {
|
||||||
tfsDestroy();
|
tfsCleanup();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tfsCheck() < 0) {
|
if (tfsCheck() < 0) {
|
||||||
tfsDestroy();
|
tfsCleanup();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ int tfsInit(SDiskCfg *pDiskCfg, int ndisk) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tfsDestroy() {
|
void tfsCleanup() {
|
||||||
taosHashCleanup(pfs->map);
|
taosHashCleanup(pfs->map);
|
||||||
pfs->map = NULL;
|
pfs->map = NULL;
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ typedef struct {
|
||||||
} STierMeta;
|
} STierMeta;
|
||||||
|
|
||||||
int tfsInit(SDiskCfg *pDiskCfg, int ndisk);
|
int tfsInit(SDiskCfg *pDiskCfg, int ndisk);
|
||||||
void tfsDestroy();
|
void tfsCleanup();
|
||||||
void tfsUpdateInfo(SFSMeta *pFSMeta, STierMeta *tierMetas, int8_t numLevels);
|
void tfsUpdateInfo(SFSMeta *pFSMeta, STierMeta *tierMetas, int8_t numLevels);
|
||||||
void tfsGetMeta(SFSMeta *pMeta);
|
void tfsGetMeta(SFSMeta *pMeta);
|
||||||
void tfsAllocDisk(int expLevel, int *level, int *id);
|
void tfsAllocDisk(int expLevel, int *level, int *id);
|
||||||
|
|
Loading…
Reference in New Issue