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

taosdata / TDengine / #3569

28 Dec 2024 03:56AM UTC coverage: 62.96% (-0.3%) from 63.286%
#3569

push

travis-ci

web-flow
Merge pull request #29369 from taosdata/enh/TS-4994-more-test-case

enh: add more cases

139174 of 284303 branches covered (48.95%)

Branch coverage included in aggregate %.

26 of 32 new or added lines in 3 files covered. (81.25%)

1505 existing lines in 138 files now uncovered.

217071 of 281522 relevant lines covered (77.11%)

18800589.91 hits per line

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

54.37
/source/dnode/vnode/src/vnd/vnodeQuery.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 "tsdb.h"
17
#include "vnd.h"
18

19
#define VNODE_GET_LOAD_RESET_VALS(pVar, oVal, vType, tags)                                                    \
20
  do {                                                                                                        \
21
    int##vType##_t newVal = atomic_sub_fetch_##vType(&(pVar), (oVal));                                        \
22
    if (newVal < 0) {                                                                                         \
23
      vWarn("vgId:%d, %s, abnormal val:%" PRIi64 ", old val:%" PRIi64, TD_VID(pVnode), tags, newVal, (oVal)); \
24
    }                                                                                                         \
25
  } while (0)
26

27
int vnodeQueryOpen(SVnode *pVnode) {
11,212✔
28
  return qWorkerInit(NODE_TYPE_VNODE, TD_VID(pVnode), (void **)&pVnode->pQuery, &pVnode->msgCb);
11,212✔
29
}
30

31
void vnodeQueryPreClose(SVnode *pVnode) { qWorkerStopAllTasks((void *)pVnode->pQuery); }
11,211✔
32

33
void vnodeQueryClose(SVnode *pVnode) { qWorkerDestroy((void **)&pVnode->pQuery); }
11,210✔
34

35
int32_t fillTableColCmpr(SMetaReader *reader, SSchemaExt *pExt, int32_t numOfCol) {
1,235,700✔
36
  int8_t tblType = reader->me.type;
1,235,700✔
37
  if (useCompress(tblType)) {
1,235,700!
38
    SColCmprWrapper *p = &(reader->me.colCmpr);
1,235,824✔
39
    if (numOfCol != p->nCols) {
1,235,824!
40
      vError("fillTableColCmpr table type:%d, col num:%d, col cmpr num:%d mismatch", tblType, numOfCol, p->nCols);
×
41
      return TSDB_CODE_APP_ERROR;
×
42
    }
43
    for (int i = 0; i < p->nCols; i++) {
31,686,972✔
44
      SColCmpr *pCmpr = &p->pColCmpr[i];
30,451,148✔
45
      pExt[i].colId = pCmpr->id;
30,451,148✔
46
      pExt[i].compress = pCmpr->alg;
30,451,148✔
47
    }
48
  }
49
  return 0;
1,235,797✔
50
}
51

52
int32_t vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
1,244,322✔
53
  STableInfoReq  infoReq = {0};
1,244,322✔
54
  STableMetaRsp  metaRsp = {0};
1,244,322✔
55
  SMetaReader    mer1 = {0};
1,244,322✔
56
  SMetaReader    mer2 = {0};
1,244,322✔
57
  char           tableFName[TSDB_TABLE_FNAME_LEN];
58
  bool           reqTbUid = false;
1,244,322✔
59
  SRpcMsg        rpcMsg = {0};
1,244,322✔
60
  int32_t        code = 0;
1,244,322✔
61
  int32_t        rspLen = 0;
1,244,322✔
62
  void          *pRsp = NULL;
1,244,322✔
63
  SSchemaWrapper schema = {0};
1,244,322✔
64
  SSchemaWrapper schemaTag = {0};
1,244,322✔
65

66
  // decode req
67
  if (tDeserializeSTableInfoReq(pMsg->pCont, pMsg->contLen, &infoReq) != 0) {
1,244,322!
68
    code = terrno;
×
69
    goto _exit4;
×
70
  }
71

72
  if (infoReq.option == REQ_OPT_TBUID) reqTbUid = true;
1,245,508!
73
  metaRsp.dbId = pVnode->config.dbId;
1,245,508✔
74
  tstrncpy(metaRsp.tbName, infoReq.tbName, TSDB_TABLE_NAME_LEN);
1,245,508✔
75
  (void)memcpy(metaRsp.dbFName, infoReq.dbFName, sizeof(metaRsp.dbFName));
1,245,508✔
76

77
  if (!reqTbUid) {
1,245,508✔
78
    (void)tsnprintf(tableFName, TSDB_TABLE_FNAME_LEN, "%s.%s", infoReq.dbFName, infoReq.tbName);
1,244,592✔
79
    code = vnodeValidateTableHash(pVnode, tableFName);
1,245,440✔
80
    if (code) {
1,245,426!
81
      goto _exit4;
×
82
    }
83
  }
84

85
  // query meta
86
  metaReaderDoInit(&mer1, pVnode->pMeta, META_READER_LOCK);
1,246,342✔
87
  if (reqTbUid) {
1,245,304!
UNCOV
88
    errno = 0;
×
UNCOV
89
    uint64_t tbUid = taosStr2UInt64(infoReq.tbName, NULL, 10);
×
UNCOV
90
    if (errno == ERANGE || tbUid == 0) {
×
91
      code = TSDB_CODE_TDB_TABLE_NOT_EXIST;
×
UNCOV
92
      goto _exit3;
×
93
    }
UNCOV
94
    char tbName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0};
×
UNCOV
95
    TAOS_CHECK_GOTO(metaGetTableNameByUid(pVnode, tbUid, tbName), NULL, _exit3);
×
UNCOV
96
    tstrncpy(metaRsp.tbName, varDataVal(tbName), TSDB_TABLE_NAME_LEN);
×
UNCOV
97
    TAOS_CHECK_GOTO(metaGetTableEntryByName(&mer1, varDataVal(tbName)), NULL, _exit3);
×
98
  } else if (metaGetTableEntryByName(&mer1, infoReq.tbName) < 0) {
1,245,304✔
99
    code = terrno;
9,111✔
100
    goto _exit3;
9,244✔
101
  }
102

103
  metaRsp.tableType = mer1.me.type;
