• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

taosdata / TDengine / #3608

12 Feb 2025 05:57AM UTC coverage: 63.066% (+1.4%) from 61.715%
#3608

push

travis-ci

web-flow
Merge pull request #29746 from taosdata/merge/mainto3.02

merge: from main to 3.0 branch

140199 of 286257 branches covered (48.98%)

Branch coverage included in aggregate %.

89 of 161 new or added lines in 18 files covered. (55.28%)

3211 existing lines in 190 files now uncovered.

218998 of 283298 relevant lines covered (77.3%)

5949310.66 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.39
/source/dnode/vnode/src/tq/tqUtil.c
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the GNU Affero General Public License, version 3
6
 * or later ("AGPL"), as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
 * FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * You should have received a copy of the GNU Affero General Public License
13
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14
 */
15

16
#include "tq.h"
17

18
static int32_t tqSendMetaPollRsp(STqHandle* pHandle, const SRpcMsg* pMsg, const SMqPollReq* pReq,
19
                                 const SMqMetaRsp* pRsp, int32_t vgId);
20
static int32_t tqSendBatchMetaPollRsp(STqHandle* pHandle, const SRpcMsg* pMsg, const SMqPollReq* pReq,
21
                                      const SMqBatchMetaRsp* pRsp, int32_t vgId);
22

23
int32_t tqInitDataRsp(SMqDataRsp* pRsp, STqOffsetVal pOffset) {
53,616✔
24
  int32_t    code = TDB_CODE_SUCCESS;
53,616✔
25
  int32_t    lino = 0;
53,616✔
26
  tqDebug("%s called", __FUNCTION__ );
53,616!
27
  TSDB_CHECK_NULL(pRsp, code, lino, END, TSDB_CODE_INVALID_PARA);
53,617!
28

29
  pRsp->blockData = taosArrayInit(0, sizeof(void*));
53,617✔
30
  TSDB_CHECK_NULL(pRsp->blockData, code, lino, END, terrno);
53,617!
31

32
  pRsp->blockDataLen = taosArrayInit(0, sizeof(int32_t));
53,617✔
33
  TSDB_CHECK_NULL(pRsp->blockDataLen, code, lino, END, terrno);
53,617!
34

35
  tOffsetCopy(&pRsp->reqOffset, &pOffset);
53,617✔
36
  tOffsetCopy(&pRsp->rspOffset, &pOffset);
53,617✔
37
  pRsp->withTbName = 0;
53,617✔
38
  pRsp->withSchema = false;
53,617✔
39

40
END:
53,617✔
41
  if (code != 0){
53,617!
42
    tqError("%s failed at:%d, code:%s", __FUNCTION__ , lino, tstrerror(code));
×
43
  }
44
  return code;
53,617✔
45
}
46

47
void tqUpdateNodeStage(STQ* pTq, bool isLeader) {
13,402✔
48
  SSyncState state = syncGetState(pTq->pVnode->sync);
13,402✔
49
  streamMetaUpdateStageRole(pTq->pStreamMeta, state.term, isLeader);
13,416✔
50
}
13,416✔
51

52
static int32_t tqInitTaosxRsp(SMqDataRsp* pRsp, STqOffsetVal pOffset) {
13,381✔
53
  int32_t    code = TDB_CODE_SUCCESS;
13,381✔
54
  int32_t    lino = 0;
13,381✔
55
  tqDebug("%s called", __FUNCTION__ );
13,381!
56
  TSDB_CHECK_NULL(pRsp, code, lino, END, TSDB_CODE_INVALID_PARA);
13,381!
57
  tOffsetCopy(&pRsp->reqOffset, &pOffset);
13,381✔
58
  tOffsetCopy(&pRsp->rspOffset, &pOffset);
13,381✔
59

60
  pRsp->withTbName = 1;
13,381✔
61
  pRsp->withSchema = 1;
13,381✔
62
  pRsp->blockData = taosArrayInit(0, sizeof(void*));
13,381✔
63
  TSDB_CHECK_NULL(pRsp->blockData, code, lino, END, terrno);\
13,380!
64

65
  pRsp->blockDataLen = taosArrayInit(0, sizeof(int32_t));
13,380✔
66
  TSDB_CHECK_NULL(pRsp->blockDataLen, code, lino, END, terrno);
13,380!
67

68
  pRsp->blockTbName = taosArrayInit(0, sizeof(void*));
13,380✔
69
  TSDB_CHECK_NULL(pRsp->blockTbName, code, lino, END, terrno);
13,381!
70

71
  pRsp->blockSchema = taosArrayInit(0, sizeof(void*));
13,381✔
72
  TSDB_CHECK_NULL(pRsp->blockSchema, code, lino, END, terrno);
13,381!
73

74

75
END:
13,381✔
76
  if (code != 0){
13,381!
77
    tqError("%s failed at:%d, code:%s", __FUNCTION__ , lino, tstrerror(code));
×
78
    taosArrayDestroy(pRsp->blockData);
×
79
    taosArrayDestroy(pRsp->blockDataLen);
×
80
    taosArrayDestroy(pRsp->blockTbName);
×
81
    taosArrayDestroy(pRsp->blockSchema);
×
82
  }
83
  return code;
13,381✔
84
}
85

