提交 2a3c43ab 编写于 作者: S slguan

[TD-10] change some log format

上级 562967f1
......@@ -41,11 +41,11 @@ int32_t dnodeInitMClient() {
tsDnodeMClientRpc = rpcOpen(&rpcInit);
if (tsDnodeMClientRpc == NULL) {
dError("failed to init connection from mgmt");
dError("failed to init mnode rpc client");
return -1;
}
dPrint("client connection to mgmt is opened");
dPrint("mnode rpc client is opened");
return 0;
}
......
......@@ -80,13 +80,6 @@ int32_t dnodeInitMgmt() {
}
taosTmrReset(dnodeSendStatusMsg, 500, NULL, tsDnodeTmr, &tsStatusTimer);
SMDCreateVnodeMsg cfg;
cfg.cfg.vgId = 1;
cfg.cfg.precision = 0;
cfg.vnode = 1;
cfg.cfg.maxSessions = 1000;
cfg.cfg.daysPerFile = 10;
return dnodeOpenVnodes();
}
......@@ -171,8 +164,8 @@ static int32_t dnodeOpenVnodes() {
int32_t vnode = atoi(de->d_name + 5);
if (vnode == 0) continue;
char vnodeDir[TSDB_FILENAME_LEN];
sprintf(vnodeDir, "%s/%s", tsVnodeDir, de->d_name);
char vnodeDir[TSDB_FILENAME_LEN * 3];
snprintf(vnodeDir, TSDB_FILENAME_LEN * 3, "%s/%s", tsVnodeDir, de->d_name);
int32_t code = dnodeOpenVnode(vnode, vnodeDir);
if (code == 0) {
numOfVnodes++;
......@@ -181,7 +174,7 @@ static int32_t dnodeOpenVnodes() {
}
closedir(dir);
dPrint("all vnodes is opened, num:%d", numOfVnodes);
dPrint("dnode mgmt is opened, vnodes:%d", numOfVnodes);
return TSDB_CODE_SUCCESS;
}
......@@ -189,7 +182,7 @@ typedef void (*CleanupFp)(char *);
static void dnodeCleanupVnodes() {
int32_t num = taosGetIntHashSize(tsDnodeVnodesHash);
taosCleanUpIntHashWithFp(tsDnodeVnodesHash, (CleanupFp)dnodeCleanupVnode);
dPrint("all vnodes is opened, num:%d", num);
dPrint("dnode mgmt is closed, vnodes:%d", num);
}
static int32_t dnodeOpenVnode(int32_t vnode, char *rootDir) {
......@@ -401,10 +394,11 @@ static void dnodeProcessAlterStreamMsg(SRpcMsg *pMsg) {
}
static void dnodeProcessConfigDnodeMsg(SRpcMsg *pMsg) {
// SCfgDnodeMsg *pCfg = (SCfgDnodeMsg *)pCont;
//
// int32_t code = tsCfgDynamicOptions(pCfg->config);
// dnodeSendRspToMnode(pConn, msgType + 1, code, NULL, 0);
SMDCfgDnodeMsg *pCfg = (SMDCfgDnodeMsg *)pMsg->pCont;
int32_t code = tsCfgDynamicOptions(pCfg->config);
SRpcMsg rpcRsp = {.handle = pMsg->handle, .pCont = NULL, .contLen = 0, .code = code, .msgType = 0};
rpcSendResponse(&rpcRsp);
}
static void dnodeSendStatusMsg(void *handle, void *tmrId) {
......
......@@ -40,41 +40,41 @@ int32_t dnodeInitMnode() {
memset(&rpcInit, 0, sizeof(rpcInit));
rpcInit.localIp = tsAnyIp ? "0.0.0.0" : tsPrivateIp;
rpcInit.localPort = tsDnodeMnodePort;
rpcInit.label = "DND-mgmt";
rpcInit.label = "DND-mnode";
rpcInit.numOfThreads = 1;
rpcInit.cfp = dnodeProcessMsgFromMnode;
rpcInit.sessions = TSDB_SESSIONS_PER_DNODE;
rpcInit.connType = TAOS_CONN_SERVER;
rpcInit.idleTime = tsShellActivityTimer * 1500;
rpcInit.idleTime = tsShellActivityTimer * 1000;
tsDnodeMnodeRpc = rpcOpen(&rpcInit);
if (tsDnodeMnodeRpc == NULL) {
dError("failed to init connection from mgmt");
dError("failed to init mnode rpc server");
return -1;
}
dPrint("connection to mgmt is opened");
dPrint("mnode rpc server is opened");
return 0;
}
void dnodeCleanupMnode() {
if (tsDnodeMnodeRpc) {
rpcClose(tsDnodeMnodeRpc);
tsDnodeMnodeRpc = NULL;
}
}
static void dnodeProcessMsgFromMnode(SRpcMsg *pMsg) {
SRpcMsg rspMsg;
rspMsg.handle = pMsg->handle;
rspMsg.pCont = NULL;
rspMsg.handle = pMsg->handle;
rspMsg.pCont = NULL;
rspMsg.contLen = 0;
if (dnodeGetRunStatus() != TSDB_DNODE_RUN_STATUS_RUNING) {
rspMsg.code = TSDB_CODE_NOT_READY;
rpcSendResponse(&rspMsg);
rpcFreeCont(pMsg->pCont);
dTrace("conn:%p, query msg is ignored since dnode not running", pMsg->handle);
dTrace("thandle:%p, query msg is ignored since dnode not running", pMsg->handle);
return;
}
......
......@@ -53,15 +53,15 @@ int32_t dnodeInitShell() {
rpcInit.sessions = TSDB_SESSIONS_PER_DNODE;
rpcInit.connType = TAOS_CONN_SERVER;
rpcInit.idleTime = tsShellActivityTimer * 1500;
rpcInit.afp =
rpcInit.afp = dnodeRetrieveUserAuthInfo;
tsDnodeShellRpc = rpcOpen(&rpcInit);
if (tsDnodeShellRpc == NULL) {
dError("failed to init connection from shell");
dError("failed to init shell rpc server");
return -1;
}
dPrint("connection to shell is opened");
dPrint("shell rpc server is opened");
return 0;
}
......
......@@ -44,6 +44,7 @@ static int32_t mgmtRetrieveConfigs(SShowObj *pShow, char *data, int32_t rows, vo
static int32_t mgmtGetVnodeMeta(STableMeta *pMeta, SShowObj *pShow, void *pConn);
static int32_t mgmtRetrieveVnodes(SShowObj *pShow, char *data, int32_t rows, void *pConn);
static void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg);
static void mgmtProcessCfgDnodeMsgRsp(SRpcMsg *rpcMsg) ;
void mgmtSetDnodeMaxVnodes(SDnodeObj *pDnode) {
int32_t maxVnodes = pDnode->numOfCores * tsNumOfVnodesPerCore;
......@@ -435,6 +436,8 @@ int32_t mgmtInitDnodes() {
mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_VNODES, mgmtGetVnodeMeta);
mgmtAddShellShowRetrieveHandle(TSDB_MGMT_TABLE_VNODES, mgmtRetrieveVnodes);
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CONFIG_DNODE, mgmtProcessCfgDnodeMsg);
mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_CONFIG_DNODE_RSP, mgmtProcessCfgDnodeMsgRsp);
if (mgmtInitDnodesFp) {
return mgmtInitDnodesFp();
......@@ -532,6 +535,11 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) {
if (mgmtCheckRedirect(pMsg->thandle)) return;
SCMCfgDnodeMsg *pCmCfgDnode = pMsg->pCont;
if (pCmCfgDnode->ip[0] == 0) {
strcpy(pCmCfgDnode->ip, tsPrivateIp);
} else {
strcpy(pCmCfgDnode->ip, pCmCfgDnode->ip);
}
uint32_t dnodeIp = inet_addr(pCmCfgDnode->ip);
if (strcmp(pMsg->pUser->pAcct->user, "root") != 0) {
......@@ -558,3 +566,7 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) {
rpcSendResponse(&rpcRsp);
}
static void mgmtProcessCfgDnodeMsgRsp(SRpcMsg *rpcMsg) {
mTrace("cfg vnode rsp is received");
}
\ No newline at end of file
......@@ -135,7 +135,7 @@ int tsOfflineThreshold = 864000; // seconds 10days
int tsMgmtEqualVnodeNum = 4;
int tsEnableHttpModule = 1;
int tsEnableMonitorModule = 1;
int tsEnableMonitorModule = 0;
int tsRestRowLimit = 10240;
int tsMaxSQLStringLen = TSDB_MAX_SQL_LEN;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册