1,236,468✔
104
  metaRsp.vgId = TD_VID(pVnode);
1,236,468✔
105
  metaRsp.tuid = mer1.me.uid;
1,236,468✔
106

107
  if (mer1.me.type == TSDB_SUPER_TABLE) {
1,236,468✔
108
    tstrncpy(metaRsp.stbName, mer1.me.name, TSDB_TABLE_NAME_LEN);
661,342✔
109
    schema = mer1.me.stbEntry.schemaRow;
661,342✔
110
    schemaTag = mer1.me.stbEntry.schemaTag;
661,342✔
111
    metaRsp.suid = mer1.me.uid;
661,342✔
112
  } else if (mer1.me.type == TSDB_CHILD_TABLE) {
575,126✔
113
    metaReaderDoInit(&mer2, pVnode->pMeta, META_READER_NOLOCK);
554,153✔
114
    if (metaReaderGetTableEntryByUid(&mer2, mer1.me.ctbEntry.suid) < 0) goto _exit2;
554,155!
115

116
    tstrncpy(metaRsp.stbName, mer2.me.name, TSDB_TABLE_NAME_LEN);
554,156✔
117
    metaRsp.suid = mer2.me.uid;
554,156✔
118
    schema = mer2.me.stbEntry.schemaRow;
554,156✔
119
    schemaTag = mer2.me.stbEntry.schemaTag;
554,156✔
120
  } else if (mer1.me.type == TSDB_NORMAL_TABLE) {
20,973!
121
    schema = mer1.me.ntbEntry.schemaRow;
20,973✔
122
  } else {
123
    vError("vnodeGetTableMeta get invalid table type:%d", mer1.me.type);
×
124
    goto _exit3;
×
125
  }
126

127
  metaRsp.numOfTags = schemaTag.nCols;
1,236,471✔
128
  metaRsp.numOfColumns = schema.nCols;
1,236,471✔
129
  metaRsp.precision = pVnode->config.tsdbCfg.precision;
1,236,471✔
130
  metaRsp.sversion = schema.version;
1,236,471✔
131
  metaRsp.tversion = schemaTag.version;
1,236,471✔
132
  metaRsp.pSchemas = (SSchema *)taosMemoryMalloc(sizeof(SSchema) * (metaRsp.numOfColumns + metaRsp.numOfTags));
1,236,471!
133
  metaRsp.pSchemaExt = (SSchemaExt *)taosMemoryCalloc(metaRsp.numOfColumns, sizeof(SSchemaExt));
1,236,256!
134
  if (NULL == metaRsp.pSchemas || NULL == metaRsp.pSchemaExt) {
1,236,035!
135
    code = terrno;
×
136
    goto _exit;
×
137
  }
138
  (void)memcpy(metaRsp.pSchemas, schema.pSchema, sizeof(SSchema) * schema.nCols);
1,236,070✔
139
  if (schemaTag.nCols) {
1,236,070✔
140
    (void)memcpy(metaRsp.pSchemas + schema.nCols, schemaTag.pSchema, sizeof(SSchema) * schemaTag.nCols);
1,214,538✔
141
  }
142
  if (metaRsp.pSchemaExt) {
1,236,070✔
143
    SMetaReader *pReader = mer1.me.type == TSDB_CHILD_TABLE ? &mer2 : &mer1;
1,235,579✔
144
    code = fillTableColCmpr(pReader, metaRsp.pSchemaExt, metaRsp.numOfColumns);
1,235,579✔
145
    if (code < 0) {
1,236,097!
146
      goto _exit;
×
147
    }
148
  } else {
149
    code = TSDB_CODE_OUT_OF_MEMORY;
491✔
150
    goto _exit;
491✔
151
  }
152

153
  // encode and send response
154
  rspLen = tSerializeSTableMetaRsp(NULL, 0, &metaRsp);
1,236,097✔
155
  if (rspLen < 0) {
1,236,018✔
156
    code = terrno;
251✔
157
    goto _exit;
×
158
  }
159

160
  if (direct) {
1,235,767✔
161
    pRsp = rpcMallocCont(rspLen);
215✔
162
  } else {
163
    pRsp = taosMemoryCalloc(1, rspLen);
1,235,552!
164
  }
165

166
  if (pRsp == NULL) {
1,235,540!
167
    code = terrno;
×
168
    goto _exit;
×
169
  }
170

171
  rspLen = tSerializeSTableMetaRsp(pRsp, rspLen, &metaRsp);
1,235,540✔
172
  if (rspLen < 0) {
1,236,223!
173
    code = terrno;
×
174
    goto _exit;
×
175
  }
176

177
_exit:
1,236,223✔
178
  taosMemoryFree(metaRsp.pSchemas);
1,236,714!
179
  taosMemoryFree(metaRsp.pSchemaExt);
1,236,235!
180
_exit2:
1,236,207✔
181
  metaReaderClear(&mer2);
1,236,207✔
182
_exit3:
1,245,294✔
183
  metaReaderClear(&mer1);
1,245,294✔
184
_exit4:
1,245,482✔
185
  rpcMsg.info = pMsg->info;
1,245,482✔
186
  rpcMsg.pCont = pRsp;
1,245,482✔
187
  rpcMsg.contLen = rspLen;
1,245,482✔
188
  rpcMsg.code = code;
1,245,482✔
189
  rpcMsg.msgType = pMsg->msgType;
1,245,482✔
190

191
  if (code) {
1,245,482✔
192
    qError("get table %s meta with %" PRIu8 " failed cause of %s", infoReq.tbName, infoReq.option, tstrerror(code));
9,244!
193
  }
194

195
  if (direct) {
1,245,411✔
196
    tmsgSendRsp(&rpcMsg);
1,771✔
197
  } else {
198
    *pMsg = rpcMsg;
1,243,640✔
199
  }
200

201
  return code;
1,245,329✔
202
}
203

204
int32_t vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
85✔
205
  STableCfgReq   cfgReq = {0};
85✔
206
  STableCfgRsp   cfgRsp = {0};
85✔
207
  SMetaReader    mer1 = {0};
85✔
208
  SMetaReader    mer2 = {0};
85✔
209
  char           tableFName[TSDB_TABLE_FNAME_LEN];
210
  SRpcMsg        rpcMsg = {0};