86
static int32_t extractResetOffsetVal(STqOffsetVal* pOffsetVal, STQ* pTq, STqHandle* pHandle, const SMqPollReq* pRequest,
2,557✔
87
                                     SRpcMsg* pMsg, bool* pBlockReturned) {
88
  if (pOffsetVal == NULL || pTq == NULL || pHandle == NULL || pRequest == NULL || pMsg == NULL || pBlockReturned == NULL) {
2,557!
89
    return TSDB_CODE_INVALID_PARA;
1✔
90
  }
91
  uint64_t   consumerId = pRequest->consumerId;
2,556✔
92
  STqOffset* pOffset = NULL;
2,556✔
93
  int32_t    code = tqMetaGetOffset(pTq, pRequest->subKey, &pOffset);
2,556✔
94
  int32_t    vgId = TD_VID(pTq->pVnode);
2,557✔
95

96
  *pBlockReturned = false;
2,557✔
97
  // In this vnode, data has been polled by consumer for this topic, so let's continue from the last offset value.
98
  if (code == 0) {
2,557✔
99
    tOffsetCopy(pOffsetVal, &pOffset->val);
175✔
100

101
    char formatBuf[TSDB_OFFSET_LEN] = {0};
176✔
102
    tFormatOffset(formatBuf, TSDB_OFFSET_LEN, pOffsetVal);
176✔
103
    tqDebug("tmq poll: consumer:0x%" PRIx64
176!
104
                ", subkey %s, vgId:%d, existed offset found, offset reset to %s and continue.QID:0x%" PRIx64,
105
            consumerId, pHandle->subKey, vgId, formatBuf, pRequest->reqId);
106
    return 0;
176✔
107
  } else {
108
    // no poll occurs in this vnode for this topic, let's seek to the right offset value.
109
    if (pRequest->reqOffset.type == TMQ_OFFSET__RESET_EARLIEST) {
2,382✔
110
      if (pRequest->useSnapshot) {
1,687✔
111
        tqDebug("tmq poll: consumer:0x%" PRIx64 ", subkey:%s, vgId:%d, (earliest) set offset to be snapshot",
843!
112
                consumerId, pHandle->subKey, vgId);
113
        if (pHandle->fetchMeta) {
843✔
114
          tqOffsetResetToMeta(pOffsetVal, 0);
115
        } else {
116
          SValue val = {0};
825!
117
          tqOffsetResetToData(pOffsetVal, 0, 0, val);
825✔
118
        }
119
      } else {
120
        walRefFirstVer(pTq->pVnode->pWal, pHandle->pRef);
844✔
121
        tqOffsetResetToLog(pOffsetVal, pHandle->pRef->refVer);
845✔
122
      }
123
    } else if (pRequest->reqOffset.type == TMQ_OFFSET__RESET_LATEST) {
695✔
124
      walRefLastVer(pTq->pVnode->pWal, pHandle->pRef);
55✔
125
      SMqDataRsp dataRsp = {0};
55✔
126
      tqOffsetResetToLog(pOffsetVal, pHandle->pRef->refVer + 1);
55✔
127

128
      code = tqInitDataRsp(&dataRsp, *pOffsetVal);
55✔
129
      if (code != 0) {
55!
130
        return code;
×
131
      }
132
      tqDebug("tmq poll: consumer:0x%" PRIx64 ", subkey %s, vgId:%d, (latest) offset reset to %" PRId64, consumerId,
55!
133
              pHandle->subKey, vgId, dataRsp.rspOffset.version);
134
      code = tqSendDataRsp(pHandle, pMsg, pRequest, &dataRsp, TMQ_MSG_TYPE__POLL_DATA_RSP, vgId);
55✔
135
      tDeleteMqDataRsp(&dataRsp);
55✔
136

137
      *pBlockReturned = true;
55✔
138
      return code;
55✔
139
    } else if (pRequest->reqOffset.type == TMQ_OFFSET__RESET_NONE) {
640!
140
      tqError("tmq poll: subkey:%s, no offset committed for consumer:0x%" PRIx64
640!
141
                  " in vg %d, subkey %s, reset none failed",
142
              pHandle->subKey, consumerId, vgId, pRequest->subKey);
143
      return TSDB_CODE_TQ_NO_COMMITTED_OFFSET;
640✔
144
    }
145
  }
146

147
  return 0;
1,688✔
148
}
149

150
static int32_t extractDataAndRspForNormalSubscribe(STQ* pTq, STqHandle* pHandle, const SMqPollReq* pRequest,
52,870✔
151
                                                   SRpcMsg* pMsg, STqOffsetVal* pOffset) {
152
  int32_t    code = TDB_CODE_SUCCESS;
52,870✔
153
  int32_t    lino = 0;
52,870✔
154
  tqDebug("%s called", __FUNCTION__ );
52,870!
155
  uint64_t consumerId = pRequest->consumerId;
52,871✔
156
  int32_t  vgId = TD_VID(pTq->pVnode);
52,871✔
157
  terrno = 0;
52,871✔
158

159
  SMqDataRsp dataRsp = {0};
52,871✔
160
  code = tqInitDataRsp(&dataRsp, *pOffset);
52,871✔
161
  TSDB_CHECK_CODE(code, lino, end);
52,871!
162

163
  code = qSetTaskId(pHandle->execHandle.task, consumerId, pRequest->reqId);
52,871✔
164
  TSDB_CHECK_CODE(code, lino, end);
52,871!
165

166
  code = tqScanData(pTq, pHandle, &dataRsp, pOffset, pRequest);
52,871✔
167
  if (code != 0 && terrno != TSDB_CODE_WAL_LOG_NOT_EXIST) {
52,871✔
168
    goto end;
653✔
169
  }
170

171
  //   till now, all data has been transferred to consumer, new data needs to push client once arrived.
172
  if (terrno == TSDB_CODE_WAL_LOG_NOT_EXIST && dataRsp.blockNum == 0) {
52,218✔
173
    // lock
174
    taosWLockLatch(&pTq->lock);
24,027✔
175
    int64_t ver = walGetCommittedVer(pTq->pVnode->pWal);
24,027✔
176
    if (dataRsp.rspOffset.version > ver) {  // check if there are data again to avoid lost data
24,027✔
177
      code = tqRegisterPushHandle(pTq, pHandle, pMsg);
22,936✔
178
      taosWUnLockLatch(&pTq->lock);
22,936✔
179
      goto end;
22,936✔
180
    }
181
    taosWUnLockLatch(&pTq->lock);
1,091✔
182
  }
183

184
  // reqOffset represents the current date offset, may be changed if wal not exists
185
  tOffsetCopy(&dataRsp.reqOffset, pOffset);
29,282✔
186
  code = tqSendDataRsp(pHandle, pMsg, pRequest, &dataRsp, TMQ_MSG_TYPE__POLL_DATA_RSP, vgId);
29,282✔
187

188
end:
52,871✔
189
  {
190
    char buf[TSDB_OFFSET_LEN] = {0};
52,871✔
191
    tFormatOffset(buf, TSDB_OFFSET_LEN, &dataRsp.rspOffset);
52,871✔
192
    if (code != 0){
52,871✔
193
      tqError("tmq poll: consumer:0x%" PRIx64 ", subkey %s, vgId:%d, rsp block:%d, rsp offset type:%s,QID:0x%" PRIx64 " error msg:%s, line:%d",
652!
194
              consumerId, pHandle->subKey, vgId, dataRsp.blockNum, buf, pRequest->reqId, tstrerror(code), lino);
195
    } else {
196
      tqDebug("tmq poll: consumer:0x%" PRIx64 ", subkey %s, vgId:%d, rsp block:%d, rsp offset type:%s,QID:0x%" PRIx64 " success",
52,219✔
197
              consumerId, pHandle->subKey, vgId, dataRsp.blockNum, buf, pRequest->reqId);
198
    }
199

200
    tDeleteMqDataRsp(&dataRsp);
52,872✔
201
    return code;
52,871✔
202
  }
203
}
204

