提交 611b3978 编写于 作者: S Shengliang Guan

TD-2324

上级 6f355840
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "tfile.h" #include "tfile.h"
#include "twal.h" #include "twal.h"
#include "tfs.h" #include "tfs.h"
#include "tsync.h"
#include "dnodePeer.h" #include "dnodePeer.h"
#include "dnodeModule.h" #include "dnodeModule.h"
#include "dnodeEps.h" #include "dnodeEps.h"
...@@ -53,6 +54,7 @@ static SStep tsDnodeSteps[] = { ...@@ -53,6 +54,7 @@ static SStep tsDnodeSteps[] = {
{"dnode-eps", dnodeInitEps, dnodeCleanupEps}, {"dnode-eps", dnodeInitEps, dnodeCleanupEps},
{"dnode-minfos", dnodeInitMInfos, dnodeCleanupMInfos}, {"dnode-minfos", dnodeInitMInfos, dnodeCleanupMInfos},
{"dnode-wal", walInit, walCleanUp}, {"dnode-wal", walInit, walCleanUp},
{"dnode-sync", syncInit, syncCleanUp},
{"dnode-check", dnodeInitCheck, dnodeCleanupCheck}, // NOTES: dnodeInitCheck must be behind the dnodeinitStorage component !!! {"dnode-check", dnodeInitCheck, dnodeCleanupCheck}, // NOTES: dnodeInitCheck must be behind the dnodeinitStorage component !!!
{"dnode-vread", dnodeInitVRead, dnodeCleanupVRead}, {"dnode-vread", dnodeInitVRead, dnodeCleanupVRead},
{"dnode-vwrite", dnodeInitVWrite, dnodeCleanupVWrite}, {"dnode-vwrite", dnodeInitVWrite, dnodeCleanupVWrite},
......
...@@ -49,13 +49,13 @@ int32_t dnodeInitVMgmt() { ...@@ -49,13 +49,13 @@ int32_t dnodeInitVMgmt() {
tsMgmtQset = taosOpenQset(); tsMgmtQset = taosOpenQset();
if (tsMgmtQset == NULL) { if (tsMgmtQset == NULL) {
dError("failed to create the mgmt queue set"); dError("failed to create the vmgmt queue set");
return -1; return -1;
} }
tsMgmtQueue = taosOpenQueue(); tsMgmtQueue = taosOpenQueue();
if (tsMgmtQueue == NULL) { if (tsMgmtQueue == NULL) {
dError("failed to create the mgmt queue"); dError("failed to create the vmgmt queue");
return -1; return -1;
} }
...@@ -68,11 +68,11 @@ int32_t dnodeInitVMgmt() { ...@@ -68,11 +68,11 @@ int32_t dnodeInitVMgmt() {
code = pthread_create(&tsQthread, &thAttr, dnodeProcessMgmtQueue, NULL); code = pthread_create(&tsQthread, &thAttr, dnodeProcessMgmtQueue, NULL);
pthread_attr_destroy(&thAttr); pthread_attr_destroy(&thAttr);
if (code != 0) { if (code != 0) {
dError("failed to create thread to process mgmt queue, reason:%s", strerror(errno)); dError("failed to create thread to process vmgmt queue, reason:%s", strerror(errno));
return -1; return -1;
} }
dInfo("dnode mgmt is initialized"); dInfo("dnode vmgmt is initialized");
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -133,9 +133,12 @@ static void *dnodeProcessMgmtQueue(void *param) { ...@@ -133,9 +133,12 @@ static void *dnodeProcessMgmtQueue(void *param) {
rsp.code = TSDB_CODE_DND_MSG_NOT_PROCESSED; rsp.code = TSDB_CODE_DND_MSG_NOT_PROCESSED;
} }
rsp.handle = pMsg->handle; dDebug("msg:%p, is processed, code:0x%x", pMgmt, rsp.code);
rsp.pCont = NULL; if (rsp.code != TSDB_CODE_DND_ACTION_IN_PROGRESS) {
rpcSendResponse(&rsp); rsp.handle = pMsg->handle;
rsp.pCont = NULL;
rpcSendResponse(&rsp);
}
taosFreeQitem(pMsg); taosFreeQitem(pMsg);
} }
......
...@@ -192,6 +192,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_DND_MSG_NOT_PROCESSED, 0, 0x0400, "Message no ...@@ -192,6 +192,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_DND_MSG_NOT_PROCESSED, 0, 0x0400, "Message no
TAOS_DEFINE_ERROR(TSDB_CODE_DND_OUT_OF_MEMORY, 0, 0x0401, "Dnode out of memory") TAOS_DEFINE_ERROR(TSDB_CODE_DND_OUT_OF_MEMORY, 0, 0x0401, "Dnode out of memory")
TAOS_DEFINE_ERROR(TSDB_CODE_DND_NO_WRITE_ACCESS, 0, 0x0402, "No permission for disk files in dnode") TAOS_DEFINE_ERROR(TSDB_CODE_DND_NO_WRITE_ACCESS, 0, 0x0402, "No permission for disk files in dnode")
TAOS_DEFINE_ERROR(TSDB_CODE_DND_INVALID_MSG_LEN, 0, 0x0403, "Invalid message length") TAOS_DEFINE_ERROR(TSDB_CODE_DND_INVALID_MSG_LEN, 0, 0x0403, "Invalid message length")
TAOS_DEFINE_ERROR(TSDB_CODE_DND_ACTION_IN_PROGRESS, 0, 0x0404, "Action in progress")
// vnode // vnode
TAOS_DEFINE_ERROR(TSDB_CODE_VND_ACTION_IN_PROGRESS, 0, 0x0500, "Action in progress") TAOS_DEFINE_ERROR(TSDB_CODE_VND_ACTION_IN_PROGRESS, 0, 0x0500, "Action in progress")
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "os.h" #include "os.h"
#include "dnode.h" #include "dnode.h"
#include "vnodeStatus.h" #include "vnodeStatus.h"
#include "vnodeWorker.h"
#include "vnodeRead.h" #include "vnodeRead.h"
#include "vnodeWrite.h" #include "vnodeWrite.h"
#include "vnodeMain.h" #include "vnodeMain.h"
...@@ -28,11 +29,11 @@ static void vnodeCleanupHash(void); ...@@ -28,11 +29,11 @@ static void vnodeCleanupHash(void);
static void vnodeIncRef(void *ptNode); static void vnodeIncRef(void *ptNode);
static SStep tsVnodeSteps[] = { static SStep tsVnodeSteps[] = {
{"vsync", syncInit, syncCleanUp}, {"vnode-worker", vnodeInitMWorker, vnodeCleanupMWorker},
{"vwrite", vnodeInitWrite, vnodeCleanupWrite}, {"vnode-write", vnodeInitWrite, vnodeCleanupWrite},
{"vread", vnodeInitRead, vnodeCleanupRead}, {"vnode-read", vnodeInitRead, vnodeCleanupRead},
{"vhash", vnodeInitHash, vnodeCleanupHash}, {"vnode-hash", vnodeInitHash, vnodeCleanupHash},
{"vqueue", tsdbInitCommitQueue, tsdbDestroyCommitQueue} {"tsdb-queue", tsdbInitCommitQueue, tsdbDestroyCommitQueue}
}; };
int32_t vnodeInitMgmt() { int32_t vnodeInitMgmt() {
......
...@@ -143,7 +143,11 @@ static int32_t vnodeWriteIntoMWorker(int32_t vgId, EVMWorkerAction action,void * ...@@ -143,7 +143,11 @@ static int32_t vnodeWriteIntoMWorker(int32_t vgId, EVMWorkerAction action,void *
pMsg->pVnode = pVnode; pMsg->pVnode = pVnode;
pMsg->rpcHandle = rpcHandle; pMsg->rpcHandle = rpcHandle;
pMsg->action = action; pMsg->action = action;
return taosWriteQitem(tsVMWorkerQueue, TAOS_QTYPE_RPC, pMsg);
int32_t code = taosWriteQitem(tsVMWorkerQueue, TAOS_QTYPE_RPC, pMsg);
if (code == 0) code = TSDB_CODE_DND_ACTION_IN_PROGRESS;
return code;
} }
int32_t vnodeOpenInMWorker(int32_t vgId, void *rpcHandle) { int32_t vnodeOpenInMWorker(int32_t vgId, void *rpcHandle) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册