85✔
211
  int32_t        code = 0;
85✔
212
  int32_t        rspLen = 0;
85✔
213
  void          *pRsp = NULL;
85✔
214
  SSchemaWrapper schema = {0};
85✔
215
  SSchemaWrapper schemaTag = {0};
85✔
216

217
  // decode req
218
  if (tDeserializeSTableCfgReq(pMsg->pCont, pMsg->contLen, &cfgReq) != 0) {
85!
219
    code = terrno;
×
220
    goto _exit;
×
221
  }
222

223
  tstrncpy(cfgRsp.tbName, cfgReq.tbName, TSDB_TABLE_NAME_LEN);
85✔
224
  (void)memcpy(cfgRsp.dbFName, cfgReq.dbFName, sizeof(cfgRsp.dbFName));
85✔
225

226
  (void)tsnprintf(tableFName, TSDB_TABLE_FNAME_LEN, "%s.%s", cfgReq.dbFName, cfgReq.tbName);
85✔
227
  code = vnodeValidateTableHash(pVnode, tableFName);
85✔
228
  if (code) {
85!
229
    goto _exit;
×
230
  }
231

232
  // query meta
233
  metaReaderDoInit(&mer1, pVnode->pMeta, META_READER_LOCK);
85✔
234

235
  if (metaGetTableEntryByName(&mer1, cfgReq.tbName) < 0) {
85!
236
    code = terrno;
×
237
    goto _exit;
×
238
  }
239

240
  cfgRsp.tableType = mer1.me.type;
85✔
241

242
  if (mer1.me.type == TSDB_SUPER_TABLE) {
85!
243
    code = TSDB_CODE_VND_HASH_MISMATCH;
×
244
    goto _exit;
×
245
  } else if (mer1.me.type == TSDB_CHILD_TABLE) {
85✔
246
    metaReaderDoInit(&mer2, pVnode->pMeta, META_READER_NOLOCK);
68✔
247
    if (metaReaderGetTableEntryByUid(&mer2, mer1.me.ctbEntry.suid) < 0) goto _exit;
68!
248

249
    tstrncpy(cfgRsp.stbName, mer2.me.name, TSDB_TABLE_NAME_LEN);
68✔
250
    schema = mer2.me.stbEntry.schemaRow;
68✔
251
    schemaTag = mer2.me.stbEntry.schemaTag;
68✔
252
    cfgRsp.ttl = mer1.me.ctbEntry.ttlDays;
68✔
253
    cfgRsp.commentLen = mer1.me.ctbEntry.commentLen;
68✔
254
    if (mer1.me.ctbEntry.commentLen > 0) {
68!
255
      cfgRsp.pComment = taosStrdup(mer1.me.ctbEntry.comment);
×
256
      if (NULL == cfgRsp.pComment) {
×
257
        code = terrno;
×
258
        goto _exit;
×
259
      }
260
    }
261
    STag *pTag = (STag *)mer1.me.ctbEntry.pTags;
68✔
262
    cfgRsp.tagsLen = pTag->len;
68✔
263
    cfgRsp.pTags = taosMemoryMalloc(cfgRsp.tagsLen);
68!
264
    if (NULL == cfgRsp.pTags) {
68!
265
      code = terrno;
×
266
      goto _exit;
×
267
    }
268
    (void)memcpy(cfgRsp.pTags, pTag, cfgRsp.tagsLen);
68✔
269
  } else if (mer1.me.type == TSDB_NORMAL_TABLE) {
17!
270
    schema = mer1.me.ntbEntry.schemaRow;
17✔
271
    cfgRsp.ttl = mer1.me.ntbEntry.ttlDays;
17✔
272
    cfgRsp.commentLen = mer1.me.ntbEntry.commentLen;
17✔
273
    if (mer1.me.ntbEntry.commentLen > 0) {
17!
274
      cfgRsp.pComment = taosStrdup(mer1.me.ntbEntry.comment);
×
275
      if (NULL == cfgRsp.pComment) {
×
276
        code = terrno;
×
277
        goto _exit;
×
278
      }
279
    }
280
  } else {
281
    vError("vnodeGetTableCfg get invalid table type:%d", mer1.me.type);
×
282
    code = TSDB_CODE_APP_ERROR;
×
283
    goto _exit;
×
284
  }
285

286
  cfgRsp.numOfTags = schemaTag.nCols;
85✔
287
  cfgRsp.numOfColumns = schema.nCols;
85✔
288
  cfgRsp.pSchemas = (SSchema *)taosMemoryMalloc(sizeof(SSchema) * (cfgRsp.numOfColumns + cfgRsp.numOfTags));
85!
289
  cfgRsp.pSchemaExt = (SSchemaExt *)taosMemoryMalloc(cfgRsp.numOfColumns * sizeof(SSchemaExt));
85!
290

291
  if (NULL == cfgRsp.pSchemas || NULL == cfgRsp.pSchemaExt) {
85!
292
    code = terrno;
×
293
    goto _exit;
×
294
  }
295
  (void)memcpy(cfgRsp.pSchemas, schema.pSchema, sizeof(SSchema) * schema.nCols);
85✔
296
  if (schemaTag.nCols) {
85✔
297
    (void)memcpy(cfgRsp.pSchemas + schema.nCols, schemaTag.pSchema, sizeof(SSchema) * schemaTag.nCols);
68✔
298
  }
299

300
  // if (useCompress(cfgRsp.tableType)) {
301

302
  SMetaReader     *pReader = mer1.me.type == TSDB_CHILD_TABLE ? &mer2 : &mer1;
85✔
303
  SColCmprWrapper *pColCmpr = &pReader->me.colCmpr;
85✔
304

305
  for (int32_t i = 0; i < cfgRsp.numOfColumns; i++) {
737✔
306
    SColCmpr   *pCmpr = &pColCmpr->pColCmpr[i];
652✔
307
    SSchemaExt *pSchExt = cfgRsp.pSchemaExt + i;
652✔
308
    pSchExt->colId = pCmpr->id;
652✔
309
    pSchExt->compress = pCmpr->alg;
652✔
310
  }
311
  //}
312

313
  // encode and send response
314
  rspLen = tSerializeSTableCfgRsp(NULL, 0, &cfgRsp);