205
#define PROCESS_EXCLUDED_MSG(TYPE, DECODE_FUNC, DELETE_FUNC)                                               \
206
  SDecoder decoder = {0};                                                                                  \
207
  TYPE     req = {0};                                                                                      \
208
  void*    data = POINTER_SHIFT(pHead->body, sizeof(SMsgHead));                                            \
209
  int32_t  len = pHead->bodyLen - sizeof(SMsgHead);                                                        \
210
  tDecoderInit(&decoder, data, len);                                                                       \
211
  if (DECODE_FUNC(&decoder, &req) == 0 && (req.source & TD_REQ_FROM_TAOX) != 0) {                          \
212
    tqDebug("tmq poll: consumer:0x%" PRIx64 " (epoch %d) iter log, jump meta for, vgId:%d offset %" PRId64 \
213
            " msgType %d",                                                                                 \
214
            pRequest->consumerId, pRequest->epoch, vgId, fetchVer, pHead->msgType);                        \
215
    fetchVer++;                                                                                            \
216
    DELETE_FUNC(&req);                                                                                     \
217
    tDecoderClear(&decoder);                                                                               \
218
    continue;                                                                                              \
219
  }                                                                                                        \
220
  DELETE_FUNC(&req);                                                                                       \
221
  tDecoderClear(&decoder);
222

223
static void tDeleteCommon(void* parm) {}
320✔
224

