Merge pull request #27037 from taosdata/fix/TD-31283

fix:[TD-31283] code remove by accident
This commit is contained in:
dapan1121 2024-08-07 18:20:05 +08:00 committed by GitHub
commit e4a6bae5b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 43 additions and 4 deletions

View File

@ -1372,7 +1372,7 @@ static int32_t buildResult(SSDataBlock *pBlock, int32_t *numOfRows, int64_t cons
OffsetRows *tmp = taosArrayGet(offsetRows, i);
MND_TMQ_NULL_CHECK(tmp);
if (tmp->vgId != pVgEp->vgId) {
mError("mnd show subscriptions: do not find vgId:%d, %d in offsetRows", tmp->vgId, pVgEp->vgId);
mInfo("mnd show subscriptions: do not find vgId:%d, %d in offsetRows", tmp->vgId, pVgEp->vgId);
continue;
}
data = tmp;
@ -1396,7 +1396,7 @@ static int32_t buildResult(SSDataBlock *pBlock, int32_t *numOfRows, int64_t cons
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
MND_TMQ_NULL_CHECK(pColInfo);
colDataSetNULL(pColInfo, *numOfRows);
mError("mnd show subscriptions: do not find vgId:%d in offsetRows", pVgEp->vgId);
mInfo("mnd show subscriptions: do not find vgId:%d in offsetRows", pVgEp->vgId);
}
(*numOfRows)++;
}

View File

@ -347,6 +347,7 @@ static int32_t extractDataAndRspForDbStbSubscribe(STQ* pTq, STqHandle* pHandle,
code = TAOS_GET_TERRNO(TSDB_CODE_OUT_OF_MEMORY);
goto END;
}
totalMetaRows++;
if ((taosArrayGetSize(btMetaRsp.batchMetaReq) >= tmqRowSize) || (taosGetTimestampMs() - st > 1000)) {
tqOffsetResetToLog(&btMetaRsp.rspOffset, fetchVer);
code = tqSendBatchMetaPollRsp(pHandle, pMsg, pRequest, &btMetaRsp, vgId);

View File

@ -1075,14 +1075,14 @@ int32_t taosGetFqdn(char *fqdn) {
freeaddrinfo(result);
#else
#elif WINDOWS
struct addrinfo hints = {0};
struct addrinfo *result = NULL;
hints.ai_flags = AI_CANONNAME;
int32_t ret = getaddrinfo(hostname, NULL, &hints, &result);
if (!result) {
fprintf(stderr, "failed to get fqdn, code:%d, reason:%s\n", ret, gai_strerror(ret));
fprintf(stderr, "failed to get fqdn, code:%d, hostname:%s, reason:%s\n", ret, hostname, gai_strerror(ret));
return -1;
}
strcpy(fqdn, result->ai_canonname);

View File

@ -496,6 +496,43 @@ class TDTestCase:
consumer.close()
print("consume_ts_4551 ok")
def consume_td_31283(self):
tdSql.execute(f'create database if not exists d31283')
tdSql.execute(f'use d31283')
tdSql.execute(f'create topic topic_31283 with meta as database d31283')
consumer_dict = {
"group.id": "g1",
"td.connect.user": "root",
"td.connect.pass": "taosdata",
"auto.offset.reset": "earliest",
"experimental.snapshot.enable": "true",
# "msg.enable.batchmeta": "true"
}
consumer = Consumer(consumer_dict)
try:
consumer.subscribe(["topic_31283"])
except TmqError:
tdLog.exit(f"subscribe error")
tdSql.execute(f'create table stt(ts timestamp, i int) tags(t int)')
hasData = False
try:
while True:
res = consumer.poll(1)
if not res:
break
hasData = True
finally:
consumer.close()
if not hasData:
tdLog.exit(f"consume_td_31283 error")
print("consume_td_31283 ok")
def consume_TS_5067_Test(self):
tdSql.execute(f'create database if not exists d1 vgroups 1')
tdSql.execute(f'use d1')
@ -632,6 +669,7 @@ class TDTestCase:
self.consume_ts_4544()
self.consume_ts_4551()
self.consume_TS_4540_Test()
self.consume_td_31283()
tdSql.prepare()
self.checkWal1VgroupOnlyMeta()