85✔
315
  if (rspLen < 0) {
85!
316
    code = terrno;
×
317
    goto _exit;
×
318
  }
319

320
  if (direct) {
85!
321
    pRsp = rpcMallocCont(rspLen);
×
322
  } else {
323
    pRsp = taosMemoryCalloc(1, rspLen);
85!
324
  }
325

326
  if (pRsp == NULL) {
85!
327
    code = terrno;
×
328
    goto _exit;
×
329
  }
330

331
  rspLen = tSerializeSTableCfgRsp(pRsp, rspLen, &cfgRsp);
85✔
332
  if (rspLen < 0) {
85!
333
    code = terrno;
×
334
    goto _exit;
×
335
  }
336

337
_exit:
85✔
338
  rpcMsg.info = pMsg->info;
85✔
339
  rpcMsg.pCont = pRsp;
85✔
340
  rpcMsg.contLen = rspLen;
85✔
341
  rpcMsg.code = code;
85✔
342
  rpcMsg.msgType = pMsg->msgType;
85✔
343

344
  if (code) {
85!
345
    qError("get table %s cfg failed cause of %s", cfgReq.tbName, tstrerror(code));
×
346
  }
347

348
  if (direct) {
85!
349
    tmsgSendRsp(&rpcMsg);
×
350
  } else {
351
    *pMsg = rpcMsg;
85✔
352
  }
353

354
  tFreeSTableCfgRsp(&cfgRsp);
85✔
355
  metaReaderClear(&mer2);
85✔
356
  metaReaderClear(&mer1);
85✔
357
  return code;
85✔
358
}
359

360
static FORCE_INLINE void vnodeFreeSBatchRspMsg(void *p) {
361
  if (NULL == p) {
362
    return;
363
  }
364

365
  SBatchRspMsg *pRsp = (SBatchRspMsg *)p;
366
  rpcFreeCont(pRsp->msg);
367
}
368

369
int32_t vnodeGetBatchMeta(SVnode *pVnode, SRpcMsg *pMsg) {
1,075,080✔
370
  int32_t      code = 0;
1,075,080✔
371
  int32_t      rspSize = 0;
1,075,080✔
372
  SBatchReq    batchReq = {0};
1,075,080✔
373
  SBatchMsg   *req = NULL;
1,075,080✔
374
  SBatchRspMsg rsp = {0};
1,075,080✔
375
  SBatchRsp    batchRsp = {0};
1,075,080✔
376
  SRpcMsg      reqMsg = *pMsg;
1,075,080✔
377
  SRpcMsg      rspMsg = {0};
1,075,080✔
378
  void        *pRsp = NULL;
1,075,080✔
379

380
  if (tDeserializeSBatchReq(pMsg->pCont, pMsg->contLen, &batchReq)) {
1,075,080!
381
    code = terrno;
×
382
    qError("tDeserializeSBatchReq failed");
×
383
    goto _exit;
×
384
  }
385

386
  int32_t msgNum = taosArrayGetSize(batchReq.pMsgs);
1,075,749✔
387
  if (msgNum >= MAX_META_MSG_IN_BATCH) {
1,074,992!
388
    code = TSDB_CODE_INVALID_MSG;
×
389
    qError("too many msgs %d in vnode batch meta req", msgNum);
×
390
    goto _exit;
×
391
  }
392

393
  batchRsp.pRsps = taosArrayInit(msgNum, sizeof(SBatchRspMsg));
1,074,992✔
394
  if (NULL == batchRsp.pRsps) {
1,075,746!
395
    code = terrno;
×
396
    qError("taosArrayInit %d SBatchRspMsg failed", msgNum);
×
397
    goto _exit;
×
398
  }
399

400
  for (int32_t i = 0; i < msgNum; ++i) {
2,324,106✔
401
    req = taosArrayGet(batchReq.pMsgs, i);
1,248,838✔
402
    if (req == NULL) {
1,248,216✔
403
      code = terrno;
82✔
404
      goto _exit;
×
405
    }
406

407
    reqMsg.msgType = req->msgType;
1,248,134✔
408
    reqMsg.pCont = req->msg;
1,248,134✔
409
    reqMsg.contLen = req->msgLen;
1,248,134✔
410

411
    switch (req->msgType) {
1,248,134!
412
      case TDMT_VND_TABLE_META:
1,242,645✔
413
        // error code has been set into reqMsg, no need to handle it here.
414
        if (TSDB_CODE_SUCCESS != vnodeGetTableMeta(pVnode, &reqMsg, false)) {
1,242,645✔
415
          qWarn("vnodeGetBatchMeta failed, msgType:%d", req->msgType);
7,688!
416
        }
417
        break;
1,243,340✔
UNCOV
418
      case TDMT_VND_TABLE_NAME:
×
419
        // error code has been set into reqMsg, no need to handle it here.
UNCOV
420
        if (TSDB_CODE_SUCCESS != vnodeGetTableMeta(pVnode, &reqMsg, false)) {
×
UNCOV
421
          qWarn("vnodeGetBatchName failed, msgType:%d", req->msgType);
×
422
        }
UNCOV
423
        break;
×
424
      case TDMT_VND_TABLE_CFG:
85✔
425
        // error code has been set into reqMsg, no need to handle it here.
426
        if (TSDB_CODE_SUCCESS != vnodeGetTableCfg(pVnode, &reqMsg, false)) {
85!
427
          qWarn("vnodeGetBatchMeta failed, msgType:%d", req->msgType);
×
428
        }
429
        break;
85✔
430
      case TDMT_VND_GET_STREAM_PROGRESS:
5,404✔
431
        // error code has been set into reqMsg, no need to handle it here.
432
        if (TSDB_CODE_SUCCESS != vnodeGetStreamProgress(pVnode, &reqMsg, false)) {
5,404!
433
          qWarn("vnodeGetBatchMeta failed, msgType:%d", req->msgType);
×
434
        }
435
        break;
5,404✔
436
      default:
×
437
        qError("invalid req msgType %d", req->msgType);
×
438
        reqMsg.code = TSDB_CODE_INVALID_MSG;
×
439
        reqMsg.pCont = NULL;
×
440
        reqMsg.contLen = 0;
×
441
        break;
×
442
    }
443

444
    rsp.msgIdx = req->msgIdx;
1,248,829✔
445
    rsp.reqType = reqMsg.msgType;
1,248,829✔
446
    rsp.msgLen = reqMsg.contLen;
1,248,829✔
447
    rsp.rspCode = reqMsg.code;
1,248,829✔
448
    rsp.msg = reqMsg.pCont;
1,248,829✔
449

450
    if (NULL == taosArrayPush(batchRsp.pRsps, &rsp)) {
2,497,179!
451
      qError("taosArrayPush failed");
×
452
      code = terrno;
×
453
      goto _exit;
×
454
    }
455
  }
456

457
  rspSize = tSerializeSBatchRsp(NULL, 0, &batchRsp);
1,075,268✔
458
  if (rspSize < 0) {
1,075,382!
459
    qError("tSerializeSBatchRsp failed");
×
460
    code = terrno;
×
461
    goto _exit;
×
462
  }
463
  pRsp = rpcMallocCont(rspSize);
1,075,382✔
464
  if (pRsp == NULL) {
1,075,409!
465
    qError("rpcMallocCont %d failed", rspSize);
×
466
    code = terrno;
×
467
    goto _exit;
×
468
  }
469
  if (tSerializeSBatchRsp(pRsp, rspSize, &batchRsp) < 0) {
1,075,409!
470
    qError("tSerializeSBatchRsp %d failed", rspSize);
×
471
    code = terrno;
×
472
    goto _exit;
×
473
  }
474

475
_exit:
1,075,840✔
476

477
  rspMsg.info = pMsg->info;
1,075,840✔
478
  rspMsg.pCont = pRsp;
1,075,840✔
479
  rspMsg.contLen = rspSize;
1,075,840✔
480
  rspMsg.code = code;
1,075,840✔
481
  rspMsg.msgType = pMsg->msgType;
1,075,840✔
482

483
  if (code) {
1,075,840!
484
    qError("vnd get batch meta failed cause of %s", tstrerror(code));
×
485
  }
486

487
  taosArrayDestroyEx(batchReq.pMsgs, tFreeSBatchReqMsg);
1,075,840✔
488
  taosArrayDestroyEx(batchRsp.pRsps, tFreeSBatchRspMsg);
1,075,479✔
489

490
  tmsgSendRsp(&rspMsg);
1,075,608✔
491

492
  return code;
1,075,448✔
493
}
494