225
static int32_t extractDataAndRspForDbStbSubscribe(STQ* pTq, STqHandle* pHandle, const SMqPollReq* pRequest,
13,381✔
226
                                                  SRpcMsg* pMsg, STqOffsetVal* offset) {
227
  int32_t         vgId = TD_VID(pTq->pVnode);
13,381✔
228
  SMqDataRsp      taosxRsp = {0};
13,381✔
229
  SMqBatchMetaRsp btMetaRsp = {0};
13,381✔
230
  int32_t         code = 0;
13,381✔
231

232
  TQ_ERR_GO_TO_END(tqInitTaosxRsp(&taosxRsp, *offset));
13,381!
233
  if (offset->type != TMQ_OFFSET__LOG) {
13,381✔
234
    TQ_ERR_GO_TO_END(tqScanTaosx(pTq, pHandle, &taosxRsp, &btMetaRsp, offset, pRequest->timeout));
80!
235

236
    if (taosArrayGetSize(btMetaRsp.batchMetaReq) > 0) {
80✔
237
      code = tqSendBatchMetaPollRsp(pHandle, pMsg, pRequest, &btMetaRsp, vgId);
16✔
238
      tqDebug("tmq poll: consumer:0x%" PRIx64 " subkey:%s vgId:%d, send meta offset type:%d,uid:%" PRId64 ",ts:%" PRId64,
16!
239
              pRequest->consumerId, pHandle->subKey, vgId, btMetaRsp.rspOffset.type, btMetaRsp.rspOffset.uid,btMetaRsp.rspOffset.ts);
240
      goto END;
16✔
241
    }
242

243
    tqDebug("taosx poll: consumer:0x%" PRIx64 " subkey:%s vgId:%d, send data blockNum:%d, offset type:%d,uid:%" PRId64",ts:%" PRId64,
64!
244
            pRequest->consumerId, pHandle->subKey, vgId, taosxRsp.blockNum, taosxRsp.rspOffset.type, taosxRsp.rspOffset.uid, taosxRsp.rspOffset.ts);
245
    if (taosxRsp.blockNum > 0) {
64✔
246
      code = tqSendDataRsp(pHandle, pMsg, pRequest, &taosxRsp, TMQ_MSG_TYPE__POLL_DATA_RSP, vgId);
58✔
247
      goto END;
58✔
248
    } else {
249
      tOffsetCopy(offset, &taosxRsp.rspOffset);
6✔
250
    }
251
  }
252

253
  if (offset->type == TMQ_OFFSET__LOG) {
13,307!
254
    walReaderVerifyOffset(pHandle->pWalReader, offset);
13,307✔
255
    int64_t fetchVer = offset->version;
13,307✔
256

257
    uint64_t st = taosGetTimestampMs();
13,307✔
258
    int      totalRows = 0;
13,307✔
259
    int32_t  totalMetaRows = 0;
13,307✔
260
    while (1) {
121,921✔
261
      int32_t savedEpoch = atomic_load_32(&pHandle->epoch);
135,228✔
262
      if (savedEpoch > pRequest->epoch) {
135,226!
263
        tqError("tmq poll: consumer:0x%" PRIx64 " (epoch %d) iter log, savedEpoch error, vgId:%d offset %" PRId64,
×
264
                pRequest->consumerId, pRequest->epoch, vgId, fetchVer);
265
        code = TSDB_CODE_TQ_INTERNAL_ERROR;
×
266
        goto END;
13,305✔
267
      }
268

269
      if (tqFetchLog(pTq, pHandle, &fetchVer, pRequest->reqId) < 0) {
135,226✔
270
        if (totalMetaRows > 0) {
12,645✔
271
          tqOffsetResetToLog(&btMetaRsp.rspOffset, fetchVer);
2✔
272
          code = tqSendBatchMetaPollRsp(pHandle, pMsg, pRequest, &btMetaRsp, vgId);
2✔
273
          goto END;
2✔
274
        }
275
        tqOffsetResetToLog(&taosxRsp.rspOffset, fetchVer);
12,643✔
276
        code = tqSendDataRsp(pHandle, pMsg, pRequest, &taosxRsp,
12,643✔
277
                             taosxRsp.createTableNum > 0 ? TMQ_MSG_TYPE__POLL_DATA_META_RSP : TMQ_MSG_TYPE__POLL_DATA_RSP, vgId);
12,643✔
278
        goto END;
12,641✔
279
      }
280

281
      SWalCont* pHead = &pHandle->pWalReader->pHead->head;
122,581✔
282
      tqDebug("tmq poll: consumer:0x%" PRIx64 " (epoch %d) iter log, vgId:%d offset %" PRId64 " msgType %s",
122,581!
283
              pRequest->consumerId, pRequest->epoch, vgId, fetchVer, TMSG_INFO(pHead->msgType));
284

285
      // process meta
286
      if (pHead->msgType != TDMT_VND_SUBMIT) {
122,585✔
287
        if (totalRows > 0) {
557✔
288
          tqOffsetResetToLog(&taosxRsp.rspOffset, fetchVer);
26✔
289
          code = tqSendDataRsp(pHandle, pMsg, pRequest, &taosxRsp,
26✔
290
                               taosxRsp.createTableNum > 0 ? TMQ_MSG_TYPE__POLL_DATA_META_RSP : TMQ_MSG_TYPE__POLL_DATA_RSP, vgId);
26✔
291
          goto END;
214✔
292
        }
293

294
        if ((pRequest->sourceExcluded & TD_REQ_FROM_TAOX) != 0) {
531✔
295
          if (pHead->msgType == TDMT_VND_CREATE_TABLE) {
528✔
296
            PROCESS_EXCLUDED_MSG(SVCreateTbBatchReq, tDecodeSVCreateTbBatchReq, tDeleteSVCreateTbBatchReq)
170!
297
          } else if (pHead->msgType == TDMT_VND_ALTER_TABLE) {
358✔
298
            PROCESS_EXCLUDED_MSG(SVAlterTbReq, tDecodeSVAlterTbReq, tDeleteCommon)
44!
299
          } else if (pHead->msgType == TDMT_VND_CREATE_STB || pHead->msgType == TDMT_VND_ALTER_STB) {
394✔
300
            PROCESS_EXCLUDED_MSG(SVCreateStbReq, tDecodeSVCreateStbReq, tDeleteCommon)
271!
301
          } else if (pHead->msgType == TDMT_VND_DELETE) {
43✔
302
            PROCESS_EXCLUDED_MSG(SDeleteRes, tDecodeDeleteRes, tDeleteCommon)
5!
303
          }
304
        }
305

306
        tqDebug("fetch meta msg, ver:%" PRId64 ", vgId:%d, type:%s, enable batch meta:%d", pHead->version, vgId,
190!
307
                TMSG_INFO(pHead->msgType), pRequest->enableBatchMeta);
308
        if (!pRequest->enableBatchMeta && !pRequest->useSnapshot) {
190!
309
          SMqMetaRsp metaRsp = {0};
188✔
310
          tqOffsetResetToLog(&metaRsp.rspOffset, fetchVer + 1);
188✔
311
          metaRsp.resMsgType = pHead->msgType;
188✔
312
          metaRsp.metaRspLen = pHead->bodyLen;
188✔
313
          metaRsp.metaRsp = pHead->body;
188✔
314
          code = tqSendMetaPollRsp(pHandle, pMsg, pRequest, &metaRsp, vgId);
188✔
315
          goto END;
188✔
316
        }
317

318
        if (!btMetaRsp.batchMetaReq) {
2!
319
          btMetaRsp.batchMetaReq = taosArrayInit(4, POINTER_BYTES);
2✔
320
          TQ_NULL_GO_TO_END(btMetaRsp.batchMetaReq);
2!
321
          btMetaRsp.batchMetaLen = taosArrayInit(4, sizeof(int32_t));
2✔
322
          TQ_NULL_GO_TO_END(btMetaRsp.batchMetaLen);
2!
323
        }
324
        fetchVer++;
2✔
325

326
        SMqMetaRsp tmpMetaRsp = {0};
2✔
327
        tmpMetaRsp.resMsgType = pHead->msgType;
2✔
328
        tmpMetaRsp.metaRspLen = pHead->bodyLen;
2✔
329
        tmpMetaRsp.metaRsp = pHead->body;
2✔
330
        uint32_t len = 0;
2✔
331
        tEncodeSize(tEncodeMqMetaRsp, &tmpMetaRsp, len, code);
2!
332
        if (TSDB_CODE_SUCCESS != code) {
2!
333
          tqError("tmq extract meta from log, tEncodeMqMetaRsp error");
×
334
          continue;
×
335
        }
336
        int32_t tLen = sizeof(SMqRspHead) + len;
2✔
337
        void*   tBuf = taosMemoryCalloc(1, tLen);
2!
338
        TQ_NULL_GO_TO_END(tBuf);
2!
339
        void*    metaBuff = POINTER_SHIFT(tBuf, sizeof(SMqRspHead));
2✔
340
        SEncoder encoder = {0};
2✔
341
        tEncoderInit(&encoder, metaBuff, len);
2✔
342
        code = tEncodeMqMetaRsp(&encoder, &tmpMetaRsp);
2✔
343
        tEncoderClear(&encoder);
2✔
344

345
        if (code < 0) {
2!
346
          tqError("tmq extract meta from log, tEncodeMqMetaRsp error");
×
347
          continue;
×
348
        }
349
        TQ_NULL_GO_TO_END (taosArrayPush(btMetaRsp.batchMetaReq, &tBuf));
4!
350
        TQ_NULL_GO_TO_END (taosArrayPush(btMetaRsp.batchMetaLen, &tLen));
4!
351
        totalMetaRows++;
2✔
352
        if ((taosArrayGetSize(btMetaRsp.batchMetaReq) >= tmqRowSize) || (taosGetTimestampMs() - st > TMIN(TQ_POLL_MAX_TIME, pRequest->timeout))) {
4!
353
          tqOffsetResetToLog(&btMetaRsp.rspOffset, fetchVer);
×
354
          code = tqSendBatchMetaPollRsp(pHandle, pMsg, pRequest, &btMetaRsp, vgId);
×
355
          goto END;
×
356
        }
357
        continue;
2✔
358
      }
359

360
      if (totalMetaRows > 0) {
122,028!
361
        tqOffsetResetToLog(&btMetaRsp.rspOffset, fetchVer);
×
362
        code = tqSendBatchMetaPollRsp(pHandle, pMsg, pRequest, &btMetaRsp, vgId);
×
363
        goto END;
×
364
      }
365

366
      // process data
367
      SPackedData submit = {
122,028✔
368
          .msgStr = POINTER_SHIFT(pHead->body, sizeof(SSubmitReq2Msg)),
122,028✔
369
          .msgLen = pHead->bodyLen - sizeof(SSubmitReq2Msg),
122,028✔
370
          .ver = pHead->version,
122,028✔
371
      };
372

373
      TQ_ERR_GO_TO_END(tqTaosxScanLog(pTq, pHandle, submit, &taosxRsp, &totalRows, pRequest->sourceExcluded));
122,028!
374

375
      if (totalRows >= tmqRowSize || (taosGetTimestampMs() - st > TMIN(TQ_POLL_MAX_TIME, pRequest->timeout))) {
243,603!
376
        tqOffsetResetToLog(&taosxRsp.rspOffset, fetchVer + 1);
448✔
377
        code = tqSendDataRsp(pHandle, pMsg, pRequest, &taosxRsp,
448✔
378
                             taosxRsp.createTableNum > 0 ? TMQ_MSG_TYPE__POLL_DATA_META_RSP : TMQ_MSG_TYPE__POLL_DATA_RSP, vgId);
448!
379
        goto END;
448✔
380
      } else {
381
        fetchVer++;
121,578✔
382
      }
383
    }
384
  }
385

386
END:
×
387
  if (code != 0){
13,379!
UNCOV
388
    tqError("tmq poll: tqTaosxScanLog error. consumerId:0x%" PRIx64 ", in vgId:%d, subkey %s", pRequest->consumerId, vgId,
×
389
            pRequest->subKey);
390
  }
391
  tDeleteMqBatchMetaRsp(&btMetaRsp);
13,379✔
392
  tDeleteSTaosxRsp(&taosxRsp);
13,381✔
393
  return code;
13,380✔
394
}
395

