refactor: node mgmt
This commit is contained in:
parent
7e207e16e3
commit
5669f2a1ba
|
@ -26,7 +26,7 @@ static const SSysDbTableSchema dnodesSchema[] = {
|
|||
{.name = "id", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT},
|
||||
{.name = "endpoint", .bytes = TSDB_EP_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
|
||||
{.name = "vnodes", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT},
|
||||
{.name = "max_vnodes", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT},
|
||||
{.name = "support_vnodes", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT},
|
||||
{.name = "status", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
|
||||
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP},
|
||||
{.name = "note", .bytes = 256 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR},
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
|
||||
#define _DEFAULT_SOURCE
|
||||
#include "dmImp.h"
|
||||
#include "dmMgmt.h"
|
||||
#include "tconfig.h"
|
||||
|
||||
#define DM_APOLLO_URL "The apollo string to use when configuring the server, such as: -a 'jsonFile:./tests/cfg.json', cfg.json text can be '{\"fqdn\":\"td1\"}'."
|
||||
|
|
|
@ -27,8 +27,8 @@ static void dmUpdateDnodeCfg(SDnodeMgmt *pMgmt, SDnodeCfg *pCfg) {
|
|||
}
|
||||
}
|
||||
|
||||
static int32_t dmProcessStatusRsp(SDnodeMgmt *pMgmt, SRpcMsg *pRsp) {
|
||||
if (pRsp->code != TSDB_CODE_SUCCESS) {
|
||||
static void dmProcessStatusRsp(SDnodeMgmt *pMgmt, SRpcMsg *pRsp) {
|
||||
if (pRsp->code != 0) {
|
||||
if (pRsp->code == TSDB_CODE_MND_DNODE_NOT_EXIST && !pMgmt->data.dropped && pMgmt->data.dnodeId > 0) {
|
||||
dInfo("dnode:%d, set to dropped since not exist in mnode", pMgmt->data.dnodeId);
|
||||
pMgmt->data.dropped = 1;
|
||||
|
@ -45,8 +45,6 @@ static int32_t dmProcessStatusRsp(SDnodeMgmt *pMgmt, SRpcMsg *pRsp) {
|
|||
rpcFreeCont(pRsp->pCont);
|
||||
tFreeSStatusRsp(&statusRsp);
|
||||
}
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
void dmSendStatusReq(SDnodeMgmt *pMgmt) {
|
||||
|
|
|
@ -86,6 +86,7 @@ static int32_t dmOpenMgmt(const SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput)
|
|||
}
|
||||
|
||||
pOutput->pMgmt = pMgmt;
|
||||
pOutput->mnodeEps = pMgmt->data.mnodeEps;
|
||||
dInfo("dnode-mgmt is initialized");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
|
||||
#define _DEFAULT_SOURCE
|
||||
#include "dmImp.h"
|
||||
#include "dmMgmt.h"
|
||||
|
||||
static bool dmIsNodeDeployedFp(SDnode *pDnode, EDndNodeType ntype) { return pDnode->wrappers[ntype].required; }
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
|
||||
#define _DEFAULT_SOURCE
|
||||
#include "dmImp.h"
|
||||
#include "dmMgmt.h"
|
||||
|
||||
static int32_t dmInitParentProc(SMgmtWrapper *pWrapper) {
|
||||
int32_t shmsize = tsMnodeShmSize;
|
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
|
||||
#define _DEFAULT_SOURCE
|
||||
#include "dmImp.h"
|
||||
#include "dmMgmt.h"
|
||||
#include "qworker.h"
|
||||
|
||||
#define INTERNAL_USER "_dnd"
|
||||
|
|
Loading…
Reference in New Issue