495
int32_t vnodeGetLoad(SVnode *pVnode, SVnodeLoad *pLoad) {
986,050✔
496
  SSyncState state = syncGetState(pVnode->sync);
986,050✔
497

498
  pLoad->vgId = TD_VID(pVnode);
986,050✔
499
  pLoad->syncState = state.state;
986,050✔
500
  pLoad->syncRestore = state.restored;
986,050✔
501
  pLoad->syncTerm = state.term;
986,050✔
502
  pLoad->roleTimeMs = state.roleTimeMs;
986,050✔
503
  pLoad->startTimeMs = state.startTimeMs;
986,050✔
504
  pLoad->syncCanRead = state.canRead;
986,050✔
505
  pLoad->learnerProgress = state.progress;
986,050✔
506
  pLoad->cacheUsage = tsdbCacheGetUsage(pVnode);
986,050✔
507
  pLoad->numOfCachedTables = tsdbCacheGetElems(pVnode);
986,050✔
508
  pLoad->numOfTables = metaGetTbNum(pVnode->pMeta);
986,050✔
509
  pLoad->numOfTimeSeries = metaGetTimeSeriesNum(pVnode->pMeta, 1);
986,050✔
510
  pLoad->totalStorage = (int64_t)3 * 1073741824;
986,050✔
511
  pLoad->compStorage = (int64_t)2 * 1073741824;
986,050✔
512
  pLoad->pointsWritten = 100;
986,050✔
513
  pLoad->numOfSelectReqs = 1;
986,050✔
514
  pLoad->numOfInsertReqs = atomic_load_64(&pVnode->statis.nInsert);
986,050✔
515
  pLoad->numOfInsertSuccessReqs = atomic_load_64(&pVnode->statis.nInsertSuccess);
986,050✔
516
  pLoad->numOfBatchInsertReqs = atomic_load_64(&pVnode->statis.nBatchInsert);
986,050✔
517
  pLoad->numOfBatchInsertSuccessReqs = atomic_load_64(&pVnode->statis.nBatchInsertSuccess);
986,050✔
518
  return 0;
986,050✔
519
}
520

521
int32_t vnodeGetLoadLite(SVnode *pVnode, SVnodeLoadLite *pLoad) {
×
522
  SSyncState syncState = syncGetState(pVnode->sync);
×
523
  if (syncState.state == TAOS_SYNC_STATE_LEADER || syncState.state == TAOS_SYNC_STATE_ASSIGNED_LEADER) {
×
524
    pLoad->vgId = TD_VID(pVnode);
×
525
    pLoad->nTimeSeries = metaGetTimeSeriesNum(pVnode->pMeta, 1);
×
526
    return 0;
×
527
  }
528
  return -1;
×
529
}
530
/**
531
 * @brief Reset the statistics value by monitor interval
532
 *
533
 * @param pVnode
534
 * @param pLoad
535
 */
536
void vnodeResetLoad(SVnode *pVnode, SVnodeLoad *pLoad) {
32✔
537
  VNODE_GET_LOAD_RESET_VALS(pVnode->statis.nInsert, pLoad->numOfInsertReqs, 64, "nInsert");
32!
538
  VNODE_GET_LOAD_RESET_VALS(pVnode->statis.nInsertSuccess, pLoad->numOfInsertSuccessReqs, 64, "nInsertSuccess");
32!
539
  VNODE_GET_LOAD_RESET_VALS(pVnode->statis.nBatchInsert, pLoad->numOfBatchInsertReqs, 64, "nBatchInsert");
32!
540
  VNODE_GET_LOAD_RESET_VALS(pVnode->statis.nBatchInsertSuccess, pLoad->numOfBatchInsertSuccessReqs, 64,
32!
541
                            "nBatchInsertSuccess");
542
}
32✔
543

