fix bug
This commit is contained in:
parent
3d10b6f81d
commit
dd45e955dc
|
@ -44,9 +44,18 @@ void tscSaveSubscriptionProgress(void* sub);
|
||||||
|
|
||||||
static int32_t minMsgSize() { return tsRpcHeadSize + 100; }
|
static int32_t minMsgSize() { return tsRpcHeadSize + 100; }
|
||||||
|
|
||||||
|
void tscIpSetCopy(SRpcIpSet *dst, SRpcIpSet *src) {
|
||||||
|
dst->numOfIps = src->numOfIps;
|
||||||
|
dst->inUse = src->inUse;
|
||||||
|
for (int32_t i = 0; i < src->numOfIps; ++i) {
|
||||||
|
dst->port[i] = htons(dst->port[i]);
|
||||||
|
strncpy(dst->fqdn[i], src->fqdn[i], TSDB_FQDN_LEN);
|
||||||
|
}
|
||||||
|
}
|
||||||
static void tscDumpMgmtIpSet(SRpcIpSet *ipSet) {
|
static void tscDumpMgmtIpSet(SRpcIpSet *ipSet) {
|
||||||
taosCorBeginRead(&tscMgmtIpSet.version);
|
taosCorBeginRead(&tscMgmtIpSet.version);
|
||||||
*ipSet = tscMgmtIpSet.ipSet;
|
SRpcIpSet* src = &tscMgmtIpSet.ipSet;
|
||||||
|
tscIpSetCopy(ipSet, src);
|
||||||
taosCorEndRead(&tscMgmtIpSet.version);
|
taosCorEndRead(&tscMgmtIpSet.version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,12 +80,7 @@ void tscSetMgmtIpList(SRpcIpSet *pIpSet) {
|
||||||
|
|
||||||
taosCorBeginWrite(&tscMgmtIpSet.version);
|
taosCorBeginWrite(&tscMgmtIpSet.version);
|
||||||
SRpcIpSet *mgmtIpSet = &tscMgmtIpSet.ipSet;
|
SRpcIpSet *mgmtIpSet = &tscMgmtIpSet.ipSet;
|
||||||
mgmtIpSet->numOfIps = pIpSet->numOfIps;
|
tscIpSetCopy(mgmtIpSet, pIpSet);
|
||||||
mgmtIpSet->inUse = pIpSet->inUse;
|
|
||||||
for (int32_t i = 0; i < mgmtIpSet->numOfIps; ++i) {
|
|
||||||
mgmtIpSet->port[i] = htons(pIpSet->port[i]);
|
|
||||||
strncpy(mgmtIpSet->fqdn[i], pIpSet->fqdn[i], TSDB_FQDN_LEN);
|
|
||||||
}
|
|
||||||
taosCorEndWrite(&tscMgmtIpSet.version);
|
taosCorEndWrite(&tscMgmtIpSet.version);
|
||||||
}
|
}
|
||||||
static void tscDumpIpSetFromVgroupInfo(SCMVgroupInfo *pVgroupInfo, SRpcIpSet *pIpSet, int32_t *vgId) {
|
static void tscDumpIpSetFromVgroupInfo(SCMVgroupInfo *pVgroupInfo, SRpcIpSet *pIpSet, int32_t *vgId) {
|
||||||
|
@ -227,7 +231,7 @@ int tscSendMsgToServer(SSqlObj *pSql) {
|
||||||
if (pSql->cmd.command >= TSDB_SQL_MGMT) {
|
if (pSql->cmd.command >= TSDB_SQL_MGMT) {
|
||||||
SRpcIpSet dump;
|
SRpcIpSet dump;
|
||||||
tscDumpMgmtIpSet(&dump);
|
tscDumpMgmtIpSet(&dump);
|
||||||
pSql->ipList = dump;
|
tscIpSetCopy(&pSql->ipList, &dump);
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(pMsg, pSql->cmd.payload, pSql->cmd.payloadLen);
|
memcpy(pMsg, pSql->cmd.payload, pSql->cmd.payloadLen);
|
||||||
|
|
Loading…
Reference in New Issue