396
int32_t tqExtractDataForMq(STQ* pTq, STqHandle* pHandle, const SMqPollReq* pRequest, SRpcMsg* pMsg) {
66,939✔
397
  if (pTq == NULL || pHandle == NULL || pRequest == NULL || pMsg == NULL) {
66,939!
398
    return TSDB_CODE_TMQ_INVALID_MSG;
×
399
  }
400
  int32_t      code = 0;
66,945✔
401
  STqOffsetVal reqOffset = {0};
66,945✔
402
  tOffsetCopy(&reqOffset, &pRequest->reqOffset);
66,945✔
403

404
  // reset the offset if needed
405
  if (IS_OFFSET_RESET_TYPE(pRequest->reqOffset.type)) {
66,944✔
406
    bool blockReturned = false;
2,557✔
407
    code = extractResetOffsetVal(&reqOffset, pTq, pHandle, pRequest, pMsg, &blockReturned);
2,557✔
408
    if (code != 0) {
2,559✔
409
      goto END;
695✔
410
    }
411

412
    // empty block returned, quit
413
    if (blockReturned) {
1,919✔
414
      goto END;
55✔
415
    }
416
  } else if (reqOffset.type == 0) {  // use the consumer specified offset
64,387!
417
    uError("req offset type is 0");
×
418
    code = TSDB_CODE_TMQ_INVALID_MSG;
×
419
    goto END;
×
420
  }
421

422
  if (pHandle->execHandle.subType == TOPIC_SUB_TYPE__COLUMN) {
66,251✔
423
    code = extractDataAndRspForNormalSubscribe(pTq, pHandle, pRequest, pMsg, &reqOffset);
52,870✔
424
  } else {
425
    code = extractDataAndRspForDbStbSubscribe(pTq, pHandle, pRequest, pMsg, &reqOffset);
13,381✔
426
  }
427

428
END:
66,944✔
429
  if (code != 0){
66,944✔
430
    uError("failed to extract data for mq, msg:%s", tstrerror(code));
1,293!
431
  }
432
  tOffsetDestroy(&reqOffset);
66,944✔
433
  return code;
66,944✔
434
}
435

436
static void initMqRspHead(SMqRspHead* pMsgHead, int32_t type, int32_t epoch, int64_t consumerId, int64_t sver,
43,409✔
437
                          int64_t ever) {
438
  if (pMsgHead == NULL) {
43,409!
439
    return;
×
440
  }
441
  pMsgHead->consumerId = consumerId;
43,409✔
442
  pMsgHead->epoch = epoch;
43,409✔
443
  pMsgHead->mqMsgType = type;
43,409✔
444
  pMsgHead->walsver = sver;
43,409✔
445
  pMsgHead->walever = ever;
43,409✔
446
}
447

448
int32_t tqSendBatchMetaPollRsp(STqHandle* pHandle, const SRpcMsg* pMsg, const SMqPollReq* pReq,
18✔
449
                               const SMqBatchMetaRsp* pRsp, int32_t vgId) {
450
  if (pHandle == NULL || pMsg == NULL || pReq == NULL || pRsp == NULL) {
18!
451
    return TSDB_CODE_TMQ_INVALID_MSG;
×
452
  }
453
  int32_t len = 0;
18✔
454
  int32_t code = 0;
18✔
455
  tEncodeSize(tEncodeMqBatchMetaRsp, pRsp, len, code);
18!
456
  if (code < 0) {
18!
457
    return TAOS_GET_TERRNO(code);
×
458
  }
459
  int32_t tlen = sizeof(SMqRspHead) + len;
18✔
460
  void*   buf = rpcMallocCont(tlen);
18✔
461
  if (buf == NULL) {
18!
462
    return TAOS_GET_TERRNO(terrno);
×
463
  }
464

465
  int64_t sver = 0, ever = 0;
18✔
466
  walReaderValidVersionRange(pHandle->execHandle.pTqReader->pWalReader, &sver, &ever);
18✔
467
  initMqRspHead(buf, TMQ_MSG_TYPE__POLL_BATCH_META_RSP, pReq->epoch, pReq->consumerId, sver, ever);
18✔
468

469
  void* abuf = POINTER_SHIFT(buf, sizeof(SMqRspHead));
18✔
470

471
  SEncoder encoder = {0};
18✔
472
  tEncoderInit(&encoder, abuf, len);
18✔
473
  code = tEncodeMqBatchMetaRsp(&encoder, pRsp);
18✔
474
  tEncoderClear(&encoder);
18✔
475
  if (code < 0) {
18!
476
    rpcFreeCont(buf);
×
477
    return TAOS_GET_TERRNO(code);
×
478
  }
479
  SRpcMsg resp = {.info = pMsg->info, .pCont = buf, .contLen = tlen, .code = 0};
18✔
480

481
  tmsgSendRsp(&resp);
18✔
482
  tqDebug("vgId:%d, from consumer:0x%" PRIx64 " (epoch %d) send rsp, res msg type: batch meta, size:%ld offset type:%d",
18!
483
          vgId, pReq->consumerId, pReq->epoch, taosArrayGetSize(pRsp->batchMetaReq), pRsp->rspOffset.type);
484

485
  return 0;
18✔
486
}
487