544
void vnodeGetInfo(void *pVnode, const char **dbname, int32_t *vgId, int64_t *numOfTables, int64_t *numOfNormalTables) {
917,185✔
545
  SVnode    *pVnodeObj = pVnode;
917,185✔
546
  SVnodeCfg *pConf = &pVnodeObj->config;
917,185✔
547

548
  if (dbname) {
917,185!
549
    *dbname = pConf->dbname;
918,110✔
550
  }
551

552
  if (vgId) {
917,185✔
553
    *vgId = TD_VID(pVnodeObj);
917,089✔
554
  }
555

556
  if (numOfTables) {
917,185!
557
    *numOfTables = pConf->vndStats.numOfNTables + pConf->vndStats.numOfCTables;
×
558
  }
559

560
  if (numOfNormalTables) {
917,185!
561
    *numOfNormalTables = pConf->vndStats.numOfNTables;
×
562
  }
563
}
917,185✔
564

565
int32_t vnodeGetTableList(void *pVnode, int8_t type, SArray *pList) {
×
566
  if (type == TSDB_SUPER_TABLE) {
×
567
    return vnodeGetStbIdList(pVnode, 0, pList);
×
568
  } else {
569
    return TSDB_CODE_INVALID_PARA;
×
570
  }
571
}
572

573
int32_t vnodeGetAllTableList(SVnode *pVnode, uint64_t uid, SArray *list) {
×
574
  int32_t      code = TSDB_CODE_SUCCESS;
×
575
  SMCtbCursor *pCur = metaOpenCtbCursor(pVnode, uid, 1);
×
576
  if (NULL == pCur) {
×
577
    qError("vnode get all table list failed");
×
578
    return terrno;
×
579
  }
580

581
  while (1) {
×
582
    tb_uid_t id = metaCtbCursorNext(pCur);
×
583
    if (id == 0) {
×
584
      break;
×
585
    }
586

587
    STableKeyInfo info = {uid = id};
×
588
    if (NULL == taosArrayPush(list, &info)) {
×
589
      qError("taosArrayPush failed");
×
590
      code = terrno;
×
591
      goto _exit;
×
592
    }
593
  }
594
_exit:
×
595
  metaCloseCtbCursor(pCur);
×
596
  return code;
×
597
}
598

599
int32_t vnodeGetCtbIdListByFilter(SVnode *pVnode, int64_t suid, SArray *list, bool (*filter)(void *arg), void *arg) {
×
600
  return 0;
×
601
}
602

603
int32_t vnodeGetCtbIdList(void *pVnode, int64_t suid, SArray *list) {
2,718,869✔
604
  int32_t      code = TSDB_CODE_SUCCESS;
2,718,869✔
605
  SVnode      *pVnodeObj = pVnode;
2,718,869✔
606
  SMCtbCursor *pCur = metaOpenCtbCursor(pVnodeObj, suid, 1);
2,718,869✔
607
  if (NULL == pCur) {
2,724,601!
608
    qError("vnode get all table list failed");
×
609
    return terrno;
×
610
  }
611

612
  while (1) {
9,221,975✔
613
    tb_uid_t id = metaCtbCursorNext(pCur);
11,946,576✔
614
    if (id == 0) {
11,939,027✔
615
      break;
2,726,941✔
616
    }
617

618
    if (NULL == taosArrayPush(list, &id)) {
9,221,975!
619
      qError("taosArrayPush failed");
×
620
      code = terrno;
×
621
      goto _exit;
×
622
    }
623
  }
624

625
_exit:
2,726,941✔
626
  metaCloseCtbCursor(pCur);
2,726,941✔
627
  return code;
2,726,251✔
628
}
629

630
int32_t vnodeGetStbIdList(SVnode *pVnode, int64_t suid, SArray *list) {
141,142✔
631
  int32_t      code = TSDB_CODE_SUCCESS;
141,142✔
632
  SMStbCursor *pCur = metaOpenStbCursor(pVnode->pMeta, suid);
141,142✔
633
  if (!pCur) {
141,142!
634
    return TSDB_CODE_OUT_OF_MEMORY;
×
635
  }
636

637
  while (1) {
120,350✔
638
    tb_uid_t id = metaStbCursorNext(pCur);
261,492✔
639
    if (id == 0) {
261,490✔
640
      break;
141,141✔
641
    }
642

643
    if (NULL == taosArrayPush(list, &id)) {
120,350!
644
      qError("taosArrayPush failed");
×
645
      code = terrno;
×
646
      goto _exit;
×
647
    }
648
  }
649

650
_exit:
141,141✔
651
  metaCloseStbCursor(pCur);
141,141✔
652
  return code;
141,142✔
653
}
654

655
int32_t vnodeGetStbIdListByFilter(SVnode *pVnode, int64_t suid, SArray *list, bool (*filter)(void *arg, void *arg1),
×
656
                                  void *arg) {
657
  int32_t      code = TSDB_CODE_SUCCESS;
×
658
  SMStbCursor *pCur = metaOpenStbCursor(pVnode->pMeta, suid);
×
659
  if (!pCur) {
×
660
    return terrno;
×
661
  }
662

663
  while (1) {
×
664
    tb_uid_t id = metaStbCursorNext(pCur);
×
665
    if (id == 0) {
×
666
      break;
×
667
    }
668

669
    if ((*filter) && (*filter)(arg, &id)) {
×
670
      continue;
×
671
    }
672

673
    if (NULL == taosArrayPush(list, &id)) {
×
674
      qError("taosArrayPush failed");
×
675
      code = terrno;
×
676
      goto _exit;
×
677
    }
678
  }
679

680
_exit:
×
681
  metaCloseStbCursor(pCur);
×
682
  return code;
×
683
}
684

685
int32_t vnodeGetCtbNum(SVnode *pVnode, int64_t suid, int64_t *num) {
24,116✔
686
  SMCtbCursor *pCur = metaOpenCtbCursor(pVnode, suid, 0);
24,116✔
687
  if (!pCur) {
24,123!
688
    return terrno;
×
689
  }
690

691
  *num = 0;
24,123✔
692
  while (1) {
33,693✔
693
    tb_uid_t id = metaCtbCursorNext(pCur);
57,816✔
694
    if (id == 0) {
57,816✔
695
      break;
24,123✔
696
    }
697

698
    ++(*num);
33,693✔
699
  }
700

701
  metaCloseCtbCursor(pCur);
24,123✔
702
  return TSDB_CODE_SUCCESS;
24,125✔
703
}
704

