fix:[TS-5776]add raw type from consumer

This commit is contained in:
wangmm0220 2025-01-24 15:08:01 +08:00
parent 902d067776
commit 9074a999d0
2 changed files with 38 additions and 0 deletions

View File

@ -17,6 +17,8 @@ from tmqCommon import *
class TDTestCase:
updatecfgDict = {'debugFlag': 135, 'asynclog': 0}
clientCfgDict = {'debugFlag': 135, 'asynclog': 0}
updatecfgDict["clientCfg"] = clientCfgDict
def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}")
@ -256,6 +258,17 @@ class TDTestCase:
return
def checkWalMultiVgroupsRawData(self):
buildPath = tdCom.getBuildPath()
cmdStr = '%s/build/bin/tmq_taosx_ci -sv 3 -dv 5 -raw'%(buildPath)
tdLog.info(cmdStr)
os.system(cmdStr)
self.checkData()
self.checkDropData(False)
return
def checkWalMultiVgroupsWithDropTable(self):
buildPath = tdCom.getBuildPath()
cmdStr = '%s/build/bin/tmq_taosx_ci -sv 3 -dv 5 -d'%(buildPath)
@ -681,6 +694,7 @@ class TDTestCase:
self.checkSnapshot1VgroupTable()
self.checkWalMultiVgroups()
self.checkWalMultiVgroupsRawData()
self.checkSnapshotMultiVgroups()
self.checkWalMultiVgroupsWithDropTable()

View File

@ -34,6 +34,7 @@ typedef struct {
int dstVgroups;
char dir[256];
bool btMeta;
bool rawData;
} Config;
Config g_conf = {0};
@ -424,6 +425,15 @@ int buildDatabase(TAOS* pConn, TAOS_RES* pRes) {
}
taos_free_result(pRes);
pRes =
taos_query(pConn,
"insert into stt1 values(now - 2s, 3, 2, 'stt1')");
if (taos_errno(pRes) != 0) {
printf("failed to create child table stt1, reason:%s\n", taos_errstr(pRes));
return -1;
}
taos_free_result(pRes);
pRes =
taos_query(pConn,
"insert into stt1 values(now + 2s, 3, 2, 'stt1') stt3 using stt tags(23, \"stt3\", true) values(now + "
@ -436,6 +446,15 @@ int buildDatabase(TAOS* pConn, TAOS_RES* pRes) {
}
taos_free_result(pRes);
pRes =
taos_query(pConn,
"insert into stt1 values(now + 442s, 3, 2, 'stt1')");
if (taos_errno(pRes) != 0) {
printf("failed to create child table stt1, reason:%s\n", taos_errstr(pRes));
return -1;
}
taos_free_result(pRes);
return 0;
}
@ -633,6 +652,9 @@ tmq_t* build_consumer() {
tmq_conf_set(conf, "enable.auto.commit", "true");
tmq_conf_set(conf, "auto.offset.reset", "earliest");
tmq_conf_set(conf, "msg.consume.excluded", "1");
if (g_conf.rawData) {
tmq_conf_set(conf, "msg.consume.rawdata", "1");
}
// tmq_conf_set(conf, "session.timeout.ms", "1000000");
// tmq_conf_set(conf, "max.poll.interval.ms", "20000");
@ -1238,6 +1260,8 @@ int main(int argc, char* argv[]) {
g_conf.meta = 1;
} else if (strcmp(argv[i], "-bt") == 0) {
g_conf.btMeta = true;
} else if (strcmp(argv[i], "-raw") == 0) {
g_conf.rawData = true;
}
}