488
int32_t tqSendMetaPollRsp(STqHandle* pHandle, const SRpcMsg* pMsg, const SMqPollReq* pReq, const SMqMetaRsp* pRsp,
188✔
489
                          int32_t vgId) {
490
  if (pHandle == NULL || pMsg == NULL || pReq == NULL || pRsp == NULL) {
188!
491
    return TSDB_CODE_TMQ_INVALID_MSG;
×
492
  }
493
  int32_t len = 0;
188✔
494
  int32_t code = 0;
188✔
495
  tEncodeSize(tEncodeMqMetaRsp, pRsp, len, code);
188!
496
  if (code < 0) {
188!
497
    return TAOS_GET_TERRNO(code);
×
498
  }
499
  int32_t tlen = sizeof(SMqRspHead) + len;
188✔
500
  void*   buf = rpcMallocCont(tlen);
188✔
501
  if (buf == NULL) {
188!
502
    return TAOS_GET_TERRNO(TSDB_CODE_OUT_OF_MEMORY);
×
503
  }
504

505
  int64_t sver = 0, ever = 0;
188✔
506
  walReaderValidVersionRange(pHandle->execHandle.pTqReader->pWalReader, &sver, &ever);
188✔
507
  initMqRspHead(buf, TMQ_MSG_TYPE__POLL_META_RSP, pReq->epoch, pReq->consumerId, sver, ever);
188✔
508

509
  void* abuf = POINTER_SHIFT(buf, sizeof(SMqRspHead));
188✔
510

511
  SEncoder encoder = {0};
188✔
512
  tEncoderInit(&encoder, abuf, len);
188✔
513
  code = tEncodeMqMetaRsp(&encoder, pRsp);
188✔
514
  tEncoderClear(&encoder);
188✔
515
  if (code < 0) {
188!
516
    rpcFreeCont(buf);
×
517
    return TAOS_GET_TERRNO(code);
×
518
  }
519

520
  SRpcMsg resp = {.info = pMsg->info, .pCont = buf, .contLen = tlen, .code = 0};
188✔
521

522
  tmsgSendRsp(&resp);
188✔
523
  tqDebug("vgId:%d, from consumer:0x%" PRIx64 " (epoch %d) send rsp, res msg type %d, offset type:%d", vgId,
188!
524
          pReq->consumerId, pReq->epoch, pRsp->resMsgType, pRsp->rspOffset.type);
525

526
  return 0;
188✔
527
}
528

529
int32_t tqDoSendDataRsp(const SRpcHandleInfo* pRpcHandleInfo, const SMqDataRsp* pRsp, int32_t epoch, int64_t consumerId,
43,203✔
530
                        int32_t type, int64_t sver, int64_t ever) {
531
  if (pRpcHandleInfo == NULL || pRsp == NULL) {
43,203!
532
    return TSDB_CODE_TMQ_INVALID_MSG;
×
533
  }
534
  int32_t len = 0;
43,203✔
535
  int32_t code = 0;
43,203✔
536

537
  if (type == TMQ_MSG_TYPE__POLL_DATA_RSP || type == TMQ_MSG_TYPE__WALINFO_RSP) {
43,203✔
538
    tEncodeSize(tEncodeMqDataRsp, pRsp, len, code);
43,191!
539
  } else if (type == TMQ_MSG_TYPE__POLL_DATA_META_RSP) {
12!
540
    tEncodeSize(tEncodeSTaosxRsp, pRsp, len, code);
12!
541
  }
542

543
  if (code < 0) {
43,201!
544
    return TAOS_GET_TERRNO(code);
×
545
  }
546

547
  int32_t tlen = sizeof(SMqRspHead) + len;
43,201✔
548
  void*   buf = rpcMallocCont(tlen);
43,201✔
549
  if (buf == NULL) {
43,203!
550
    return terrno;
×
551
  }
552

553
  SMqRspHead* pHead = (SMqRspHead*)buf;
43,203✔
554
  initMqRspHead(pHead, type, epoch, consumerId, sver, ever);
43,203✔
555

556
  void* abuf = POINTER_SHIFT(buf, sizeof(SMqRspHead));
43,203✔
557

558
  SEncoder encoder = {0};
43,203✔
559
  tEncoderInit(&encoder, abuf, len);
43,203✔
560

561
  if (type == TMQ_MSG_TYPE__POLL_DATA_RSP || type == TMQ_MSG_TYPE__WALINFO_RSP) {
43,203✔
562
    code = tEncodeMqDataRsp(&encoder, pRsp);
43,191✔
563
  } else if (type == TMQ_MSG_TYPE__POLL_DATA_META_RSP) {
12!
564
    code = tEncodeSTaosxRsp(&encoder, pRsp);
12✔
565
  }
566
  tEncoderClear(&encoder);
43,200✔
567
  if (code < 0) {
43,200!
568
    rpcFreeCont(buf);
×
569
    return TAOS_GET_TERRNO(code);
×
570
  }
571
  SRpcMsg rsp = {.info = *pRpcHandleInfo, .pCont = buf, .contLen = tlen, .code = 0};
43,200✔
572

573
  tmsgSendRsp(&rsp);
43,200✔
574
  return 0;
43,203✔
575
}
576