705
int32_t vnodeGetStbColumnNum(SVnode *pVnode, tb_uid_t suid, int *num) {
24,123✔
706
  SSchemaWrapper *pSW = metaGetTableSchema(pVnode->pMeta, suid, -1, 0, NULL);
24,123✔
707
  if (pSW) {
24,124!
708
    *num = pSW->nCols;
24,124!
709
    tDeleteSchemaWrapper(pSW);
710
  } else {
711
    *num = 2;
×
712
  }
713

714
  return TSDB_CODE_SUCCESS;
24,125✔
715
}
716

717
#ifdef TD_ENTERPRISE
718
const char *tkLogStb[] = {"cluster_info",
719
                          "data_dir",
720
                          "dnodes_info",
721
                          "d_info",
722
                          "grants_info",
723
                          "keeper_monitor",
724
                          "logs",
725
                          "log_dir",
726
                          "log_summary",
727
                          "m_info",
728
                          "taosadapter_restful_http_request_fail",
729
                          "taosadapter_restful_http_request_in_flight",
730
                          "taosadapter_restful_http_request_summary_milliseconds",
731
                          "taosadapter_restful_http_request_total",
732
                          "taosadapter_system_cpu_percent",
733
                          "taosadapter_system_mem_percent",
734
                          "temp_dir",
735
                          "vgroups_info",
736
                          "vnodes_role"};
737
const char *tkAuditStb[] = {"operations"};
738
const int   tkLogStbNum = ARRAY_SIZE(tkLogStb);
739
const int   tkAuditStbNum = ARRAY_SIZE(tkAuditStb);
740

741
// exclude stbs of taoskeeper log
742
static int32_t vnodeGetTimeSeriesBlackList(SVnode *pVnode, int32_t *tbSize) {
141,125✔
743
  int32_t      code = TSDB_CODE_SUCCESS;
141,125✔
744
  int32_t      tbNum = 0;
141,125✔
745
  const char **pTbArr = NULL;
141,125✔
746
  const char  *dbName = NULL;
141,125✔
747
  *tbSize = 0;
141,125✔
748

749
  if (!(dbName = strchr(pVnode->config.dbname, '.'))) return 0;
141,125!
750
  if (0 == strncmp(++dbName, "log", TSDB_DB_NAME_LEN)) {
141,125!
751
    tbNum = tkLogStbNum;
×
752
    pTbArr = (const char **)&tkLogStb;
×
753
  } else if (0 == strncmp(dbName, "audit", TSDB_DB_NAME_LEN)) {
141,125!
754
    tbNum = tkAuditStbNum;
×
755
    pTbArr = (const char **)&tkAuditStb;
×
756
  }
757
  if (tbNum && pTbArr) {
141,125!
758
    *tbSize = metaSizeOfTbFilterCache(pVnode->pMeta, 0);
×
759
    if (*tbSize < tbNum) {
×
760
      for (int32_t i = 0; i < tbNum; ++i) {
×
761
        tb_uid_t suid = metaGetTableEntryUidByName(pVnode->pMeta, pTbArr[i]);
×
762
        if (suid != 0) {
×
763
          code = metaPutTbToFilterCache(pVnode->pMeta, &suid, 0);
×
764
          if (TSDB_CODE_SUCCESS != code) {
×
765
            return code;
×
766
          }
767
        }
768
      }
769
      *tbSize = metaSizeOfTbFilterCache(pVnode->pMeta, 0);
×
770
    }
771
  }
772

773
  return code;
141,125✔
774
}
775
#endif
776

777
static bool vnodeTimeSeriesFilter(void *arg1, void *arg2) {
×
778
  SVnode *pVnode = (SVnode *)arg1;
×
779

780
  if (metaTbInFilterCache(pVnode->pMeta, arg2, 0)) {
×
781
    return true;
×
782
  }
783
  return false;
×
784
}
785

786
int32_t vnodeGetTimeSeriesNum(SVnode *pVnode, int64_t *num) {
141,125✔
787
  SArray *suidList = NULL;
141,125✔
788

789
  if (!(suidList = taosArrayInit(1, sizeof(tb_uid_t)))) {
141,125!
790
    return terrno;
×
791
  }
792

793
  int32_t tbFilterSize = 0;
141,125✔
794
  int32_t code = TSDB_CODE_SUCCESS;
141,125✔
795
#ifdef TD_ENTERPRISE
796
  code = vnodeGetTimeSeriesBlackList(pVnode, &tbFilterSize);
141,125✔
797
  if (TSDB_CODE_SUCCESS != code) {
141,125!
798
    goto _exit;
×
799
  }
800
#endif
801

802
  if ((!tbFilterSize && vnodeGetStbIdList(pVnode, 0, suidList) < 0) ||
141,125!
803
      (tbFilterSize && vnodeGetStbIdListByFilter(pVnode, 0, suidList, vnodeTimeSeriesFilter, pVnode) < 0)) {
141,125!
804
    qError("vgId:%d, failed to get stb id list error: %s", TD_VID(pVnode), terrstr());
×
805
    taosArrayDestroy(suidList);
×
806
    return terrno;
×
807
  }
808

809
  *num = 0;
141,125✔
810
  int64_t arrSize = taosArrayGetSize(suidList);
141,125✔
811
  for (int64_t i = 0; i < arrSize; ++i) {
261,475✔
812
    tb_uid_t suid = *(tb_uid_t *)taosArrayGet(suidList, i);
120,348✔
813

814
    int64_t ctbNum = 0;
120,348✔
815
    int32_t numOfCols = 0;
120,348✔
816
    code = metaGetStbStats(pVnode, suid, &ctbNum, &numOfCols);
120,348✔
817
    if (TSDB_CODE_SUCCESS != code) {
120,350!
818
      goto _exit;
×
819
    }
820
    *num += ctbNum * (numOfCols - 1);
120,350✔
821
  }
822

823
_exit:
141,127✔
824
  taosArrayDestroy(suidList);
141,127✔
825
  return TSDB_CODE_SUCCESS;
141,125✔
826
}
827

