提交 bde9b439 编写于 作者: S Shengliang Guan

shm

上级 db970c79
......@@ -60,6 +60,7 @@ void dndCleanup() {
monCleanup();
rpcCleanup();
walCleanUp();
taosStopCacheRefreshWorker();
dInfo("dnode env is cleaned up");
}
......
......@@ -49,6 +49,12 @@ void mmRelease(SMnodeMgmt *pMgmt, SMnode *pMnode) {
}
int32_t mmOpen(SMnodeMgmt *pMgmt, SMnodeOpt *pOption) {
if (walInit() != 0) {
dError("failed to init wal since %s", terrstr());
dndCleanup();
return -1;
}
SMnode *pMnode = mndOpen(pMgmt->path, pOption);
if (pMnode == NULL) {
dError("failed to open mnode since %s", terrstr());
......@@ -240,6 +246,7 @@ static int32_t mmInit(SMgmtWrapper *pWrapper) {
_OVER:
if (code == 0) {
pWrapper->pMgmt = pMgmt;
dInfo("mnode-mgmt is initialized");
} else {
dError("failed to init mnode-mgmtsince %s", terrstr());
......
......@@ -94,15 +94,18 @@ static int32_t mmPutMsgToWorker(SMnodeMgmt *pMgmt, SDnodeWorker *pWorker, SNodeM
return code;
}
int32_t mmProcessWriteMsg(SMnodeMgmt *pMgmt, SNodeMsg *pMsg) {
int32_t mmProcessWriteMsg(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
SMnodeMgmt *pMgmt = pWrapper->pMgmt;
return mmPutMsgToWorker(pMgmt, &pMgmt->writeWorker, pMsg);
}
int32_t mmProcessSyncMsg(SMnodeMgmt *pMgmt, SNodeMsg *pMsg) {
int32_t mmProcessSyncMsg(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
SMnodeMgmt *pMgmt = pWrapper->pMgmt;
return mmPutMsgToWorker(pMgmt, &pMgmt->syncWorker, pMsg);
}
int32_t mmProcessReadMsg(SMnodeMgmt *pMgmt, SNodeMsg *pMsg) {
int32_t mmProcessReadMsg(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
SMnodeMgmt *pMgmt = pWrapper->pMgmt;
return mmPutMsgToWorker(pMgmt, &pMgmt->readWorker, pMsg);
}
......
......@@ -35,6 +35,11 @@ static int32_t vmInit(SMgmtWrapper *pWrapper) {
// dError("failed to init tfs since %s", terrstr());
// return -1;
// }
if (walInit() != 0) {
dError("failed to init wal since %s", terrstr());
dndCleanup();
return -1;
}
SVnodeOpt vnodeOpt = {0};
vnodeOpt.nthreads = tsNumOfCommitThreads;
......@@ -46,17 +51,10 @@ static int32_t vmInit(SMgmtWrapper *pWrapper) {
return -1;
}
if (walInit() != 0) {
dError("failed to init wal since %s", terrstr());
dndCleanup();
return -1;
}
return 0;
}
static void vmCleanup(SMgmtWrapper *pWrapper) {
walCleanUp();
vnodeCleanup();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册