commit
2ed4aeb0da
|
@ -398,6 +398,21 @@ static const SSysDbTableSchema userCompactsDetailSchema[] = {
|
|||
{.name = "finished", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false},
|
||||
{.name = "start_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = false},
|
||||
};
|
||||
|
||||
static const SSysDbTableSchema anodesSchema[] = {
|
||||
{.name = "id", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false},
|
||||
{.name = "url", .bytes = TSDB_ANAL_ANODE_URL_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
|
||||
{.name = "status", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
|
||||
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true},
|
||||
{.name = "update_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true},
|
||||
};
|
||||
|
||||
static const SSysDbTableSchema anodesFullSchema[] = {
|
||||
{.name = "id", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false},
|
||||
{.name = "type", .bytes = TSDB_ANAL_ALGO_TYPE_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
|
||||
{.name = "algo", .bytes = TSDB_ANAL_ALGO_NAME_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
|
||||
};
|
||||
|
||||
static const SSysDbTableSchema tsmaSchema[] = {
|
||||
{.name = "tsma_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false},
|
||||
{.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false},
|
||||
|
@ -472,6 +487,8 @@ static const SSysTableMeta infosMeta[] = {
|
|||
{TSDB_INS_TABLE_ARBGROUPS, arbGroupsSchema, tListLen(arbGroupsSchema), true},
|
||||
{TSDB_INS_TABLE_ENCRYPTIONS, encryptionsSchema, tListLen(encryptionsSchema), true},
|
||||
{TSDB_INS_TABLE_TSMAS, tsmaSchema, tListLen(tsmaSchema), false},
|
||||
{TSDB_INS_TABLE_ANODES, anodesSchema, tListLen(anodesSchema), true},
|
||||
{TSDB_INS_TABLE_ANODES_FULL, anodesFullSchema, tListLen(anodesFullSchema), true},
|
||||
};
|
||||
|
||||
static const SSysDbTableSchema connectionsSchema[] = {
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#define TD_MSG_RANGE_CODE_
|
||||
#include "tmsgdef.h"
|
||||
|
||||
#include "tanal.h"
|
||||
#include "tcol.h"
|
||||
#include "tlog.h"
|
||||
|
||||
|
@ -1453,6 +1454,7 @@ int32_t tSerializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) {
|
|||
}
|
||||
|
||||
TAOS_CHECK_EXIT(tEncodeI64(&encoder, pReq->ipWhiteVer));
|
||||
TAOS_CHECK_EXIT(tEncodeI64(&encoder, pReq->analVer));
|
||||
TAOS_CHECK_EXIT(tSerializeSMonitorParas(&encoder, &pReq->clusterCfg.monitorParas));
|
||||
|
||||
tEndEncode(&encoder);
|
||||
|
@ -1576,6 +1578,10 @@ int32_t tDeserializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) {
|
|||
TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pReq->ipWhiteVer));
|
||||
}
|
||||
|
||||
if (!tDecodeIsEnd(&decoder)) {
|
||||
TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pReq->analVer));
|
||||
}
|
||||
|
||||
if (!tDecodeIsEnd(&decoder)) {
|
||||
TAOS_CHECK_EXIT(tDeserializeSMonitorParas(&decoder, &pReq->clusterCfg.monitorParas));
|
||||
}
|
||||
|
@ -1652,6 +1658,7 @@ int32_t tSerializeSStatusRsp(void *buf, int32_t bufLen, SStatusRsp *pRsp) {
|
|||
TAOS_CHECK_EXIT(tEncodeI32(&encoder, pRsp->statusSeq));
|
||||
|
||||
TAOS_CHECK_EXIT(tEncodeI64(&encoder, pRsp->ipWhiteVer));
|
||||
TAOS_CHECK_EXIT(tEncodeI64(&encoder, pRsp->analVer));
|
||||
tEndEncode(&encoder);
|
||||
|
||||
_exit:
|
||||
|
@ -1703,6 +1710,11 @@ int32_t tDeserializeSStatusRsp(void *buf, int32_t bufLen, SStatusRsp *pRsp) {
|
|||
if (!tDecodeIsEnd(&decoder)) {
|
||||
TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pRsp->ipWhiteVer));
|
||||
}
|
||||
|
||||
if (!tDecodeIsEnd(&decoder)) {
|
||||
TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pRsp->analVer));
|
||||
}
|
||||
|
||||
tEndDecode(&decoder);
|
||||
_exit:
|
||||
tDecoderClear(&decoder);
|
||||
|
@ -2044,6 +2056,156 @@ _exit:
|
|||
return code;
|
||||
}
|
||||
|
||||
int32_t tSerializeRetrieveAnalAlgoReq(void *buf, int32_t bufLen, SRetrieveAnalAlgoReq *pReq) {
|
||||
SEncoder encoder = {0};
|
||||
int32_t code = 0;
|
||||
int32_t lino;
|
||||
int32_t tlen;
|
||||
tEncoderInit(&encoder, buf, bufLen);
|
||||
|
||||
TAOS_CHECK_EXIT(tStartEncode(&encoder));
|
||||
TAOS_CHECK_EXIT(tEncodeI32(&encoder, pReq->dnodeId));
|
||||
TAOS_CHECK_EXIT(tEncodeI64(&encoder, pReq->analVer));
|
||||
tEndEncode(&encoder);
|
||||
|
||||
_exit:
|
||||
if (code) {
|
||||
tlen = code;
|
||||
} else {
|
||||
tlen = encoder.pos;
|
||||
}
|
||||
tEncoderClear(&encoder);
|
||||
return tlen;
|
||||
}
|
||||
|
||||
int32_t tDeserializeRetrieveAnalAlgoReq(void *buf, int32_t bufLen, SRetrieveAnalAlgoReq *pReq) {
|
||||
SDecoder decoder = {0};
|
||||
int32_t code = 0;
|
||||
int32_t lino;
|
||||
|
||||
tDecoderInit(&decoder, buf, bufLen);
|
||||
|
||||
TAOS_CHECK_EXIT(tStartDecode(&decoder));
|
||||
TAOS_CHECK_EXIT(tDecodeI32(&decoder, &pReq->dnodeId));
|
||||
TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pReq->analVer));
|
||||
tEndDecode(&decoder);
|
||||
|
||||
_exit:
|
||||
tDecoderClear(&decoder);
|
||||
return code;
|
||||
}
|
||||
|
||||
int32_t tSerializeRetrieveAnalAlgoRsp(void *buf, int32_t bufLen, SRetrieveAnalAlgoRsp *pRsp) {
|
||||
SEncoder encoder = {0};
|
||||
int32_t code = 0;
|
||||
int32_t lino;
|
||||
int32_t tlen;
|
||||
tEncoderInit(&encoder, buf, bufLen);
|
||||
|
||||
int32_t numOfAlgos = 0;
|
||||
void *pIter = taosHashIterate(pRsp->hash, NULL);
|
||||
while (pIter != NULL) {
|
||||
SAnalUrl *pUrl = pIter;
|
||||
size_t nameLen = 0;
|
||||
const char *name = taosHashGetKey(pIter, &nameLen);
|
||||
if (nameLen > 0 && nameLen <= TSDB_ANAL_ALGO_KEY_LEN && pUrl->urlLen > 0) {
|
||||
numOfAlgos++;
|
||||
}
|
||||
pIter = taosHashIterate(pRsp->hash, pIter);
|
||||
}
|
||||
|
||||
TAOS_CHECK_EXIT(tStartEncode(&encoder));
|
||||
TAOS_CHECK_EXIT(tEncodeI64(&encoder, pRsp->ver));
|
||||
TAOS_CHECK_EXIT(tEncodeI32(&encoder, numOfAlgos));
|
||||
|
||||
pIter = taosHashIterate(pRsp->hash, NULL);
|
||||
while (pIter != NULL) {
|
||||
SAnalUrl *pUrl = pIter;
|
||||
size_t nameLen = 0;
|
||||
const char *name = taosHashGetKey(pIter, &nameLen);
|
||||
if (nameLen > 0 && pUrl->urlLen > 0) {
|
||||
TAOS_CHECK_EXIT(tEncodeI32(&encoder, nameLen));
|
||||
TAOS_CHECK_EXIT(tEncodeBinary(&encoder, (const uint8_t *)name, nameLen));
|
||||
TAOS_CHECK_EXIT(tEncodeI32(&encoder, pUrl->anode));
|
||||
TAOS_CHECK_EXIT(tEncodeI32(&encoder, pUrl->type));
|
||||
TAOS_CHECK_EXIT(tEncodeI32(&encoder, pUrl->urlLen));
|
||||
TAOS_CHECK_EXIT(tEncodeBinary(&encoder, (const uint8_t *)pUrl->url, pUrl->urlLen));
|
||||
}
|
||||
pIter = taosHashIterate(pRsp->hash, pIter);
|
||||
}
|
||||
|
||||
tEndEncode(&encoder);
|
||||
|
||||
_exit:
|
||||
if (code) {
|
||||
tlen = code;
|
||||
} else {
|
||||
tlen = encoder.pos;
|
||||
}
|
||||
tEncoderClear(&encoder);
|
||||
return tlen;
|
||||
}
|
||||
|
||||
int32_t tDeserializeRetrieveAnalAlgoRsp(void *buf, int32_t bufLen, SRetrieveAnalAlgoRsp *pRsp) {
|
||||
if (pRsp->hash == NULL) {
|
||||
pRsp->hash = taosHashInit(64, MurmurHash3_32, true, HASH_ENTRY_LOCK);
|
||||
if (pRsp->hash == NULL) {
|
||||
terrno = TSDB_CODE_OUT_OF_BUFFER;
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
|
||||
SDecoder decoder = {0};
|
||||
int32_t code = 0;
|
||||
int32_t lino;
|
||||
tDecoderInit(&decoder, buf, bufLen);
|
||||
|
||||
int32_t numOfAlgos = 0;
|
||||
int32_t nameLen;
|
||||
int32_t type;
|
||||
char name[TSDB_ANAL_ALGO_KEY_LEN];
|
||||
SAnalUrl url = {0};
|
||||
|
||||
TAOS_CHECK_EXIT(tStartDecode(&decoder));
|
||||
TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pRsp->ver));
|
||||
TAOS_CHECK_EXIT(tDecodeI32(&decoder, &numOfAlgos));
|
||||
|
||||
for (int32_t f = 0; f < numOfAlgos; ++f) {
|
||||
TAOS_CHECK_EXIT(tDecodeI32(&decoder, &nameLen));
|
||||
if (nameLen > 0 && nameLen <= TSDB_ANAL_ALGO_NAME_LEN) {
|
||||
TAOS_CHECK_EXIT(tDecodeCStrTo(&decoder, name));
|
||||
}
|
||||
|
||||
TAOS_CHECK_EXIT(tDecodeI32(&decoder, &url.anode));
|
||||
TAOS_CHECK_EXIT(tDecodeI32(&decoder, &type));
|
||||
url.type = (EAnalAlgoType)type;
|
||||
TAOS_CHECK_EXIT(tDecodeI32(&decoder, &url.urlLen));
|
||||
if (url.urlLen > 0) {
|
||||
TAOS_CHECK_EXIT(tDecodeBinaryAlloc(&decoder, (void **)&url.url, NULL) < 0);
|
||||
}
|
||||
|
||||
TAOS_CHECK_EXIT(taosHashPut(pRsp->hash, name, nameLen, &url, sizeof(SAnalUrl)));
|
||||
}
|
||||
|
||||
tEndDecode(&decoder);
|
||||
|
||||
_exit:
|
||||
tDecoderClear(&decoder);
|
||||
return code;
|
||||
}
|
||||
|
||||
void tFreeRetrieveAnalAlgoRsp(SRetrieveAnalAlgoRsp *pRsp) {
|
||||
void *pIter = taosHashIterate(pRsp->hash, NULL);
|
||||
while (pIter != NULL) {
|
||||
SAnalUrl *pUrl = (SAnalUrl *)pIter;
|
||||
taosMemoryFree(pUrl->url);
|
||||
pIter = taosHashIterate(pRsp->hash, pIter);
|
||||
}
|
||||
taosHashCleanup(pRsp->hash);
|
||||
|
||||
pRsp->hash = NULL;
|
||||
}
|
||||
|
||||
void tFreeSCreateUserReq(SCreateUserReq *pReq) {
|
||||
FREESQL();
|
||||
taosMemoryFreeClear(pReq->pIpRanges);
|
||||
|
@ -2961,6 +3123,108 @@ _exit:
|
|||
return code;
|
||||
}
|
||||
|
||||
int32_t tSerializeSMCreateAnodeReq(void *buf, int32_t bufLen, SMCreateAnodeReq *pReq) {
|
||||
SEncoder encoder = {0};
|
||||
int32_t code = 0;
|
||||
int32_t lino;
|
||||
int32_t tlen;
|
||||
tEncoderInit(&encoder, buf, bufLen);
|
||||
|
||||
TAOS_CHECK_EXIT(tStartEncode(&encoder));
|
||||
TAOS_CHECK_EXIT(tEncodeI32(&encoder, pReq->urlLen));
|
||||
if (pReq->urlLen > 0) {
|
||||
TAOS_CHECK_EXIT(tEncodeBinary(&encoder, (const uint8_t *)pReq->url, pReq->urlLen));
|
||||
}
|
||||
ENCODESQL();
|
||||
tEndEncode(&encoder);
|
||||
|
||||
_exit:
|
||||
if (code) {
|
||||
tlen = code;
|
||||
} else {
|
||||
tlen = encoder.pos;
|
||||
}
|
||||
tEncoderClear(&encoder);
|
||||
return tlen;
|
||||
}
|
||||
|
||||
int32_t tDeserializeSMCreateAnodeReq(void *buf, int32_t bufLen, SMCreateAnodeReq *pReq) {
|
||||
SDecoder decoder = {0};
|
||||
int32_t code = 0;
|
||||
int32_t lino;
|
||||
|
||||
tDecoderInit(&decoder, buf, bufLen);
|
||||
|
||||
TAOS_CHECK_EXIT(tStartDecode(&decoder));
|
||||
TAOS_CHECK_EXIT(tDecodeI32(&decoder, &pReq->urlLen));
|
||||
if (pReq->urlLen > 0) {
|
||||
TAOS_CHECK_EXIT(tDecodeBinaryAlloc(&decoder, (void **)&pReq->url, NULL));
|
||||
}
|
||||
|
||||
DECODESQL();
|
||||
tEndDecode(&decoder);
|
||||
|
||||
_exit:
|
||||
tDecoderClear(&decoder);
|
||||
return code;
|
||||
}
|
||||
|
||||
void tFreeSMCreateAnodeReq(SMCreateAnodeReq *pReq) {
|
||||
taosMemoryFreeClear(pReq->url);
|
||||
FREESQL();
|
||||
}
|
||||
|
||||
int32_t tSerializeSMDropAnodeReq(void *buf, int32_t bufLen, SMDropAnodeReq *pReq) {
|
||||
SEncoder encoder = {0};
|
||||
int32_t code = 0;
|
||||
int32_t lino;
|
||||
int32_t tlen;
|
||||
tEncoderInit(&encoder, buf, bufLen);
|
||||
|
||||
TAOS_CHECK_EXIT(tStartEncode(&encoder));
|
||||
TAOS_CHECK_EXIT(tEncodeI32(&encoder, pReq->anodeId));
|
||||
ENCODESQL();
|
||||
tEndEncode(&encoder);
|
||||
|
||||
_exit:
|
||||
if (code) {
|
||||
tlen = code;
|
||||
} else {
|
||||
tlen = encoder.pos;
|
||||
}
|
||||
tEncoderClear(&encoder);
|
||||
return tlen;
|
||||
}
|
||||
|
||||
int32_t tDeserializeSMDropAnodeReq(void *buf, int32_t bufLen, SMDropAnodeReq *pReq) {
|
||||
SDecoder decoder = {0};
|
||||
int32_t code = 0;
|
||||
int32_t lino;
|
||||
|
||||
tDecoderInit(&decoder, buf, bufLen);
|
||||
|
||||
TAOS_CHECK_EXIT(tStartDecode(&decoder));
|
||||
TAOS_CHECK_EXIT(tDecodeI32(&decoder, &pReq->anodeId));
|
||||
DECODESQL();
|
||||
tEndDecode(&decoder);
|
||||
|
||||
_exit:
|
||||
tDecoderClear(&decoder);
|
||||
return code;
|
||||
}
|
||||
|
||||
void tFreeSMDropAnodeReq(SMDropAnodeReq *pReq) { FREESQL(); }
|
||||
|
||||
int32_t tSerializeSMUpdateAnodeReq(void *buf, int32_t bufLen, SMUpdateAnodeReq *pReq) {
|
||||
return tSerializeSMDropAnodeReq(buf, bufLen, pReq);
|
||||
}
|
||||
|
||||
int32_t tDeserializeSMUpdateAnodeReq(void *buf, int32_t bufLen, SMUpdateAnodeReq *pReq) {
|
||||
return tDeserializeSMDropAnodeReq(buf, bufLen, pReq);
|
||||
}
|
||||
|
||||
void tFreeSMUpdateAnodeReq(SMUpdateAnodeReq *pReq) { tFreeSMDropAnodeReq(pReq); }
|
||||
|
||||
int32_t tSerializeSCreateDnodeReq(void *buf, int32_t bufLen, SCreateDnodeReq *pReq) {
|
||||
SEncoder encoder = {0};
|
||||
int32_t code = 0;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "dmInt.h"
|
||||
#include "monitor.h"
|
||||
#include "systable.h"
|
||||
#include "tanal.h"
|
||||
#include "tchecksum.h"
|
||||
|
||||
extern SConfig *tsCfg;
|
||||
|
@ -39,6 +40,7 @@ static void dmUpdateDnodeCfg(SDnodeMgmt *pMgmt, SDnodeCfg *pCfg) {
|
|||
(void)taosThreadRwlockUnlock(&pMgmt->pData->lock);
|
||||
}
|
||||
}
|
||||
|
||||
static void dmMayShouldUpdateIpWhiteList(SDnodeMgmt *pMgmt, int64_t ver) {
|
||||
int32_t code = 0;
|
||||
dDebug("ip-white-list on dnode ver: %" PRId64 ", status ver: %" PRId64 "", pMgmt->pData->ipWhiteVer, ver);
|
||||
|
@ -84,6 +86,47 @@ static void dmMayShouldUpdateIpWhiteList(SDnodeMgmt *pMgmt, int64_t ver) {
|
|||
dError("failed to send retrieve ip white list request since:%s", tstrerror(code));
|
||||
}
|
||||
}
|
||||
|
||||
static void dmMayShouldUpdateAnalFunc(SDnodeMgmt *pMgmt, int64_t newVer) {
|
||||
int32_t code = 0;
|
||||
int64_t oldVer = taosAnalGetVersion();
|
||||
if (oldVer == newVer) return;
|
||||
dDebug("analysis on dnode ver:%" PRId64 ", status ver:%" PRId64, oldVer, newVer);
|
||||
|
||||
SRetrieveAnalAlgoReq req = {.dnodeId = pMgmt->pData->dnodeId, .analVer = oldVer};
|
||||
int32_t contLen = tSerializeRetrieveAnalAlgoReq(NULL, 0, &req);
|
||||
if (contLen < 0) {
|
||||
dError("failed to serialize analysis function ver request since %s", tstrerror(contLen));
|
||||
return;
|
||||
}
|
||||
|
||||
void *pHead = rpcMallocCont(contLen);
|
||||
contLen = tSerializeRetrieveAnalAlgoReq(pHead, contLen, &req);
|
||||
if (contLen < 0) {
|
||||
rpcFreeCont(pHead);
|
||||
dError("failed to serialize analysis function ver request since %s", tstrerror(contLen));
|
||||
return;
|
||||
}
|
||||
|
||||
SRpcMsg rpcMsg = {
|
||||
.pCont = pHead,
|
||||
.contLen = contLen,
|
||||
.msgType = TDMT_MND_RETRIEVE_ANAL_ALGO,
|
||||
.info.ahandle = (void *)0x9527,
|
||||
.info.refId = 0,
|
||||
.info.noResp = 0,
|
||||
.info.handle = 0,
|
||||
};
|
||||
SEpSet epset = {0};
|
||||
|
||||
(void)dmGetMnodeEpSet(pMgmt->pData, &epset);
|
||||
|
||||
code = rpcSendRequest(pMgmt->msgCb.clientRpc, &epset, &rpcMsg, NULL);
|
||||
if (code != 0) {
|
||||
dError("failed to send retrieve analysis func ver request since %s", tstrerror(code));
|
||||
}
|
||||
}
|
||||
|
||||
static void dmProcessStatusRsp(SDnodeMgmt *pMgmt, SRpcMsg *pRsp) {
|
||||
const STraceId *trace = &pRsp->info.traceId;
|
||||
dGTrace("status rsp received from mnode, statusSeq:%d code:0x%x", pMgmt->statusSeq, pRsp->code);
|
||||
|
@ -111,6 +154,7 @@ static void dmProcessStatusRsp(SDnodeMgmt *pMgmt, SRpcMsg *pRsp) {
|
|||
dmUpdateEps(pMgmt->pData, statusRsp.pDnodeEps);
|
||||
}
|
||||
dmMayShouldUpdateIpWhiteList(pMgmt, statusRsp.ipWhiteVer);
|
||||
dmMayShouldUpdateAnalFunc(pMgmt, statusRsp.analVer);
|
||||
}
|
||||
tFreeSStatusRsp(&statusRsp);
|
||||
}
|
||||
|
@ -172,6 +216,7 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) {
|
|||
pMgmt->statusSeq++;
|
||||
req.statusSeq = pMgmt->statusSeq;
|
||||
req.ipWhiteVer = pMgmt->pData->ipWhiteVer;
|
||||
req.analVer = taosAnalGetVersion();
|
||||
|
||||
int32_t contLen = tSerializeSStatusReq(NULL, 0, &req);
|
||||
if (contLen < 0) {
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "dmMgmt.h"
|
||||
#include "qworker.h"
|
||||
#include "tversion.h"
|
||||
#include "tanal.h"
|
||||
|
||||
static inline void dmSendRsp(SRpcMsg *pMsg) {
|
||||
if (rpcSendResponse(pMsg) != 0) {
|
||||
|
@ -105,6 +106,17 @@ static bool dmIsForbiddenIp(int8_t forbidden, char *user, uint32_t clientIp) {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static void dmUpdateAnalFunc(SDnodeData *pData, void *pTrans, SRpcMsg *pRpc) {
|
||||
SRetrieveAnalAlgoRsp rsp = {0};
|
||||
if (tDeserializeRetrieveAnalAlgoRsp(pRpc->pCont, pRpc->contLen, &rsp) == 0) {
|
||||
taosAnalUpdate(rsp.ver, rsp.hash);
|
||||
rsp.hash = NULL;
|
||||
}
|
||||
tFreeRetrieveAnalAlgoRsp(&rsp);
|
||||
rpcFreeCont(pRpc->pCont);
|
||||
}
|
||||
|
||||
static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
|
||||
SDnodeTrans *pTrans = &pDnode->trans;
|
||||
int32_t code = -1;
|
||||
|
@ -150,10 +162,12 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
|
|||
dmSetMnodeEpSet(&pDnode->data, pEpSet);
|
||||
}
|
||||
break;
|
||||
case TDMT_MND_RETRIEVE_IP_WHITE_RSP: {
|
||||
case TDMT_MND_RETRIEVE_IP_WHITE_RSP:
|
||||
dmUpdateRpcIpWhite(&pDnode->data, pTrans->serverRpc, pRpc);
|
||||
return;
|
||||
} break;
|
||||
case TDMT_MND_RETRIEVE_ANAL_ALGO_RSP:
|
||||
dmUpdateAnalFunc(&pDnode->data, pTrans->serverRpc, pRpc);
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ class TDTestCase:
|
|||
|
||||
tdSql.query('select count(*),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;')
|
||||
tdSql.checkRows(3)
|
||||
tdSql.checkData(0, 0, 32)
|
||||
tdSql.checkData(0, 0, 34)
|
||||
tdSql.checkData(0, 1, 'information_schema')
|
||||
tdSql.checkData(0, 2, None)
|
||||
tdSql.checkData(1, 0, 3)
|
||||
|
@ -77,7 +77,7 @@ class TDTestCase:
|
|||
|
||||
tdSql.query('select count(1) v,db_name, stable_name from information_schema.ins_tables group by db_name, stable_name order by v desc;')
|
||||
tdSql.checkRows(3)
|
||||
tdSql.checkData(0, 0, 32)
|
||||
tdSql.checkData(0, 0, 34)
|
||||
tdSql.checkData(0, 1, 'information_schema')
|
||||
tdSql.checkData(0, 2, None)
|
||||
tdSql.checkData(1, 0, 5)
|
||||
|
@ -93,7 +93,7 @@ class TDTestCase:
|
|||
tdSql.checkData(1, 1, 'performance_schema')
|
||||
tdSql.checkData(0, 0, 3)
|
||||
tdSql.checkData(0, 1, 'tbl_count')
|
||||
tdSql.checkData(2, 0, 32)
|
||||
tdSql.checkData(2, 0, 34)
|
||||
tdSql.checkData(2, 1, 'information_schema')
|
||||
|
||||
tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'")
|
||||
|
@ -106,7 +106,7 @@ class TDTestCase:
|
|||
|
||||
tdSql.query('select count(*) from information_schema.ins_tables')
|
||||
tdSql.checkRows(1)
|
||||
tdSql.checkData(0, 0, 40)
|
||||
tdSql.checkData(0, 0, 42)
|
||||
|
||||
|
||||
tdSql.execute('create table stba (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(10), c9 nchar(10), c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned) TAGS(t1 int, t2 binary(10), t3 double);')
|
||||
|
@ -189,7 +189,7 @@ class TDTestCase:
|
|||
tdSql.checkData(2, 0, 5)
|
||||
tdSql.checkData(2, 1, 'performance_schema')
|
||||
tdSql.checkData(2, 2, None)
|
||||
tdSql.checkData(3, 0, 32)
|
||||
tdSql.checkData(3, 0, 34)
|
||||
tdSql.checkData(3, 1, 'information_schema')
|
||||
tdSql.checkData(3, 2, None)
|
||||
|
||||
|
@ -204,7 +204,7 @@ class TDTestCase:
|
|||
tdSql.checkData(2, 0, 5)
|
||||
tdSql.checkData(2, 1, 'performance_schema')
|
||||
tdSql.checkData(2, 2, None)
|
||||
tdSql.checkData(3, 0, 32)
|
||||
tdSql.checkData(3, 0, 34)
|
||||
tdSql.checkData(3, 1, 'information_schema')
|
||||
tdSql.checkData(3, 2, None)
|
||||
|
||||
|
@ -215,7 +215,7 @@ class TDTestCase:
|
|||
tdSql.checkData(0, 1, 'tbl_count')
|
||||
tdSql.checkData(1, 0, 5)
|
||||
tdSql.checkData(1, 1, 'performance_schema')
|
||||
tdSql.checkData(2, 0, 32)
|
||||
tdSql.checkData(2, 0, 34)
|
||||
tdSql.checkData(2, 1, 'information_schema')
|
||||
|
||||
tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'")
|
||||
|
@ -228,7 +228,7 @@ class TDTestCase:
|
|||
|
||||
tdSql.query('select count(*) from information_schema.ins_tables')
|
||||
tdSql.checkRows(1)
|
||||
tdSql.checkData(0, 0, 41)
|
||||
tdSql.checkData(0, 0, 43)
|
||||
|
||||
|
||||
tdSql.execute('drop database tbl_count')
|
||||
|
|
|
@ -58,7 +58,7 @@ endi
|
|||
|
||||
sql select tbname from information_schema.ins_tables;
|
||||
print $rows $data00
|
||||
if $rows != 41 then
|
||||
if $rows != 43 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @ins_tables@ then
|
||||
|
|
|
@ -53,7 +53,7 @@ sql select stable_name,count(table_name) from information_schema.ins_tables grou
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 38 then
|
||||
if $data01 != 40 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 10 then
|
||||
|
@ -72,7 +72,7 @@ endi
|
|||
if $data11 != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 32 then
|
||||
if $data21 != 34 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 5 then
|
||||
|
@ -97,7 +97,7 @@ endi
|
|||
if $data42 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data52 != 32 then
|
||||
if $data52 != 34 then
|
||||
return -1
|
||||
endi
|
||||
if $data62 != 5 then
|
||||
|
|
|
@ -61,7 +61,7 @@ class TDTestCase:
|
|||
self.ins_list = ['ins_dnodes','ins_mnodes','ins_qnodes','ins_snodes','ins_cluster','ins_databases','ins_functions',\
|
||||
'ins_indexes','ins_stables','ins_tables','ins_tags','ins_columns','ins_users','ins_grants','ins_vgroups','ins_configs','ins_dnode_variables',\
|
||||
'ins_topics','ins_subscriptions','ins_streams','ins_stream_tasks','ins_vnodes','ins_user_privileges','ins_views',
|
||||
'ins_compacts', 'ins_compact_details', 'ins_grants_full','ins_grants_logs', 'ins_machines', 'ins_arbgroups', 'ins_tsmas', "ins_encryptions"]
|
||||
'ins_compacts', 'ins_compact_details', 'ins_grants_full','ins_grants_logs', 'ins_machines', 'ins_arbgroups', 'ins_tsmas', "ins_encryptions", "ins_anodes", "ins_anodes_full"]
|
||||
self.perf_list = ['perf_connections','perf_queries','perf_consumers','perf_trans','perf_apps']
|
||||
def insert_data(self,column_dict,tbname,row_num):
|
||||
insert_sql = self.setsql.set_insertsql(column_dict,tbname,self.binary_str,self.nchar_str)
|
||||
|
@ -222,7 +222,7 @@ class TDTestCase:
|
|||
|
||||
tdSql.query("select * from information_schema.ins_columns where db_name ='information_schema'")
|
||||
tdLog.info(len(tdSql.queryResult))
|
||||
tdSql.checkEqual(True, len(tdSql.queryResult) in range(272, 273))
|
||||
tdSql.checkEqual(True, len(tdSql.queryResult) in range(280, 281))
|
||||
|
||||
tdSql.query("select * from information_schema.ins_columns where db_name ='performance_schema'")
|
||||
tdSql.checkEqual(56, len(tdSql.queryResult))
|
||||
|
|
Loading…
Reference in New Issue