828
int32_t vnodeGetAllCtbNum(SVnode *pVnode, int64_t *num) {
×
829
  SMStbCursor *pCur = metaOpenStbCursor(pVnode->pMeta, 0);
×
830
  if (!pCur) {
×
831
    return terrno;
×
832
  }
833

834
  *num = 0;
×
835
  while (1) {
×
836
    tb_uid_t id = metaStbCursorNext(pCur);
×
837
    if (id == 0) {
×
838
      break;
×
839
    }
840

841
    int64_t ctbNum = 0;
×
842
    int32_t code = vnodeGetCtbNum(pVnode, id, &ctbNum);
×
843
    if (TSDB_CODE_SUCCESS != code) {
×
844
      metaCloseStbCursor(pCur);
×
845
      return code;
×
846
    }
847

848
    *num += ctbNum;
×
849
  }
850

851
  metaCloseStbCursor(pCur);
×
852
  return TSDB_CODE_SUCCESS;
×
853
}
854

855
void *vnodeGetIdx(void *pVnode) {
52,654✔
856
  if (pVnode == NULL) {
52,654!
857
    return NULL;
×
858
  }
859

860
  return metaGetIdx(((SVnode *)pVnode)->pMeta);
52,654✔
861
}
862

863
void *vnodeGetIvtIdx(void *pVnode) {
52,553✔
864
  if (pVnode == NULL) {
52,553!
865
    return NULL;
×
866
  }
867
  return metaGetIvtIdx(((SVnode *)pVnode)->pMeta);
52,553✔
868
}
869

870
int32_t vnodeGetTableSchema(void *pVnode, int64_t uid, STSchema **pSchema, int64_t *suid) {
103✔
871
  return tsdbGetTableSchema(((SVnode *)pVnode)->pMeta, uid, pSchema, suid);
103✔
872
}
873

874
int32_t vnodeGetDBSize(void *pVnode, SDbSizeStatisInfo *pInfo) {
22✔
875
  SVnode *pVnodeObj = pVnode;
22✔
876
  if (pVnodeObj == NULL) {
22!
877
    return TSDB_CODE_VND_NOT_EXIST;
×
878
  }
879
  int32_t code = 0;
22✔
880
  char    path[TSDB_FILENAME_LEN] = {0};
22✔
881

882
  char   *dirName[] = {VNODE_TSDB_DIR, VNODE_WAL_DIR, VNODE_META_DIR, VNODE_TSDB_CACHE_DIR};
22✔
883
  int64_t dirSize[4];
884

885
  vnodeGetPrimaryDir(pVnodeObj->path, pVnodeObj->diskPrimary, pVnodeObj->pTfs, path, TSDB_FILENAME_LEN);
22✔
886
  int32_t offset = strlen(path);
22✔
887

888
  for (int i = 0; i < sizeof(dirName) / sizeof(dirName[0]); i++) {
110✔
889
    int64_t size = {0};
88✔
890
    (void)snprintf(path + offset, TSDB_FILENAME_LEN, "%s%s", TD_DIRSEP, dirName[i]);
88✔
891
    code = taosGetDirSize(path, &size);
88✔
892
    if (code != 0) {
88!
893
      return code;
×
894
    }
895
    path[offset] = 0;
88✔
896
    dirSize[i] = size;
88✔
897
  }
898

899
  pInfo->l1Size = dirSize[0] - dirSize[3];
22✔
900
  pInfo->walSize = dirSize[1];
22✔
901
  pInfo->metaSize = dirSize[2];
22✔
902
  pInfo->cacheSize = dirSize[3];
22✔
903

904
  code = tsdbGetS3Size(pVnodeObj->pTsdb, &pInfo->s3Size);
22✔
905

906
  return code;
22✔
907
}
908

909
int32_t vnodeGetStreamProgress(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
5,404✔
910
  int32_t            code = 0;
5,404✔
911
  SStreamProgressReq req;
912
  SStreamProgressRsp rsp = {0};
5,404✔
913
  SRpcMsg            rpcMsg = {.info = pMsg->info, .code = 0};
5,404✔
914
  char              *buf = NULL;
5,404✔
915
  int32_t            rspLen = 0;
5,404✔
916
  code = tDeserializeStreamProgressReq(pMsg->pCont, pMsg->contLen, &req);
5,404✔
917

918
  if (code == TSDB_CODE_SUCCESS) {
5,404!
919
    rsp.fetchIdx = req.fetchIdx;
5,404✔
920
    rsp.subFetchIdx = req.subFetchIdx;
5,404✔
921
    rsp.vgId = req.vgId;
5,404✔
922
    rsp.streamId = req.streamId;
5,404✔
923
    rspLen = tSerializeStreamProgressRsp(0, 0, &rsp);
5,404✔
924
    if (rspLen < 0) {
5,404!
925
      code = terrno;
×
926
      goto _OVER;
×
927
    }
928
    if (direct) {
5,404!
929
      buf = rpcMallocCont(rspLen);
×
930
    } else {
931
      buf = taosMemoryCalloc(1, rspLen);
5,404!
932
    }
933
    if (!buf) {
5,404!
934
      code = terrno;
×
935
      goto _OVER;
×
936
    }
937
  }
938

939
  if (code == TSDB_CODE_SUCCESS) {
5,404!
940
    code = tqGetStreamExecInfo(pVnode, req.streamId, &rsp.progressDelay, &rsp.fillHisFinished);
5,404✔
941
  }
942
  if (code == TSDB_CODE_SUCCESS) {
5,404!
943
    rspLen = tSerializeStreamProgressRsp(buf, rspLen, &rsp);
5,404✔
944
    if (rspLen < 0) {
5,404!
945
      code = terrno;
×
946
      goto _OVER;
×
947
    }
948
    rpcMsg.pCont = buf;
5,404✔
949
    buf = NULL;
5,404✔
950
    rpcMsg.contLen = rspLen;
5,404✔
951
    rpcMsg.code = code;
5,404✔
952
    rpcMsg.msgType = pMsg->msgType;
5,404✔
953
    if (direct) {
5,404!
954
      tmsgSendRsp(&rpcMsg);
×
955
    } else {
956
      *pMsg = rpcMsg;
5,404✔
957
    }
958
  }
959

960
_OVER:
×
961
  if (buf) {
5,404!
962
    taosMemoryFree(buf);
×
963
  }
964
  return code;
5,404✔
965
}
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