577
int32_t tqExtractDelDataBlock(const void* pData, int32_t len, int64_t ver, void** pRefBlock, int32_t type, EStreamType blockType) {
2,055✔
578
  int32_t     code = 0;
2,055✔
579
  int32_t     line = 0;
2,055✔
580
  SDecoder*   pCoder = &(SDecoder){0};
2,055✔
581
  SDeleteRes* pRes = &(SDeleteRes){0};
2,055✔
582

583
  *pRefBlock = NULL;
2,055✔
584

585
  pRes->uidList = taosArrayInit(0, sizeof(tb_uid_t));
2,055✔
586
  TSDB_CHECK_NULL(pRes->uidList, code, line, END, terrno)
2,055!
587

588
  tDecoderInit(pCoder, (uint8_t*)pData, len);
2,055✔
589
  code = tDecodeDeleteRes(pCoder, pRes);
2,055✔
590
  TSDB_CHECK_CODE(code, line, END);
2,055!
591

592
  int32_t numOfTables = taosArrayGetSize(pRes->uidList);
2,055✔
593
  if (numOfTables == 0 || pRes->affectedRows == 0) {
2,055✔
594
    goto END;
826✔
595
  }
596

597
  SSDataBlock* pDelBlock = NULL;
1,229✔
598
  code = createSpecialDataBlock(blockType, &pDelBlock);
1,229✔
599
  TSDB_CHECK_CODE(code, line, END);
1,229!
600

601
  code = blockDataEnsureCapacity(pDelBlock, numOfTables);
1,229✔
602
  TSDB_CHECK_CODE(code, line, END);
1,229!
603

604
  pDelBlock->info.rows = numOfTables;
1,229✔
605
  pDelBlock->info.version = ver;
1,229✔
606

607
  for (int32_t i = 0; i < numOfTables; i++) {
2,465✔
608
    // start key column
609
    SColumnInfoData* pStartCol = taosArrayGet(pDelBlock->pDataBlock, START_TS_COLUMN_INDEX);
1,236✔
610
    TSDB_CHECK_NULL(pStartCol, code, line, END, terrno)
1,236!
611
    code = colDataSetVal(pStartCol, i, (const char*)&pRes->skey, false);  // end key column
1,236✔
612
    TSDB_CHECK_CODE(code, line, END);
1,236!
613
    SColumnInfoData* pEndCol = taosArrayGet(pDelBlock->pDataBlock, END_TS_COLUMN_INDEX);
1,236✔
614
    TSDB_CHECK_NULL(pEndCol, code, line, END, terrno)
1,236!
615
    code = colDataSetVal(pEndCol, i, (const char*)&pRes->ekey, false);
1,236✔
616
    TSDB_CHECK_CODE(code, line, END);
1,236!
617
    // uid column
618
    SColumnInfoData* pUidCol = taosArrayGet(pDelBlock->pDataBlock, UID_COLUMN_INDEX);
1,236✔
619
    TSDB_CHECK_NULL(pUidCol, code, line, END, terrno)
1,236!
620

621
    int64_t* pUid = taosArrayGet(pRes->uidList, i);
1,236✔
622
    code = colDataSetVal(pUidCol, i, (const char*)pUid, false);
1,236✔
623
    TSDB_CHECK_CODE(code, line, END);
1,236!
624
    void* tmp = taosArrayGet(pDelBlock->pDataBlock, GROUPID_COLUMN_INDEX);
1,236✔
625
    TSDB_CHECK_NULL(tmp, code, line, END, terrno)
1,236!
626
    colDataSetNULL(tmp, i);
1,236!
627
    tmp = taosArrayGet(pDelBlock->pDataBlock, CALCULATE_START_TS_COLUMN_INDEX);
1,236✔
628
    TSDB_CHECK_NULL(tmp, code, line, END, terrno)
1,236!
629
    colDataSetNULL(tmp, i);
1,236!
630
    tmp = taosArrayGet(pDelBlock->pDataBlock, CALCULATE_END_TS_COLUMN_INDEX);
1,236✔
631
    TSDB_CHECK_NULL(tmp, code, line, END, terrno)
1,236!
632
    colDataSetNULL(tmp, i);
1,236!
633
    tmp = taosArrayGet(pDelBlock->pDataBlock, TABLE_NAME_COLUMN_INDEX);
1,236✔
634
    TSDB_CHECK_NULL(tmp, code, line, END, terrno)
1,236!
635
    colDataSetNULL(tmp, i);
1,236!
636
  }
637

638
  if (type == 0) {
1,229✔
639
    code = taosAllocateQitem(sizeof(SStreamRefDataBlock), DEF_QITEM, 0, pRefBlock);
1,221✔
640
    if (code) {
1,221!
641
      blockDataCleanup(pDelBlock);
×
642
      taosMemoryFree(pDelBlock);
×
643
      return code;
×
644
    }
645

646
    ((SStreamRefDataBlock*)(*pRefBlock))->type = STREAM_INPUT__REF_DATA_BLOCK;
1,221✔
647
    ((SStreamRefDataBlock*)(*pRefBlock))->pBlock = pDelBlock;
1,221✔
648
  } else if (type == 1) {
8!
649
    *pRefBlock = pDelBlock;
8✔
650
  } else {
651
    tqError("unknown type:%d", type);
×
652
    code = TSDB_CODE_TMQ_CONSUMER_ERROR;
×
653
  }
654

655
END:
2,055✔
656
  if (code != 0) {
2,055!
657
    tqError("failed to extract delete data block, line:%d code:%d", line, code);
×
658
  }
659
  tDecoderClear(pCoder);
2,055✔
660
  taosArrayDestroy(pRes->uidList);
2,055✔
661
  return code;
2,055✔
662
}
663

