fix
This commit is contained in:
parent
915c9f67fe
commit
3e5da8bedb
|
@ -28,7 +28,7 @@ int32_t init_env() {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TAOS_RES* pRes = taos_query(pConn, "create database if not exists abc1 vgroups 1");
|
TAOS_RES* pRes = taos_query(pConn, "create database if not exists abc1 vgroups 2");
|
||||||
if (taos_errno(pRes) != 0) {
|
if (taos_errno(pRes) != 0) {
|
||||||
printf("error in create db, reason:%s\n", taos_errstr(pRes));
|
printf("error in create db, reason:%s\n", taos_errstr(pRes));
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -42,25 +42,33 @@ int32_t init_env() {
|
||||||
}
|
}
|
||||||
taos_free_result(pRes);
|
taos_free_result(pRes);
|
||||||
|
|
||||||
pRes = taos_query(pConn, "create stable if not exists st1 (ts timestamp, k int) tags(a int)");
|
pRes =
|
||||||
|
taos_query(pConn, "create stable if not exists st1 (ts timestamp, c1 int, c2 float, c3 binary(10)) tags(t1 int)");
|
||||||
if (taos_errno(pRes) != 0) {
|
if (taos_errno(pRes) != 0) {
|
||||||
printf("failed to create super table st1, reason:%s\n", taos_errstr(pRes));
|
printf("failed to create super table st1, reason:%s\n", taos_errstr(pRes));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
taos_free_result(pRes);
|
taos_free_result(pRes);
|
||||||
|
|
||||||
pRes = taos_query(pConn, "create table if not exists tu1 using st1 tags(1)");
|
pRes = taos_query(pConn, "create table if not exists ct0 using st1 tags(1000)");
|
||||||
if (taos_errno(pRes) != 0) {
|
if (taos_errno(pRes) != 0) {
|
||||||
printf("failed to create child table tu1, reason:%s\n", taos_errstr(pRes));
|
printf("failed to create child table tu1, reason:%s\n", taos_errstr(pRes));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
taos_free_result(pRes);
|
taos_free_result(pRes);
|
||||||
|
|
||||||
pRes = taos_query(pConn, "create table if not exists tu2 using st1 tags(2)");
|
pRes = taos_query(pConn, "create table if not exists ct1 using st1 tags(2000)");
|
||||||
if (taos_errno(pRes) != 0) {
|
if (taos_errno(pRes) != 0) {
|
||||||
printf("failed to create child table tu2, reason:%s\n", taos_errstr(pRes));
|
printf("failed to create child table tu2, reason:%s\n", taos_errstr(pRes));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pRes = taos_query(pConn, "create table if not exists ct3 using st1 tags(3000)");
|
||||||
|
if (taos_errno(pRes) != 0) {
|
||||||
|
printf("failed to create child table tu3, reason:%s\n", taos_errstr(pRes));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
taos_free_result(pRes);
|
taos_free_result(pRes);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -82,12 +90,40 @@ int32_t create_topic() {
|
||||||
|
|
||||||
/*const char* sql = "select * from tu1";*/
|
/*const char* sql = "select * from tu1";*/
|
||||||
/*pRes = tmq_create_topic(pConn, "test_stb_topic_1", sql, strlen(sql));*/
|
/*pRes = tmq_create_topic(pConn, "test_stb_topic_1", sql, strlen(sql));*/
|
||||||
pRes = taos_query(pConn, "create topic test_stb_topic_1 as select * from tu1");
|
pRes = taos_query(pConn, "create topic topic_ctb_column as select ts, c1 from ct1");
|
||||||
if (taos_errno(pRes) != 0) {
|
if (taos_errno(pRes) != 0) {
|
||||||
printf("failed to create topic test_stb_topic_1, reason:%s\n", taos_errstr(pRes));
|
printf("failed to create topic topic_ctb_column, reason:%s\n", taos_errstr(pRes));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
taos_free_result(pRes);
|
taos_free_result(pRes);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
pRes = taos_query(pConn, "insert into tu1 values(now, 1, 1.0, 'bi1')");
|
||||||
|
if (taos_errno(pRes) != 0) {
|
||||||
|
printf("failed to insert, reason:%s\n", taos_errstr(pRes));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
taos_free_result(pRes);
|
||||||
|
pRes = taos_query(pConn, "insert into tu1 values(now+1d, 1, 1.0, 'bi1')");
|
||||||
|
if (taos_errno(pRes) != 0) {
|
||||||
|
printf("failed to insert, reason:%s\n", taos_errstr(pRes));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
taos_free_result(pRes);
|
||||||
|
pRes = taos_query(pConn, "insert into tu2 values(now, 2, 2.0, 'bi2')");
|
||||||
|
if (taos_errno(pRes) != 0) {
|
||||||
|
printf("failed to insert, reason:%s\n", taos_errstr(pRes));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
taos_free_result(pRes);
|
||||||
|
pRes = taos_query(pConn, "insert into tu2 values(now+1d, 2, 2.0, 'bi2')");
|
||||||
|
if (taos_errno(pRes) != 0) {
|
||||||
|
printf("failed to insert, reason:%s\n", taos_errstr(pRes));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
taos_free_result(pRes);
|
||||||
|
#endif
|
||||||
|
|
||||||
taos_close(pConn);
|
taos_close(pConn);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -115,7 +151,7 @@ tmq_t* build_consumer() {
|
||||||
|
|
||||||
tmq_list_t* build_topic_list() {
|
tmq_list_t* build_topic_list() {
|
||||||
tmq_list_t* topic_list = tmq_list_new();
|
tmq_list_t* topic_list = tmq_list_new();
|
||||||
tmq_list_append(topic_list, "test_stb_topic_1");
|
tmq_list_append(topic_list, "topic_ctb_column");
|
||||||
return topic_list;
|
return topic_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,8 +251,8 @@ int main(int argc, char* argv[]) {
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
printf("env init\n");
|
printf("env init\n");
|
||||||
code = init_env();
|
code = init_env();
|
||||||
}
|
|
||||||
create_topic();
|
create_topic();
|
||||||
|
}
|
||||||
tmq_t* tmq = build_consumer();
|
tmq_t* tmq = build_consumer();
|
||||||
tmq_list_t* topic_list = build_topic_list();
|
tmq_list_t* topic_list = build_topic_list();
|
||||||
/*perf_loop(tmq, topic_list);*/
|
/*perf_loop(tmq, topic_list);*/
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include "taos.h"
|
#include "taos.h"
|
||||||
|
|
||||||
int32_t init_env() {
|
int32_t init_env() {
|
||||||
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 7010);
|
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
|
||||||
if (pConn == NULL) {
|
if (pConn == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ int32_t init_env() {
|
||||||
int32_t create_stream() {
|
int32_t create_stream() {
|
||||||
printf("create stream\n");
|
printf("create stream\n");
|
||||||
TAOS_RES* pRes;
|
TAOS_RES* pRes;
|
||||||
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 7010);
|
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
|
||||||
if (pConn == NULL) {
|
if (pConn == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,14 @@ enum {
|
||||||
TMQ_MSG_TYPE__EP_RSP,
|
TMQ_MSG_TYPE__EP_RSP,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
STREAM_TRIGGER__AT_ONCE = 1,
|
||||||
|
STREAM_TRIGGER__WINDOW_CLOSE,
|
||||||
|
STREAM_TRIGGER__BY_COUNT,
|
||||||
|
STREAM_TRIGGER__BY_BATCH_COUNT,
|
||||||
|
STREAM_TRIGGER__BY_EVENT_TIME,
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t numOfTables;
|
uint32_t numOfTables;
|
||||||
SArray* pGroupList;
|
SArray* pGroupList;
|
||||||
|
@ -59,7 +67,10 @@ typedef struct SDataBlockInfo {
|
||||||
int32_t rowSize;
|
int32_t rowSize;
|
||||||
int16_t numOfCols;
|
int16_t numOfCols;
|
||||||
int16_t hasVarCol;
|
int16_t hasVarCol;
|
||||||
union {int64_t uid; int64_t blockId;};
|
union {
|
||||||
|
int64_t uid;
|
||||||
|
int64_t blockId;
|
||||||
|
};
|
||||||
int64_t groupId; // no need to serialize
|
int64_t groupId; // no need to serialize
|
||||||
} SDataBlockInfo;
|
} SDataBlockInfo;
|
||||||
|
|
||||||
|
|
|
@ -939,7 +939,6 @@ static FORCE_INLINE bool tdSTSRowIterNext(STSRowIter *pIter, col_id_t colId, col
|
||||||
while (pIter->colIdx <= pSchema->numOfCols) {
|
while (pIter->colIdx <= pSchema->numOfCols) {
|
||||||
pCol = &pSchema->columns[pIter->colIdx];
|
pCol = &pSchema->columns[pIter->colIdx];
|
||||||
if (colId == pCol->colId) {
|
if (colId == pCol->colId) {
|
||||||
++pIter->colIdx;
|
|
||||||
break;
|
break;
|
||||||
} else if (colId < pCol->colId) {
|
} else if (colId < pCol->colId) {
|
||||||
++pIter->colIdx;
|
++pIter->colIdx;
|
||||||
|
@ -948,7 +947,8 @@ static FORCE_INLINE bool tdSTSRowIterNext(STSRowIter *pIter, col_id_t colId, col
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tdGetTpRowDataOfCol(pIter, pCol->type, pCol->offset - sizeof(TSKEY), pVal);
|
tdGetTpRowDataOfCol(pIter, pCol->type, pCol->offset - sizeof(TSKEY), pVal);
|
||||||
|
++pIter->colIdx;
|
||||||
} else if (TD_IS_KV_ROW(pIter->pRow)) {
|
} else if (TD_IS_KV_ROW(pIter->pRow)) {
|
||||||
return tdGetKvRowValOfColEx(pIter, colId, colType, &pIter->kvIdx, pVal);
|
return tdGetKvRowValOfColEx(pIter, colId, colType, &pIter->kvIdx, pVal);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -157,6 +157,7 @@ typedef struct SWalReadHandle {
|
||||||
int64_t curVersion;
|
int64_t curVersion;
|
||||||
int64_t capacity;
|
int64_t capacity;
|
||||||
int64_t status; // if cursor valid
|
int64_t status; // if cursor valid
|
||||||
|
TdThreadMutex mutex;
|
||||||
SWalHead *pHead;
|
SWalHead *pHead;
|
||||||
} SWalReadHandle;
|
} SWalReadHandle;
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
@ -191,6 +192,7 @@ int32_t walEndSnapshot(SWal *);
|
||||||
SWalReadHandle *walOpenReadHandle(SWal *);
|
SWalReadHandle *walOpenReadHandle(SWal *);
|
||||||
void walCloseReadHandle(SWalReadHandle *);
|
void walCloseReadHandle(SWalReadHandle *);
|
||||||
int32_t walReadWithHandle(SWalReadHandle *pRead, int64_t ver);
|
int32_t walReadWithHandle(SWalReadHandle *pRead, int64_t ver);
|
||||||
|
int32_t walReadWithHandle_s(SWalReadHandle *pRead, int64_t ver, SWalReadHead **ppHead);
|
||||||
|
|
||||||
// deprecated
|
// deprecated
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -255,6 +255,7 @@ void tmqClearUnhandleMsg(tmq_t* tmq) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
msg = NULL;
|
||||||
taosReadAllQitems(tmq->mqueue, tmq->qall);
|
taosReadAllQitems(tmq->mqueue, tmq->qall);
|
||||||
while (1) {
|
while (1) {
|
||||||
taosGetQitem(tmq->qall, (void**)&msg);
|
taosGetQitem(tmq->qall, (void**)&msg);
|
||||||
|
@ -787,7 +788,7 @@ void tmqShowMsg(tmq_message_t* tmq_message) {
|
||||||
static bool noPrintSchema;
|
static bool noPrintSchema;
|
||||||
char pBuf[128];
|
char pBuf[128];
|
||||||
SMqPollRsp* pRsp = &tmq_message->msg;
|
SMqPollRsp* pRsp = &tmq_message->msg;
|
||||||
int32_t colNum = pRsp->schema->nCols;
|
int32_t colNum = 2;
|
||||||
if (!noPrintSchema) {
|
if (!noPrintSchema) {
|
||||||
printf("|");
|
printf("|");
|
||||||
for (int32_t i = 0; i < colNum; i++) {
|
for (int32_t i = 0; i < colNum; i++) {
|
||||||
|
@ -838,6 +839,7 @@ int32_t tmqPollCb(void* param, const SDataBuf* pMsg, int32_t code) {
|
||||||
int32_t msgEpoch = ((SMqRspHead*)pMsg->pData)->epoch;
|
int32_t msgEpoch = ((SMqRspHead*)pMsg->pData)->epoch;
|
||||||
int32_t tmqEpoch = atomic_load_32(&tmq->epoch);
|
int32_t tmqEpoch = atomic_load_32(&tmq->epoch);
|
||||||
if (msgEpoch < tmqEpoch) {
|
if (msgEpoch < tmqEpoch) {
|
||||||
|
/*printf("discard rsp epoch %d, current epoch %d\n", msgEpoch, tmqEpoch);*/
|
||||||
tsem_post(&tmq->rspSem);
|
tsem_post(&tmq->rspSem);
|
||||||
tscWarn("discard rsp epoch %d, current epoch %d", msgEpoch, tmqEpoch);
|
tscWarn("discard rsp epoch %d, current epoch %d", msgEpoch, tmqEpoch);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -886,6 +888,9 @@ int32_t tmqPollCb(void* param, const SDataBuf* pMsg, int32_t code) {
|
||||||
goto WRITE_QUEUE_FAIL;
|
goto WRITE_QUEUE_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tscError("tmq recv poll: vg %d, req offset %ld, rsp offset %ld", pParam->pVg->vgId, pRsp->msg.reqOffset,
|
||||||
|
pRsp->msg.rspOffset);
|
||||||
|
|
||||||
pRsp->vg = pParam->pVg;
|
pRsp->vg = pParam->pVg;
|
||||||
taosWriteQitem(tmq->mqueue, pRsp);
|
taosWriteQitem(tmq->mqueue, pRsp);
|
||||||
atomic_add_fetch_32(&tmq->readyRequest, 1);
|
atomic_add_fetch_32(&tmq->readyRequest, 1);
|
||||||
|
@ -902,6 +907,7 @@ WRITE_QUEUE_FAIL:
|
||||||
|
|
||||||
bool tmqUpdateEp(tmq_t* tmq, int32_t epoch, SMqCMGetSubEpRsp* pRsp) {
|
bool tmqUpdateEp(tmq_t* tmq, int32_t epoch, SMqCMGetSubEpRsp* pRsp) {
|
||||||
/*printf("call update ep %d\n", epoch);*/
|
/*printf("call update ep %d\n", epoch);*/
|
||||||
|
/*printf("tmq update ep epoch %d to epoch %d\n", tmq->epoch, epoch);*/
|
||||||
bool set = false;
|
bool set = false;
|
||||||
int32_t topicNumGet = taosArrayGetSize(pRsp->topics);
|
int32_t topicNumGet = taosArrayGetSize(pRsp->topics);
|
||||||
char vgKey[TSDB_TOPIC_FNAME_LEN + 22];
|
char vgKey[TSDB_TOPIC_FNAME_LEN + 22];
|
||||||
|
@ -932,6 +938,7 @@ bool tmqUpdateEp(tmq_t* tmq, int32_t epoch, SMqCMGetSubEpRsp* pRsp) {
|
||||||
for (int32_t k = 0; k < vgNumCur; k++) {
|
for (int32_t k = 0; k < vgNumCur; k++) {
|
||||||
SMqClientVg* pVgCur = taosArrayGet(pTopicCur->vgs, k);
|
SMqClientVg* pVgCur = taosArrayGet(pTopicCur->vgs, k);
|
||||||
sprintf(vgKey, "%s:%d", topic.topicName, pVgCur->vgId);
|
sprintf(vgKey, "%s:%d", topic.topicName, pVgCur->vgId);
|
||||||
|
/*printf("epoch %d vg %d build %s\n", epoch, pVgCur->vgId, vgKey);*/
|
||||||
taosHashPut(pHash, vgKey, strlen(vgKey), &pVgCur->currentOffset, sizeof(int64_t));
|
taosHashPut(pHash, vgKey, strlen(vgKey), &pVgCur->currentOffset, sizeof(int64_t));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -945,9 +952,12 @@ bool tmqUpdateEp(tmq_t* tmq, int32_t epoch, SMqCMGetSubEpRsp* pRsp) {
|
||||||
sprintf(vgKey, "%s:%d", topic.topicName, pVgEp->vgId);
|
sprintf(vgKey, "%s:%d", topic.topicName, pVgEp->vgId);
|
||||||
int64_t* pOffset = taosHashGet(pHash, vgKey, strlen(vgKey));
|
int64_t* pOffset = taosHashGet(pHash, vgKey, strlen(vgKey));
|
||||||
int64_t offset = pVgEp->offset;
|
int64_t offset = pVgEp->offset;
|
||||||
|
/*printf("epoch %d vg %d offset og to %ld\n", epoch, pVgEp->vgId, offset);*/
|
||||||
if (pOffset != NULL) {
|
if (pOffset != NULL) {
|
||||||
offset = *pOffset;
|
offset = *pOffset;
|
||||||
|
/*printf("epoch %d vg %d found %s\n", epoch, pVgEp->vgId, vgKey);*/
|
||||||
}
|
}
|
||||||
|
/*printf("epoch %d vg %d offset set to %ld\n", epoch, pVgEp->vgId, offset);*/
|
||||||
SMqClientVg clientVg = {
|
SMqClientVg clientVg = {
|
||||||
.pollCnt = 0,
|
.pollCnt = 0,
|
||||||
.currentOffset = offset,
|
.currentOffset = offset,
|
||||||
|
@ -1195,6 +1205,7 @@ int32_t tmqPollImpl(tmq_t* tmq, int64_t blockingTime) {
|
||||||
SMqClientVg* pVg = taosArrayGet(pTopic->vgs, j);
|
SMqClientVg* pVg = taosArrayGet(pTopic->vgs, j);
|
||||||
int32_t vgStatus = atomic_val_compare_exchange_32(&pVg->vgStatus, TMQ_VG_STATUS__IDLE, TMQ_VG_STATUS__WAIT);
|
int32_t vgStatus = atomic_val_compare_exchange_32(&pVg->vgStatus, TMQ_VG_STATUS__IDLE, TMQ_VG_STATUS__WAIT);
|
||||||
if (vgStatus != TMQ_VG_STATUS__IDLE) {
|
if (vgStatus != TMQ_VG_STATUS__IDLE) {
|
||||||
|
/*printf("skip vg %d\n", pVg->vgId);*/
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
SMqPollReq* pReq = tmqBuildConsumeReqImpl(tmq, blockingTime, pTopic, pVg);
|
SMqPollReq* pReq = tmqBuildConsumeReqImpl(tmq, blockingTime, pTopic, pVg);
|
||||||
|
@ -1238,6 +1249,8 @@ int32_t tmqPollImpl(tmq_t* tmq, int64_t blockingTime) {
|
||||||
int64_t transporterId = 0;
|
int64_t transporterId = 0;
|
||||||
/*printf("send poll\n");*/
|
/*printf("send poll\n");*/
|
||||||
atomic_add_fetch_32(&tmq->waitingRequest, 1);
|
atomic_add_fetch_32(&tmq->waitingRequest, 1);
|
||||||
|
/*tscDebug("tmq send poll: vg %d, req offset %ld", pVg->vgId, pVg->currentOffset);*/
|
||||||
|
/*printf("send vg %d %ld\n", pVg->vgId, pVg->currentOffset);*/
|
||||||
asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, &pVg->epSet, &transporterId, sendInfo);
|
asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, &pVg->epSet, &transporterId, sendInfo);
|
||||||
pVg->pollCnt++;
|
pVg->pollCnt++;
|
||||||
tmq->pollCnt++;
|
tmq->pollCnt++;
|
||||||
|
|
|
@ -735,6 +735,9 @@ typedef struct {
|
||||||
int8_t createdBy; // STREAM_CREATED_BY__USER or SMA
|
int8_t createdBy; // STREAM_CREATED_BY__USER or SMA
|
||||||
int32_t fixedSinkVgId; // 0 for shuffle
|
int32_t fixedSinkVgId; // 0 for shuffle
|
||||||
int64_t smaId; // 0 for unused
|
int64_t smaId; // 0 for unused
|
||||||
|
int8_t trigger;
|
||||||
|
int32_t triggerParam;
|
||||||
|
int64_t waterMark;
|
||||||
char* sql;
|
char* sql;
|
||||||
char* logicalPlan;
|
char* logicalPlan;
|
||||||
char* physicalPlan;
|
char* physicalPlan;
|
||||||
|
|
|
@ -194,7 +194,7 @@ void tqClose(STQ*);
|
||||||
int tqPushMsg(STQ*, void* msg, int32_t msgLen, tmsg_t msgType, int64_t version);
|
int tqPushMsg(STQ*, void* msg, int32_t msgLen, tmsg_t msgType, int64_t version);
|
||||||
int tqCommit(STQ*);
|
int tqCommit(STQ*);
|
||||||
|
|
||||||
int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg);
|
int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId);
|
||||||
int32_t tqProcessSetConnReq(STQ* pTq, char* msg);
|
int32_t tqProcessSetConnReq(STQ* pTq, char* msg);
|
||||||
int32_t tqProcessRebReq(STQ* pTq, char* msg);
|
int32_t tqProcessRebReq(STQ* pTq, char* msg);
|
||||||
int32_t tqProcessTaskExec(STQ* pTq, char* msg, int32_t msgLen, int32_t workerId);
|
int32_t tqProcessTaskExec(STQ* pTq, char* msg, int32_t msgLen, int32_t workerId);
|
||||||
|
|
|
@ -27,5 +27,5 @@ void metaCloseUidGnrt(SMeta *pMeta) { /* TODO */
|
||||||
|
|
||||||
tb_uid_t metaGenerateUid(SMeta *pMeta) {
|
tb_uid_t metaGenerateUid(SMeta *pMeta) {
|
||||||
// Generate a new table UID
|
// Generate a new table UID
|
||||||
return ++(pMeta->uidGnrt.nextUid);
|
return tGenIdPI64();
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,7 +250,7 @@ int32_t tqDeserializeConsumer(STQ* pTq, const STqSerializedHead* pHead, STqConsu
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
|
int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
|
||||||
SMqPollReq* pReq = pMsg->pCont;
|
SMqPollReq* pReq = pMsg->pCont;
|
||||||
int64_t consumerId = pReq->consumerId;
|
int64_t consumerId = pReq->consumerId;
|
||||||
int64_t fetchOffset;
|
int64_t fetchOffset;
|
||||||
|
@ -264,6 +264,8 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
|
||||||
fetchOffset = pReq->currentOffset + 1;
|
fetchOffset = pReq->currentOffset + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("tmq poll vg %d req %ld %ld\n", pTq->pVnode->vgId, pReq->currentOffset, fetchOffset);
|
||||||
|
|
||||||
SMqPollRsp rsp = {
|
SMqPollRsp rsp = {
|
||||||
/*.consumerId = consumerId,*/
|
/*.consumerId = consumerId,*/
|
||||||
.numOfTopics = 0,
|
.numOfTopics = 0,
|
||||||
|
@ -288,37 +290,47 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
|
||||||
rsp.reqOffset = pReq->currentOffset;
|
rsp.reqOffset = pReq->currentOffset;
|
||||||
rsp.skipLogNum = 0;
|
rsp.skipLogNum = 0;
|
||||||
|
|
||||||
SWalHead* pHead;
|
|
||||||
while (1) {
|
while (1) {
|
||||||
/*if (fetchOffset > walGetLastVer(pTq->pWal) || walReadWithHandle(pTopic->pReadhandle, fetchOffset) < 0) {*/
|
/*if (fetchOffset > walGetLastVer(pTq->pWal) || walReadWithHandle(pTopic->pReadhandle, fetchOffset) < 0) {*/
|
||||||
if (walReadWithHandle(pTopic->pReadhandle, fetchOffset) < 0) {
|
SWalReadHead* pHead;
|
||||||
|
if (walReadWithHandle_s(pTopic->pReadhandle, fetchOffset, &pHead) < 0) {
|
||||||
// TODO: no more log, set timer to wait blocking time
|
// TODO: no more log, set timer to wait blocking time
|
||||||
// if data inserted during waiting, launch query and
|
// if data inserted during waiting, launch query and
|
||||||
// response to user
|
// response to user
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int8_t pos = fetchOffset % TQ_BUFFER_SIZE;
|
/*printf("vg %d offset %ld msgType %d from epoch %d\n", pTq->pVnode->vgId, fetchOffset, pHead->msgType,
|
||||||
pHead = pTopic->pReadhandle->pHead;
|
* pReq->epoch);*/
|
||||||
if (pHead->head.msgType == TDMT_VND_SUBMIT) {
|
/*int8_t pos = fetchOffset % TQ_BUFFER_SIZE;*/
|
||||||
SSubmitReq* pCont = (SSubmitReq*)&pHead->head.body;
|
/*pHead = pTopic->pReadhandle->pHead;*/
|
||||||
qTaskInfo_t task = pTopic->buffer.output[pos].task;
|
if (pHead->msgType == TDMT_VND_SUBMIT) {
|
||||||
|
SSubmitReq* pCont = (SSubmitReq*)&pHead->body;
|
||||||
|
printf("from topic %s from consumer\n", pTopic->topicName, consumerId);
|
||||||
|
qTaskInfo_t task = pTopic->buffer.output[workerId].task;
|
||||||
|
ASSERT(task);
|
||||||
qSetStreamInput(task, pCont, STREAM_DATA_TYPE_SUBMIT_BLOCK);
|
qSetStreamInput(task, pCont, STREAM_DATA_TYPE_SUBMIT_BLOCK);
|
||||||
SArray* pRes = taosArrayInit(0, sizeof(SSDataBlock));
|
SArray* pRes = taosArrayInit(0, sizeof(SSDataBlock));
|
||||||
while (1) {
|
while (1) {
|
||||||
SSDataBlock* pDataBlock;
|
SSDataBlock* pDataBlock = NULL;
|
||||||
uint64_t ts;
|
uint64_t ts;
|
||||||
if (qExecTask(task, &pDataBlock, &ts) < 0) {
|
if (qExecTask(task, &pDataBlock, &ts) < 0) {
|
||||||
ASSERT(false);
|
ASSERT(false);
|
||||||
}
|
}
|
||||||
if (pDataBlock == NULL) {
|
if (pDataBlock == NULL) {
|
||||||
fetchOffset++;
|
/*pos = fetchOffset % TQ_BUFFER_SIZE;*/
|
||||||
pos = fetchOffset % TQ_BUFFER_SIZE;
|
|
||||||
rsp.skipLogNum++;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
taosArrayPush(pRes, pDataBlock);
|
taosArrayPush(pRes, pDataBlock);
|
||||||
rsp.schema = pTopic->buffer.output[pos].pReadHandle->pSchemaWrapper;
|
}
|
||||||
|
|
||||||
|
if (taosArrayGetSize(pRes) == 0) {
|
||||||
|
fetchOffset++;
|
||||||
|
rsp.skipLogNum++;
|
||||||
|
taosArrayDestroy(pRes);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
rsp.schema = pTopic->buffer.output[workerId].pReadHandle->pSchemaWrapper;
|
||||||
rsp.rspOffset = fetchOffset;
|
rsp.rspOffset = fetchOffset;
|
||||||
|
|
||||||
rsp.numOfTopics = 1;
|
rsp.numOfTopics = 1;
|
||||||
|
@ -328,6 +340,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
|
||||||
void* buf = rpcMallocCont(tlen);
|
void* buf = rpcMallocCont(tlen);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
pMsg->code = -1;
|
pMsg->code = -1;
|
||||||
|
taosMemoryFree(pHead);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
((SMqRspHead*)buf)->mqMsgType = TMQ_MSG_TYPE__POLL_RSP;
|
((SMqRspHead*)buf)->mqMsgType = TMQ_MSG_TYPE__POLL_RSP;
|
||||||
|
@ -340,10 +353,13 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
|
||||||
pMsg->pCont = buf;
|
pMsg->pCont = buf;
|
||||||
pMsg->contLen = tlen;
|
pMsg->contLen = tlen;
|
||||||
pMsg->code = 0;
|
pMsg->code = 0;
|
||||||
|
printf("vg %d offset %ld msgType %d from epoch %d actual rsp\n", pTq->pVnode->vgId, fetchOffset, pHead->msgType,
|
||||||
|
pReq->epoch);
|
||||||
tmsgSendRsp(pMsg);
|
tmsgSendRsp(pMsg);
|
||||||
|
taosMemoryFree(pHead);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
taosMemoryFree(pHead);
|
||||||
fetchOffset++;
|
fetchOffset++;
|
||||||
rsp.skipLogNum++;
|
rsp.skipLogNum++;
|
||||||
}
|
}
|
||||||
|
@ -368,6 +384,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
|
||||||
pMsg->contLen = tlen;
|
pMsg->contLen = tlen;
|
||||||
pMsg->code = 0;
|
pMsg->code = 0;
|
||||||
tmsgSendRsp(pMsg);
|
tmsgSendRsp(pMsg);
|
||||||
|
printf("vg %d offset %ld from epoch %d not rsp\n", pTq->pVnode->vgId, fetchOffset, pReq->epoch);
|
||||||
/*}*/
|
/*}*/
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -432,7 +449,9 @@ int32_t tqProcessSetConnReq(STQ* pTq, char* msg) {
|
||||||
};
|
};
|
||||||
pTopic->buffer.output[i].pReadHandle = pReadHandle;
|
pTopic->buffer.output[i].pReadHandle = pReadHandle;
|
||||||
pTopic->buffer.output[i].task = qCreateStreamExecTaskInfo(req.qmsg, &handle);
|
pTopic->buffer.output[i].task = qCreateStreamExecTaskInfo(req.qmsg, &handle);
|
||||||
|
ASSERT(pTopic->buffer.output[i].task);
|
||||||
}
|
}
|
||||||
|
printf("set topic %s to consumer %ld\n", pTopic->topicName, req.consumerId);
|
||||||
taosArrayPush(pConsumer->topics, pTopic);
|
taosArrayPush(pConsumer->topics, pTopic);
|
||||||
tqHandleMovePut(pTq->tqMeta, req.consumerId, pConsumer);
|
tqHandleMovePut(pTq->tqMeta, req.consumerId, pConsumer);
|
||||||
tqHandleCommit(pTq->tqMeta, req.consumerId);
|
tqHandleCommit(pTq->tqMeta, req.consumerId);
|
||||||
|
|
|
@ -167,7 +167,7 @@ SArray* tqRetrieveDataBlock(STqReadHandle* pHandle) {
|
||||||
if (!tdSTSRowIterNext(&iter, pColData->info.colId, pColData->info.type, &sVal)) {
|
if (!tdSTSRowIterNext(&iter, pColData->info.colId, pColData->info.type, &sVal)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (colDataAppend(pColData, curRow, sVal.val, sVal.valType == TD_VTYPE_NULL) < 0) {
|
if (colDataAppend(pColData, curRow, sVal.val, false) < 0) {
|
||||||
taosArrayDestroyEx(pArray, (void (*)(void*))tDeleteSSDataBlock);
|
taosArrayDestroyEx(pArray, (void (*)(void*))tDeleteSSDataBlock);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ int vnodeProcessFetchMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo) {
|
||||||
case TDMT_VND_TABLE_META:
|
case TDMT_VND_TABLE_META:
|
||||||
return vnodeGetTableMeta(pVnode, pMsg);
|
return vnodeGetTableMeta(pVnode, pMsg);
|
||||||
case TDMT_VND_CONSUME:
|
case TDMT_VND_CONSUME:
|
||||||
return tqProcessPollReq(pVnode->pTq, pMsg);
|
return tqProcessPollReq(pVnode->pTq, pMsg, pInfo->workerId);
|
||||||
case TDMT_VND_TASK_PIPE_EXEC:
|
case TDMT_VND_TASK_PIPE_EXEC:
|
||||||
case TDMT_VND_TASK_MERGE_EXEC:
|
case TDMT_VND_TASK_MERGE_EXEC:
|
||||||
return tqProcessTaskExec(pVnode->pTq, msgstr, msgLen, pInfo->workerId);
|
return tqProcessTaskExec(pVnode->pTq, msgstr, msgLen, pInfo->workerId);
|
||||||
|
|
|
@ -163,6 +163,7 @@ int vnodeApplyWMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
|
||||||
// }
|
// }
|
||||||
break;
|
break;
|
||||||
case TDMT_VND_SUBMIT:
|
case TDMT_VND_SUBMIT:
|
||||||
|
printf("vnode %d write data %ld\n", pVnode->vgId, ver);
|
||||||
if (pVnode->config.streamMode == 0) {
|
if (pVnode->config.streamMode == 0) {
|
||||||
if (tsdbInsertData(pVnode->pTsdb, (SSubmitReq *)ptr, NULL) < 0) {
|
if (tsdbInsertData(pVnode->pTsdb, (SSubmitReq *)ptr, NULL) < 0) {
|
||||||
// TODO: handle error
|
// TODO: handle error
|
||||||
|
|
|
@ -1551,8 +1551,8 @@ static SArray* hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pRe
|
||||||
if (pSDataBlock->pDataBlock != NULL) {
|
if (pSDataBlock->pDataBlock != NULL) {
|
||||||
SColumnInfoData* pColDataInfo = taosArrayGet(pSDataBlock->pDataBlock, 0);
|
SColumnInfoData* pColDataInfo = taosArrayGet(pSDataBlock->pDataBlock, 0);
|
||||||
tsCols = (int64_t*)pColDataInfo->pData;
|
tsCols = (int64_t*)pColDataInfo->pData;
|
||||||
assert(tsCols[0] == pSDataBlock->info.window.skey &&
|
/*assert(tsCols[0] == pSDataBlock->info.window.skey &&*/
|
||||||
tsCols[pSDataBlock->info.rows - 1] == pSDataBlock->info.window.ekey);
|
/*tsCols[pSDataBlock->info.rows - 1] == pSDataBlock->info.window.ekey);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t startPos = ascScan? 0 : (pSDataBlock->info.rows - 1);
|
int32_t startPos = ascScan? 0 : (pSDataBlock->info.rows - 1);
|
||||||
|
@ -6994,6 +6994,7 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo *pOperator, bool* newgroup
|
||||||
finalizeUpdatedResult(pInfo->binfo.pCtx, pOperator->numOfOutput, pInfo->aggSup.pResultBuf, pUpdated, pInfo->binfo.rowCellInfoOffset);
|
finalizeUpdatedResult(pInfo->binfo.pCtx, pOperator->numOfOutput, pInfo->aggSup.pResultBuf, pUpdated, pInfo->binfo.rowCellInfoOffset);
|
||||||
|
|
||||||
blockDataEnsureCapacity(pInfo->binfo.pRes, pInfo->binfo.capacity);
|
blockDataEnsureCapacity(pInfo->binfo.pRes, pInfo->binfo.capacity);
|
||||||
|
initGroupResInfo(&pInfo->groupResInfo, &pInfo->binfo.resultRowInfo);
|
||||||
toSDatablock(&pInfo->groupResInfo, pInfo->aggSup.pResultBuf, pInfo->binfo.pRes, pInfo->binfo.capacity,
|
toSDatablock(&pInfo->groupResInfo, pInfo->aggSup.pResultBuf, pInfo->binfo.pRes, pInfo->binfo.capacity,
|
||||||
pInfo->binfo.rowCellInfoOffset);
|
pInfo->binfo.rowCellInfoOffset);
|
||||||
|
|
||||||
|
|
|
@ -719,6 +719,11 @@ static int32_t createStreamScanPhysiNodeByExchange(SPhysiPlanContext* pCxt, SExc
|
||||||
if (NULL == pScan->pScanCols) {
|
if (NULL == pScan->pScanCols) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = sortScanCols(pScan->pScanCols);
|
||||||
|
}
|
||||||
|
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = addDataBlockSlots(pCxt, pScan->pScanCols, pScan->node.pOutputDataBlockDesc);
|
code = addDataBlockSlots(pCxt, pScan->pScanCols, pScan->node.pOutputDataBlockDesc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ static int32_t streamBuildDispatchMsg(SStreamTask* pTask, SArray* data, SRpcMsg*
|
||||||
req.taskId = pTask->fixedEpDispatcher.taskId;
|
req.taskId = pTask->fixedEpDispatcher.taskId;
|
||||||
|
|
||||||
} else if (pTask->dispatchType == TASK_DISPATCH__SHUFFLE) {
|
} else if (pTask->dispatchType == TASK_DISPATCH__SHUFFLE) {
|
||||||
// TODO fix tbname issue
|
// TODO use general name rule of schemaless
|
||||||
char ctbName[TSDB_TABLE_FNAME_LEN + 22];
|
char ctbName[TSDB_TABLE_FNAME_LEN + 22];
|
||||||
// all groupId must be the same in an array
|
// all groupId must be the same in an array
|
||||||
SSDataBlock* pBlock = taosArrayGet(data, 0);
|
SSDataBlock* pBlock = taosArrayGet(data, 0);
|
||||||
|
|
|
@ -30,6 +30,9 @@ SWalReadHandle *walOpenReadHandle(SWal *pWal) {
|
||||||
pRead->curFileFirstVer = -1;
|
pRead->curFileFirstVer = -1;
|
||||||
pRead->capacity = 0;
|
pRead->capacity = 0;
|
||||||
pRead->status = 0;
|
pRead->status = 0;
|
||||||
|
|
||||||
|
taosThreadMutexInit(&pRead->mutex, NULL);
|
||||||
|
|
||||||
pRead->pHead = taosMemoryMalloc(sizeof(SWalHead));
|
pRead->pHead = taosMemoryMalloc(sizeof(SWalHead));
|
||||||
if (pRead->pHead == NULL) {
|
if (pRead->pHead == NULL) {
|
||||||
terrno = TSDB_CODE_WAL_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_WAL_OUT_OF_MEMORY;
|
||||||
|
@ -135,6 +138,22 @@ static int32_t walReadSeekVer(SWalReadHandle *pRead, int64_t ver) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t walReadWithHandle_s(SWalReadHandle *pRead, int64_t ver, SWalReadHead **ppHead) {
|
||||||
|
taosThreadMutexLock(&pRead->mutex);
|
||||||
|
if (walReadWithHandle(pRead, ver) < 0) {
|
||||||
|
taosThreadMutexUnlock(&pRead->mutex);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
*ppHead = taosMemoryMalloc(sizeof(SWalReadHead) + pRead->pHead->head.len);
|
||||||
|
if (*ppHead == NULL) {
|
||||||
|
taosThreadMutexUnlock(&pRead->mutex);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
memcpy(*ppHead, &pRead->pHead->head, sizeof(SWalReadHead) + pRead->pHead->head.len);
|
||||||
|
taosThreadMutexUnlock(&pRead->mutex);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t walReadWithHandle(SWalReadHandle *pRead, int64_t ver) {
|
int32_t walReadWithHandle(SWalReadHandle *pRead, int64_t ver) {
|
||||||
int code;
|
int code;
|
||||||
// TODO: check wal life
|
// TODO: check wal life
|
||||||
|
@ -145,7 +164,9 @@ int32_t walReadWithHandle(SWalReadHandle *pRead, int64_t ver) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!taosValidFile(pRead->pReadLogTFile)) return -1;
|
if (!taosValidFile(pRead->pReadLogTFile)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
code = taosReadFile(pRead->pReadLogTFile, pRead->pHead, sizeof(SWalHead));
|
code = taosReadFile(pRead->pReadLogTFile, pRead->pHead, sizeof(SWalHead));
|
||||||
if (code != sizeof(SWalHead)) {
|
if (code != sizeof(SWalHead)) {
|
||||||
|
|
|
@ -121,7 +121,8 @@ int32_t tjsonAddItem(SJson* pJson, FToJson func, const void* pObj) {
|
||||||
return tjsonAddItemToArray(pJson, pJobj);
|
return tjsonAddItemToArray(pJson, pJobj);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t tjsonAddArray(SJson* pJson, const char* pName, FToJson func, const void* pArray, int32_t itemSize, int32_t num) {
|
int32_t tjsonAddArray(SJson* pJson, const char* pName, FToJson func, const void* pArray, int32_t itemSize,
|
||||||
|
int32_t num) {
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
SJson* pJsonArray = tjsonAddArrayToObject(pJson, pName);
|
SJson* pJsonArray = tjsonAddArrayToObject(pJson, pName);
|
||||||
if (NULL == pJsonArray) {
|
if (NULL == pJsonArray) {
|
||||||
|
@ -168,7 +169,7 @@ int32_t tjsonGetBigIntValue(const SJson* pJson, const char* pName, int64_t* pVal
|
||||||
}
|
}
|
||||||
|
|
||||||
*pVal = strtol(p, NULL, 10);
|
*pVal = strtol(p, NULL, 10);
|
||||||
return (errno == EINVAL || errno == ERANGE) ? TSDB_CODE_FAILED:TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t tjsonGetIntValue(const SJson* pJson, const char* pName, int32_t* pVal) {
|
int32_t tjsonGetIntValue(const SJson* pJson, const char* pName, int32_t* pVal) {
|
||||||
|
@ -199,7 +200,7 @@ int32_t tjsonGetUBigIntValue(const SJson* pJson, const char* pName, uint64_t* pV
|
||||||
}
|
}
|
||||||
|
|
||||||
*pVal = strtoul(p, NULL, 10);
|
*pVal = strtoul(p, NULL, 10);
|
||||||
return (errno == ERANGE||errno == EINVAL) ? TSDB_CODE_FAILED:TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t tjsonGetUIntValue(const SJson* pJson, const char* pName, uint32_t* pVal) {
|
int32_t tjsonGetUIntValue(const SJson* pJson, const char* pName, uint32_t* pVal) {
|
||||||
|
|
|
@ -35,7 +35,7 @@ sql connect
|
||||||
|
|
||||||
$dbNamme = d0
|
$dbNamme = d0
|
||||||
print =============== create database , vgroup 1
|
print =============== create database , vgroup 1
|
||||||
sql create database $dbNamme vgroups 1
|
sql create database $dbNamme vgroups 2
|
||||||
sql show databases
|
sql show databases
|
||||||
print $data00 $data01 $data02
|
print $data00 $data01 $data02
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
|
|
|
@ -226,7 +226,7 @@ void loop_consume(tmq_t* tmq) {
|
||||||
int32_t totalRows = 0;
|
int32_t totalRows = 0;
|
||||||
int32_t skipLogNum = 0;
|
int32_t skipLogNum = 0;
|
||||||
while (running) {
|
while (running) {
|
||||||
tmq_message_t* tmqMsg = tmq_consumer_poll(tmq, 1);
|
tmq_message_t* tmqMsg = tmq_consumer_poll(tmq, 3000);
|
||||||
if (tmqMsg) {
|
if (tmqMsg) {
|
||||||
totalMsgs++;
|
totalMsgs++;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue