diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 46ab92c990c176e1f4cb3ac8100912c10b1e6898..b2e1da0692ee7d54abd47fd44f0bafb0d7303971 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -40,9 +40,10 @@ int32_t* taosGetErrno(); #define TSDB_CODE_FAILED -1 // unknown or needn't tell detail error //common & util -#define TSDB_CODE_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x0001) -#define TSDB_CODE_APP_NOT_READY TAOS_DEF_ERROR_CODE(0, 0x0002) -#define TSDB_CODE_APP_ERROR TAOS_DEF_ERROR_CODE(0, 0x0003) +#define TSDB_CODE_RSP_IN_APP TAOS_DEF_ERROR_CODE(0, 0x0001) +#define TSDB_CODE_CLEAN_AND_RSP_IN_APP TAOS_DEF_ERROR_CODE(0, 0x0002) +#define TSDB_CODE_APP_NOT_READY TAOS_DEF_ERROR_CODE(0, 0x000A) +#define TSDB_CODE_APP_ERROR TAOS_DEF_ERROR_CODE(0, 0x000B) #define TSDB_CODE_OUT_OF_MEMORY TAOS_DEF_ERROR_CODE(0, 0x0011) #define TSDB_CODE_OUT_OF_RANGE TAOS_DEF_ERROR_CODE(0, 0x0011) #define TSDB_CODE_OUT_OF_SHM_MEM TAOS_DEF_ERROR_CODE(0, 0x0012) diff --git a/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h b/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h index 5818b5880190f5db86e4e72557989544db012245..52711af4f8a7c3b7f86f97001ea00b81725bf3e4 100644 --- a/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h +++ b/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h @@ -134,10 +134,9 @@ SMgmtWrapper *dmAcquireWrapper(SDnode *pDnode, EDndNodeType nType); int32_t dmMarkWrapper(SMgmtWrapper *pWrapper); void dmReleaseWrapper(SMgmtWrapper *pWrapper); SMgmtInputOpt dmBuildMgmtInputOpt(SMgmtWrapper *pWrapper); - -void dmSetStatus(SDnode *pDnode, EDndRunStatus stype); -void dmProcessServerStartupStatus(SDnode *pDnode, SRpcMsg *pMsg); -void dmProcessNetTestReq(SDnode *pDnode, SRpcMsg *pMsg); +void dmSetStatus(SDnode *pDnode, EDndRunStatus stype); +int32_t dmProcessServerStartupStatus(SDnode *pDnode, SRpcMsg *pMsg); +int32_t dmProcessNetTestReq(SDnode *pDnode, SRpcMsg *pMsg); // dmNodes.c int32_t dmOpenNode(SMgmtWrapper *pWrapper); diff --git a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c index 96285bbe1ca58bc1e3c900cb787aae0e3387e234..cf27d89d087e367d6a245998a3062d9cf5bca6b1 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c +++ b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c @@ -277,7 +277,7 @@ static void dmGetServerStartupStatus(SDnode *pDnode, SServerStatusRsp *pStatus) } } -void dmProcessNetTestReq(SDnode *pDnode, SRpcMsg *pMsg) { +int32_t dmProcessNetTestReq(SDnode *pDnode, SRpcMsg *pMsg) { dDebug("msg:%p, net test req will be processed", pMsg); SRpcMsg rsp = {.code = 0, .info = pMsg->info}; rsp.pCont = rpcMallocCont(pMsg->contLen); @@ -287,9 +287,10 @@ void dmProcessNetTestReq(SDnode *pDnode, SRpcMsg *pMsg) { rsp.contLen = pMsg->contLen; } rpcSendResponse(&rsp); + return TSDB_CODE_RSP_IN_APP; } -void dmProcessServerStartupStatus(SDnode *pDnode, SRpcMsg *pMsg) { +int32_t dmProcessServerStartupStatus(SDnode *pDnode, SRpcMsg *pMsg) { dDebug("msg:%p, server startup status req will be processed", pMsg); SServerStatusRsp statusRsp = {0}; dmGetServerStartupStatus(pDnode, &statusRsp); @@ -313,4 +314,5 @@ void dmProcessServerStartupStatus(SDnode *pDnode, SRpcMsg *pMsg) { _OVER: rpcSendResponse(&rspMsg); + return TSDB_CODE_RSP_IN_APP; } diff --git a/source/util/src/terror.c b/source/util/src/terror.c index f71e54bf7d903a16e52b27282a7e1f5179b95fd7..64052d2634fd0991e9a3f917d5d5e96c1a7810cd 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -46,7 +46,8 @@ STaosError errors[] = { #endif //common & util -TAOS_DEFINE_ERROR(TSDB_CODE_ACTION_IN_PROGRESS, "Action in progress") +TAOS_DEFINE_ERROR(TSDB_CODE_RSP_IN_APP, "Cleanup in App") +TAOS_DEFINE_ERROR(TSDB_CODE_CLEAN_AND_RSP_IN_APP, "Cleanup and rsp in App") TAOS_DEFINE_ERROR(TSDB_CODE_APP_NOT_READY, "Database not ready") TAOS_DEFINE_ERROR(TSDB_CODE_APP_ERROR, "Database internal error") TAOS_DEFINE_ERROR(TSDB_CODE_OUT_OF_MEMORY, "Out of Memory")