664
int32_t tqGetStreamExecInfo(SVnode* pVnode, int64_t streamId, int64_t* pDelay, bool* fhFinished) {
5,820✔
665
  SStreamMeta* pMeta = pVnode->pTq->pStreamMeta;
5,820✔
666
  int32_t      numOfTasks = taosArrayGetSize(pMeta->pTaskList);
5,820✔
667
  int32_t      code = TSDB_CODE_SUCCESS;
5,819✔
668

669
  if (pDelay != NULL) {
5,819!
670
    *pDelay = 0;
5,819✔
671
  }
672

673
  *fhFinished = false;
5,819✔
674

675
  if (numOfTasks <= 0) {
5,819!
676
    return code;
×
677
  }
678

679
  // extract the required source task for a given stream, identified by streamId
680
  streamMetaRLock(pMeta);
5,819✔
681

682
  numOfTasks = taosArrayGetSize(pMeta->pTaskList);
5,819✔
683

684
  for (int32_t i = 0; i < numOfTasks; ++i) {
35,345✔
685
    SStreamTaskId* pId = taosArrayGet(pMeta->pTaskList, i);
29,525✔
686
    if (pId == NULL) {
29,521!
687
      continue;
23,713✔
688
    }
689
    if (pId->streamId != streamId) {
29,521✔
690
      continue;
17,893✔
691
    }
692

693
    STaskId      id = {.streamId = pId->streamId, .taskId = pId->taskId};
11,628✔
694
    SStreamTask* pTask = NULL;
11,628✔
695

696
    code = streamMetaAcquireTaskUnsafe(pMeta, &id, &pTask);
11,628✔
697
    if (code != 0) {
11,640!
698
      tqError("vgId:%d failed to acquire task:0x%x in retrieving progress", pMeta->vgId, pId->taskId);
×
699
      continue;
×
700
    }
701

702
    if (pTask->info.taskLevel != TASK_LEVEL__SOURCE) {
11,640✔
703
      streamMetaReleaseTask(pMeta, pTask);
5,820✔
704
      continue;
5,820✔
705
    }
706

707
    // here we get the required stream source task
708
    *fhFinished = !HAS_RELATED_FILLHISTORY_TASK(pTask);
5,820✔
709

710
    int64_t ver = walReaderGetCurrentVer(pTask->exec.pWalReader);
5,820✔
711
    if (ver == -1) {
5,820✔
712
      ver = pTask->chkInfo.processedVer;
1,906✔
713
    } else {
714
      ver--;
3,914✔
715
    }
716

717
    SVersionRange verRange = {0};
5,820✔
718
    walReaderValidVersionRange(pTask->exec.pWalReader, &verRange.minVer, &verRange.maxVer);
5,820✔
719

720
    SWalReader* pReader = walOpenReader(pTask->exec.pWalReader->pWal, NULL, 0);
5,820✔
721
    if (pReader == NULL) {
5,820!
722
      tqError("failed to open wal reader to extract exec progress, vgId:%d", pMeta->vgId);
×
723
      streamMetaReleaseTask(pMeta, pTask);
×
724
      continue;
×
725
    }
726

727
    int64_t cur = 0;
5,820✔
728
    int64_t latest = 0;
5,820✔
729

730
    code = walFetchHead(pReader, ver);
5,820✔
731
    if (code == TSDB_CODE_SUCCESS) {
5,820!
732
      cur = pReader->pHead->head.ingestTs;
5,820✔
733
    }
734

735
    if (ver == verRange.maxVer) {
5,820✔
736
      latest = cur;
2,450✔
737
    } else {
738
      code = walFetchHead(pReader, verRange.maxVer);
3,370✔
739
      if (code == TSDB_CODE_SUCCESS) {
3,370!
740
        latest = pReader->pHead->head.ingestTs;
3,370✔
741
      }
742
    }
743

744
    if (pDelay != NULL) {  // delay in ms
5,820✔
745
      *pDelay = (latest - cur) / 1000;
5,819✔
746
    }
747

748
    walCloseReader(pReader);
5,820✔
749
    streamMetaReleaseTask(pMeta, pTask);
5,820✔
750
  }
751

752
  streamMetaRUnLock(pMeta);
5,820✔
753

754
  return TSDB_CODE_SUCCESS;
5,820✔
755
}
756

757
int32_t tqExtractDropCtbDataBlock(const void* data, int32_t len, int64_t ver, void** pRefBlock, int32_t type) {
183✔
758
  int32_t          code = 0;
183✔
759
  int32_t          lino = 0;
183✔
760
  SDecoder         dc = {0};
183✔
761
  SVDropTbBatchReq batchReq = {0};
183✔
762
  tDecoderInit(&dc, (uint8_t*)data, len);
183✔
763
  code = tDecodeSVDropTbBatchReq(&dc, &batchReq);
183✔
764
  TSDB_CHECK_CODE(code, lino, _exit);
183!
765
  if (batchReq.nReqs <= 0) goto _exit;
183!
766

767
  SSDataBlock* pBlock = NULL;
183✔
768
  code = createSpecialDataBlock(STREAM_DROP_CHILD_TABLE, &pBlock);
183✔
769
  TSDB_CHECK_CODE(code, lino, _exit);
183!
770

771
  code = blockDataEnsureCapacity(pBlock, batchReq.nReqs);
183✔
772
  TSDB_CHECK_CODE(code, lino, _exit);
183!
773

774
  pBlock->info.rows = batchReq.nReqs;
183✔
775
  pBlock->info.version = ver;
183✔
776
  for (int32_t i = 0; i < batchReq.nReqs; ++i) {
371✔
777
    SVDropTbReq* pReq = batchReq.pReqs + i;
188✔
778
    SColumnInfoData* pCol = taosArrayGet(pBlock->pDataBlock, UID_COLUMN_INDEX);
188✔
779
    TSDB_CHECK_NULL(pCol, code, lino, _exit, terrno);
188!
780
    code = colDataSetVal(pCol, i, (const char* )&pReq->uid, false);
188✔
781
    TSDB_CHECK_CODE(code, lino, _exit);
188!
782
  }
783

784
  code = taosAllocateQitem(sizeof(SStreamRefDataBlock), DEF_QITEM, 0, pRefBlock);
183✔
785
  TSDB_CHECK_CODE(code, lino, _exit);
183!
786
  ((SStreamRefDataBlock*)(*pRefBlock))->type = STREAM_INPUT__REF_DATA_BLOCK;
183✔
787
  ((SStreamRefDataBlock*)(*pRefBlock))->pBlock = pBlock;
183✔
788

789
_exit:
183✔
790
  tDecoderClear(&dc);
183✔
791
  if (TSDB_CODE_SUCCESS != code) {
183!
792
    tqError("faled to extract drop ctb data block, line:%d code:%s", lino, tstrerror(code));
×
793
    blockDataCleanup(pBlock);
×
794
    taosMemoryFree(pBlock);
×
795
  }
796
  return code;
183✔
797
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc