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

[TD-10] change some log format

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