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

taosdata / TDengine / #3584

17 Jan 2025 07:28AM UTC coverage: 63.756% (-0.1%) from 63.876%
#3584

push

travis-ci

web-flow
Merge pull request #29594 from taosdata/fix/insert-when-2-replicas

fix/insert-when-2-replicas

141233 of 284535 branches covered (49.64%)

Branch coverage included in aggregate %.

0 of 2 new or added lines in 1 file covered. (0.0%)

684 existing lines in 111 files now uncovered.

219774 of 281695 relevant lines covered (78.02%)

18696822.13 hits per line

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

57.14
/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) {
12,081✔
28
  return qWorkerInit(NODE_TYPE_VNODE, TD_VID(pVnode), (void **)&pVnode->pQuery, &pVnode->msgCb);
12,081✔
29
}
30

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

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

35
int32_t fillTableColCmpr(SMetaReader *reader, SSchemaExt *pExt, int32_t numOfCol) {
1,180,404✔
36
  int8_t tblType = reader->me.type;
1,180,404✔
37
  if (useCompress(tblType)) {
1,180,404✔
38
    SColCmprWrapper *p = &(reader->me.colCmpr);
1,180,452✔
39
    if (numOfCol != p->nCols) {
1,180,452!
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++) {
30,116,228✔
44
      SColCmpr *pCmpr = &p->pColCmpr[i];
28,935,776✔
45
      pExt[i].colId = pCmpr->id;
28,935,776✔
46
      pExt[i].compress = pCmpr->alg;
28,935,776✔
47
    }
48
  }
49
  return 0;
1,180,464✔
50
}
51

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

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

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

77
  if (!reqTbUid) {
1,192,818✔
78
    (void)tsnprintf(tableFName, TSDB_TABLE_FNAME_LEN, "%s.%s", infoReq.dbFName, infoReq.tbName);
1,191,379✔
79
    code = vnodeValidateTableHash(pVnode, tableFName);
1,192,195✔
80
    if (code) {
1,192,151!
81
      goto _exit4;
×
82
    }
83
  }
84

85
  // query meta
86
  metaReaderDoInit(&mer1, pVnode->pMeta, META_READER_LOCK);
1,193,590✔
87
  if (reqTbUid) {
1,192,704✔
88
    errno = 0;
525✔
89
    uint64_t tbUid = taosStr2UInt64(infoReq.tbName, NULL, 10);
525✔
90
    if (errno == ERANGE || tbUid == 0) {
526!
91
      code = TSDB_CODE_TDB_TABLE_NOT_EXIST;
×
92
      goto _exit3;
123✔
93
    }
94
    SMetaReader mr3 = {0};
526✔
95
    metaReaderDoInit(&mr3, ((SVnode *)pVnode)->pMeta, META_READER_NOLOCK);
526✔
96
    if ((code = metaReaderGetTableEntryByUid(&mr3, tbUid)) < 0) {
526✔
97
      metaReaderClear(&mr3);
123✔
98
      TAOS_CHECK_GOTO(code, NULL, _exit3);
123!
99
    }
100
    tstrncpy(metaRsp.tbName, mr3.me.name, TSDB_TABLE_NAME_LEN);
402✔
101
    metaReaderClear(&mr3);
402✔
102
    TAOS_CHECK_GOTO(metaGetTableEntryByName(&mer1, metaRsp.tbName), NULL, _exit3);
403!
103
  } else if (metaGetTableEntryByName(&mer1, infoReq.tbName) < 0) {
1,192,179✔
104
    code = terrno;
11,894✔
105
    goto _exit3;
12,053✔
106
  }
107

108
  metaRsp.tableType = mer1.me.type;
1,180,822✔
109
  metaRsp.vgId = TD_VID(pVnode);
1,180,822✔
110
  metaRsp.tuid = mer1.me.uid;
1,180,822✔
111

112
  if (mer1.me.type == TSDB_SUPER_TABLE) {
1,180,822✔
113
    tstrncpy(metaRsp.stbName, mer1.me.name, TSDB_TABLE_NAME_LEN);
629,777✔
114
    schema = mer1.me.stbEntry.schemaRow;
629,777✔
115
    schemaTag = mer1.me.stbEntry.schemaTag;
629,777✔
116
    metaRsp.suid = mer1.me.uid;
629,777✔
117
  } else if (mer1.me.type == TSDB_CHILD_TABLE) {
551,045✔
118
    metaReaderDoInit(&mer2, pVnode->pMeta, META_READER_NOLOCK);
527,492✔
119
    if (metaReaderGetTableEntryByUid(&mer2, mer1.me.ctbEntry.suid) < 0) goto _exit2;
527,493!
120

121
    tstrncpy(metaRsp.stbName, mer2.me.name, TSDB_TABLE_NAME_LEN);
527,496✔
122
    metaRsp.suid = mer2.me.uid;
527,496✔
123
    schema = mer2.me.stbEntry.schemaRow;
527,496✔
124
    schemaTag = mer2.me.stbEntry.schemaTag;
527,496✔
125
  } else if (mer1.me.type == TSDB_NORMAL_TABLE) {
23,553!
126
    schema = mer1.me.ntbEntry.schemaRow;
23,553✔
127
  } else {
128
    vError("vnodeGetTableMeta get invalid table type:%d", mer1.me.type);
×
129
    goto _exit3;
×
130
  }
131

132
  metaRsp.numOfTags = schemaTag.nCols;
1,180,826✔
133
  metaRsp.numOfColumns = schema.nCols;
1,180,826✔
134
  metaRsp.precision = pVnode->config.tsdbCfg.precision;
1,180,826✔
135
  metaRsp.sversion = schema.version;
1,180,826✔
136
  metaRsp.tversion = schemaTag.version;
1,180,826✔
137
  metaRsp.pSchemas = (SSchema *)taosMemoryMalloc(sizeof(SSchema) * (metaRsp.numOfColumns + metaRsp.numOfTags));
1,180,826!
138
  metaRsp.pSchemaExt = (SSchemaExt *)taosMemoryCalloc(metaRsp.numOfColumns, sizeof(SSchemaExt));
1,180,691!
139
  if (NULL == metaRsp.pSchemas || NULL == metaRsp.pSchemaExt) {
1,180,543!
140
    code = terrno;
×
141
    goto _exit;
×
142
  }
143
  (void)memcpy(metaRsp.pSchemas, schema.pSchema, sizeof(SSchema) * schema.nCols);
1,180,572✔
144
  if (schemaTag.nCols) {
1,180,572✔
145
    (void)memcpy(metaRsp.pSchemas + schema.nCols, schemaTag.pSchema, sizeof(SSchema) * schemaTag.nCols);
1,156,735✔
146
  }
147
  if (metaRsp.pSchemaExt) {
1,180,572✔
148
    SMetaReader *pReader = mer1.me.type == TSDB_CHILD_TABLE ? &mer2 : &mer1;
1,180,262✔
149
    code = fillTableColCmpr(pReader, metaRsp.pSchemaExt, metaRsp.numOfColumns);
1,180,262✔
150
    if (code < 0) {
1,180,493!
151
      goto _exit;
×
152
    }
153
  } else {
154
    code = TSDB_CODE_OUT_OF_MEMORY;
310✔
155
    goto _exit;
310✔
156
  }
157

158
  // encode and send response
159
  rspLen = tSerializeSTableMetaRsp(NULL, 0, &metaRsp);
1,180,493✔
160
  if (rspLen < 0) {
1,180,325!
161
    code = terrno;
×
162
    goto _exit;
×
163
  }
164

165
  if (direct) {
1,180,380✔
166
    pRsp = rpcMallocCont(rspLen);
245✔
167
  } else {
168
    pRsp = taosMemoryCalloc(1, rspLen);
1,180,135!
169
  }
170

171
  if (pRsp == NULL) {
1,179,962!
172
    code = terrno;
×
173
    goto _exit;
×
174
  }
175

176
  rspLen = tSerializeSTableMetaRsp(pRsp, rspLen, &metaRsp);
1,179,962✔
177
  if (rspLen < 0) {
1,180,614!
178
    code = terrno;
×
179
    goto _exit;
×
180
  }
181

182
_exit:
1,180,614✔
183
  taosMemoryFree(metaRsp.pSchemas);
1,180,924!
184
  taosMemoryFree(metaRsp.pSchemaExt);
1,180,502!
185
_exit2:
1,180,681✔
186
  metaReaderClear(&mer2);
1,180,681✔
187
_exit3:
1,192,699✔
188
  metaReaderClear(&mer1);
1,192,699✔
189
_exit4:
1,192,786✔
190
  rpcMsg.info = pMsg->info;
1,192,786✔
191
  rpcMsg.pCont = pRsp;
1,192,786✔
192
  rpcMsg.contLen = rspLen;
1,192,786✔
193
  rpcMsg.code = code;
1,192,786✔
194
  rpcMsg.msgType = pMsg->msgType;
1,192,786✔
195

196
  if (code) {
1,192,786✔
197
    qError("get table %s meta with %" PRIu8 " failed cause of %s", infoReq.tbName, infoReq.option, tstrerror(code));
12,176!
198
  }
199

200
  if (direct) {
1,192,722✔
201
    tmsgSendRsp(&rpcMsg);
2,066✔
202
  } else {
203
    *pMsg = rpcMsg;
1,190,656✔
204
  }
205

206
  return code;
1,192,565✔
207
}
208

209
int32_t vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
86✔
210
  STableCfgReq   cfgReq = {0};
86✔
211
  STableCfgRsp   cfgRsp = {0};
86✔
212
  SMetaReader    mer1 = {0};
86✔
213
  SMetaReader    mer2 = {0};
86✔
214
  char           tableFName[TSDB_TABLE_FNAME_LEN];
215
  SRpcMsg        rpcMsg = {0};
86✔
216
  int32_t        code = 0;
86✔
217
  int32_t        rspLen = 0;
86✔
218
  void          *pRsp = NULL;
86✔
219
  SSchemaWrapper schema = {0};
86✔
220
  SSchemaWrapper schemaTag = {0};
86✔
221

222
  // decode req
223
  if (tDeserializeSTableCfgReq(pMsg->pCont, pMsg->contLen, &cfgReq) != 0) {
86!
224
    code = terrno;
×
225
    goto _exit;
×
226
  }
227

228
  tstrncpy(cfgRsp.tbName, cfgReq.tbName, TSDB_TABLE_NAME_LEN);
86✔
229
  (void)memcpy(cfgRsp.dbFName, cfgReq.dbFName, sizeof(cfgRsp.dbFName));
86✔
230

231
  (void)tsnprintf(tableFName, TSDB_TABLE_FNAME_LEN, "%s.%s", cfgReq.dbFName, cfgReq.tbName);
86✔
232
  code = vnodeValidateTableHash(pVnode, tableFName);
86✔
233
  if (code) {
86!
234
    goto _exit;
×
235
  }
236

237
  // query meta
238
  metaReaderDoInit(&mer1, pVnode->pMeta, META_READER_LOCK);
86✔
239

240
  if (metaGetTableEntryByName(&mer1, cfgReq.tbName) < 0) {
86!
241
    code = terrno;
×
242
    goto _exit;
×
243
  }
244

245
  cfgRsp.tableType = mer1.me.type;
86✔
246

247
  if (mer1.me.type == TSDB_SUPER_TABLE) {
86!
248
    code = TSDB_CODE_VND_HASH_MISMATCH;
×
249
    goto _exit;
×
250
  } else if (mer1.me.type == TSDB_CHILD_TABLE) {
86✔
251
    metaReaderDoInit(&mer2, pVnode->pMeta, META_READER_NOLOCK);
69✔
252
    if (metaReaderGetTableEntryByUid(&mer2, mer1.me.ctbEntry.suid) < 0) goto _exit;
69!
253

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

291
  cfgRsp.numOfTags = schemaTag.nCols;
86✔
292
  cfgRsp.numOfColumns = schema.nCols;
86✔
293
  cfgRsp.pSchemas = (SSchema *)taosMemoryMalloc(sizeof(SSchema) * (cfgRsp.numOfColumns + cfgRsp.numOfTags));
86!
294
  cfgRsp.pSchemaExt = (SSchemaExt *)taosMemoryMalloc(cfgRsp.numOfColumns * sizeof(SSchemaExt));
86!
295

296
  if (NULL == cfgRsp.pSchemas || NULL == cfgRsp.pSchemaExt) {
86!
297
    code = terrno;
×
298
    goto _exit;
×
299
  }
300
  (void)memcpy(cfgRsp.pSchemas, schema.pSchema, sizeof(SSchema) * schema.nCols);
86✔
301
  if (schemaTag.nCols) {
86✔
302
    (void)memcpy(cfgRsp.pSchemas + schema.nCols, schemaTag.pSchema, sizeof(SSchema) * schemaTag.nCols);
69✔
303
  }
304

305
  // if (useCompress(cfgRsp.tableType)) {
306

307
  SMetaReader     *pReader = mer1.me.type == TSDB_CHILD_TABLE ? &mer2 : &mer1;
86✔
308
  SColCmprWrapper *pColCmpr = &pReader->me.colCmpr;
86✔
309

310
  for (int32_t i = 0; i < cfgRsp.numOfColumns; i++) {
743✔
311
    SColCmpr   *pCmpr = &pColCmpr->pColCmpr[i];
657✔
312
    SSchemaExt *pSchExt = cfgRsp.pSchemaExt + i;
657✔
313
    pSchExt->colId = pCmpr->id;
657✔
314
    pSchExt->compress = pCmpr->alg;
657✔
315
  }
316
  //}
317

318
  // encode and send response
319
  rspLen = tSerializeSTableCfgRsp(NULL, 0, &cfgRsp);
86✔
320
  if (rspLen < 0) {
86!
321
    code = terrno;
×
322
    goto _exit;
×
323
  }
324

325
  if (direct) {
86!
326
    pRsp = rpcMallocCont(rspLen);
×
327
  } else {
328
    pRsp = taosMemoryCalloc(1, rspLen);
86!
329
  }
330

331
  if (pRsp == NULL) {
86!
332
    code = terrno;
×
333
    goto _exit;
×
334
  }
335

336
  rspLen = tSerializeSTableCfgRsp(pRsp, rspLen, &cfgRsp);
86✔
337
  if (rspLen < 0) {
86!
338
    code = terrno;
×
339
    goto _exit;
×
340
  }
341

342
_exit:
86✔
343
  rpcMsg.info = pMsg->info;
86✔
344
  rpcMsg.pCont = pRsp;
86✔
345
  rpcMsg.contLen = rspLen;
86✔
346
  rpcMsg.code = code;
86✔
347
  rpcMsg.msgType = pMsg->msgType;
86✔
348

349
  if (code) {
86!
350
    qError("get table %s cfg failed cause of %s", cfgReq.tbName, tstrerror(code));
×
351
  }
352

353
  if (direct) {
86!
354
    tmsgSendRsp(&rpcMsg);
×
355
  } else {
356
    *pMsg = rpcMsg;
86✔
357
  }
358

359
  tFreeSTableCfgRsp(&cfgRsp);
86✔
360
  metaReaderClear(&mer2);
86✔
361
  metaReaderClear(&mer1);
86✔
362
  return code;
86✔
363
}
364

365
static FORCE_INLINE void vnodeFreeSBatchRspMsg(void *p) {
366
  if (NULL == p) {
367
    return;
368
  }
369

370
  SBatchRspMsg *pRsp = (SBatchRspMsg *)p;
371
  rpcFreeCont(pRsp->msg);
372
}
373

374
int32_t vnodeGetBatchMeta(SVnode *pVnode, SRpcMsg *pMsg) {
1,007,089✔
375
  int32_t      code = 0;
1,007,089✔
376
  int32_t      rspSize = 0;
1,007,089✔
377
  SBatchReq    batchReq = {0};
1,007,089✔
378
  SBatchMsg   *req = NULL;
1,007,089✔
379
  SBatchRspMsg rsp = {0};
1,007,089✔
380
  SBatchRsp    batchRsp = {0};
1,007,089✔
381
  SRpcMsg      reqMsg = *pMsg;
1,007,089✔
382
  SRpcMsg      rspMsg = {0};
1,007,089✔
383
  void        *pRsp = NULL;
1,007,089✔
384

385
  if (tDeserializeSBatchReq(pMsg->pCont, pMsg->contLen, &batchReq)) {
1,007,089!
386
    code = terrno;
×
387
    qError("tDeserializeSBatchReq failed");
×
388
    goto _exit;
×
389
  }
390

391
  int32_t msgNum = taosArrayGetSize(batchReq.pMsgs);
1,007,537✔
392
  if (msgNum >= MAX_META_MSG_IN_BATCH) {
1,006,946!
393
    code = TSDB_CODE_INVALID_MSG;
×
394
    qError("too many msgs %d in vnode batch meta req", msgNum);
×
395
    goto _exit;
×
396
  }
397

398
  batchRsp.pRsps = taosArrayInit(msgNum, sizeof(SBatchRspMsg));
1,006,946✔
399
  if (NULL == batchRsp.pRsps) {
1,007,655!
UNCOV
400
    code = terrno;
×
401
    qError("taosArrayInit %d SBatchRspMsg failed", msgNum);
×
402
    goto _exit;
×
403
  }
404

405
  for (int32_t i = 0; i < msgNum; ++i) {
2,203,621✔
406
    req = taosArrayGet(batchReq.pMsgs, i);
1,196,436✔
407
    if (req == NULL) {
1,195,900✔
408
      code = terrno;
74✔
409
      goto _exit;
×
410
    }
411

412
    reqMsg.msgType = req->msgType;
1,195,826✔
413
    reqMsg.pCont = req->msg;
1,195,826✔
414
    reqMsg.contLen = req->msgLen;
1,195,826✔
415

416
    switch (req->msgType) {
1,195,826!
417
      case TDMT_VND_TABLE_META:
1,189,268✔
418
        // error code has been set into reqMsg, no need to handle it here.
419
        if (TSDB_CODE_SUCCESS != vnodeGetTableMeta(pVnode, &reqMsg, false)) {
1,189,268✔
420
          qWarn("vnodeGetBatchMeta failed, msgType:%d", req->msgType);
10,232!
421
        }
422
        break;
1,189,859✔
423
      case TDMT_VND_TABLE_NAME:
525✔
424
        // error code has been set into reqMsg, no need to handle it here.
425
        if (TSDB_CODE_SUCCESS != vnodeGetTableMeta(pVnode, &reqMsg, false)) {
525✔
426
          qWarn("vnodeGetBatchName failed, msgType:%d", req->msgType);
123!
427
        }
428
        break;
524✔
429
      case TDMT_VND_TABLE_CFG:
86✔
430
        // error code has been set into reqMsg, no need to handle it here.
431
        if (TSDB_CODE_SUCCESS != vnodeGetTableCfg(pVnode, &reqMsg, false)) {
86!
432
          qWarn("vnodeGetBatchMeta failed, msgType:%d", req->msgType);
×
433
        }
434
        break;
86✔
435
      case TDMT_VND_GET_STREAM_PROGRESS:
5,947✔
436
        // error code has been set into reqMsg, no need to handle it here.
437
        if (TSDB_CODE_SUCCESS != vnodeGetStreamProgress(pVnode, &reqMsg, false)) {
5,947!
438
          qWarn("vnodeGetBatchMeta failed, msgType:%d", req->msgType);
×
439
        }
440
        break;
5,948✔
441
      default:
×
442
        qError("invalid req msgType %d", req->msgType);
×
443
        reqMsg.code = TSDB_CODE_INVALID_MSG;
×
444
        reqMsg.pCont = NULL;
×
445
        reqMsg.contLen = 0;
×
446
        break;
×
447
    }
448

449
    rsp.msgIdx = req->msgIdx;
1,196,417✔
450
    rsp.reqType = reqMsg.msgType;
1,196,417✔
451
    rsp.msgLen = reqMsg.contLen;
1,196,417✔
452
    rsp.rspCode = reqMsg.code;
1,196,417✔
453
    rsp.msg = reqMsg.pCont;
1,196,417✔
454

455
    if (NULL == taosArrayPush(batchRsp.pRsps, &rsp)) {
2,392,374!
456
      qError("taosArrayPush failed");
×
457
      code = terrno;
×
458
      goto _exit;
×
459
    }
460
  }
461

462
  rspSize = tSerializeSBatchRsp(NULL, 0, &batchRsp);
1,007,185✔
463
  if (rspSize < 0) {
1,007,343!
464
    qError("tSerializeSBatchRsp failed");
×
465
    code = terrno;
×
466
    goto _exit;
×
467
  }
468
  pRsp = rpcMallocCont(rspSize);
1,007,343✔
469
  if (pRsp == NULL) {
1,007,337!
470
    qError("rpcMallocCont %d failed", rspSize);
×
471
    code = terrno;
×
472
    goto _exit;
×
473
  }
474
  if (tSerializeSBatchRsp(pRsp, rspSize, &batchRsp) < 0) {
1,007,337!
475
    qError("tSerializeSBatchRsp %d failed", rspSize);
×
476
    code = terrno;
×
477
    goto _exit;
×
478
  }
479

480
_exit:
1,007,727✔
481

482
  rspMsg.info = pMsg->info;
1,007,727✔
483
  rspMsg.pCont = pRsp;
1,007,727✔
484
  rspMsg.contLen = rspSize;
1,007,727✔
485
  rspMsg.code = code;
1,007,727✔
486
  rspMsg.msgType = pMsg->msgType;
1,007,727✔
487

488
  if (code) {
1,007,727!
489
    qError("vnd get batch meta failed cause of %s", tstrerror(code));
×
490
  }
491

492
  taosArrayDestroyEx(batchReq.pMsgs, tFreeSBatchReqMsg);
1,007,727✔
493
  taosArrayDestroyEx(batchRsp.pRsps, tFreeSBatchRspMsg);
1,007,375✔
494

495
  tmsgSendRsp(&rspMsg);
1,007,542✔
496

497
  return code;
1,007,513✔
498
}
499

500
int32_t vnodeGetLoad(SVnode *pVnode, SVnodeLoad *pLoad) {
954,420✔
501
  SSyncState state = syncGetState(pVnode->sync);
954,420✔
502

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

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

549
void vnodeGetInfo(void *pVnode, const char **dbname, int32_t *vgId, int64_t *numOfTables, int64_t *numOfNormalTables) {
951,809✔
550
  SVnode    *pVnodeObj = pVnode;
951,809✔
551
  SVnodeCfg *pConf = &pVnodeObj->config;
951,809✔
552

553
  if (dbname) {
951,809!
554
    *dbname = pConf->dbname;
953,078✔
555
  }
556

557
  if (vgId) {
951,809!
558
    *vgId = TD_VID(pVnodeObj);
952,100✔
559
  }
560

561
  if (numOfTables) {
951,809!
562
    *numOfTables = pConf->vndStats.numOfNTables + pConf->vndStats.numOfCTables;
×
563
  }
564

565
  if (numOfNormalTables) {
951,809!
566
    *numOfNormalTables = pConf->vndStats.numOfNTables;
×
567
  }
568
}
951,809✔
569

570
int32_t vnodeGetTableList(void *pVnode, int8_t type, SArray *pList) {
×
571
  if (type == TSDB_SUPER_TABLE) {
×
572
    return vnodeGetStbIdList(pVnode, 0, pList);
×
573
  } else {
574
    return TSDB_CODE_INVALID_PARA;
×
575
  }
576
}
577

578
int32_t vnodeGetAllTableList(SVnode *pVnode, uint64_t uid, SArray *list) {
×
579
  int32_t      code = TSDB_CODE_SUCCESS;
×
580
  SMCtbCursor *pCur = metaOpenCtbCursor(pVnode, uid, 1);
×
581
  if (NULL == pCur) {
×
582
    qError("vnode get all table list failed");
×
583
    return terrno;
×
584
  }
585

586
  while (1) {
×
587
    tb_uid_t id = metaCtbCursorNext(pCur);
×
588
    if (id == 0) {
×
589
      break;
×
590
    }
591

592
    STableKeyInfo info = {uid = id};
×
593
    if (NULL == taosArrayPush(list, &info)) {
×
594
      qError("taosArrayPush failed");
×
595
      code = terrno;
×
596
      goto _exit;
×
597
    }
598
  }
599
_exit:
×
600
  metaCloseCtbCursor(pCur);
×
601
  return code;
×
602
}
603

604
int32_t vnodeGetCtbIdListByFilter(SVnode *pVnode, int64_t suid, SArray *list, bool (*filter)(void *arg), void *arg) {
×
605
  return 0;
×
606
}
607

608
int32_t vnodeGetCtbIdList(void *pVnode, int64_t suid, SArray *list) {
2,750,747✔
609
  int32_t      code = TSDB_CODE_SUCCESS;
2,750,747✔
610
  SVnode      *pVnodeObj = pVnode;
2,750,747✔
611
  SMCtbCursor *pCur = metaOpenCtbCursor(pVnodeObj, suid, 1);
2,750,747✔
612
  if (NULL == pCur) {
2,756,042!
613
    qError("vnode get all table list failed");
×
614
    return terrno;
×
615
  }
616

617
  while (1) {
9,160,295✔
618
    tb_uid_t id = metaCtbCursorNext(pCur);
11,916,337✔
619
    if (id == 0) {
11,911,555✔
620
      break;
2,759,439✔
621
    }
622

623
    if (NULL == taosArrayPush(list, &id)) {
9,160,295!
624
      qError("taosArrayPush failed");
×
625
      code = terrno;
×
626
      goto _exit;
×
627
    }
628
  }
629

630
_exit:
2,759,439✔
631
  metaCloseCtbCursor(pCur);
2,759,439✔
632
  return code;
2,758,378✔
633
}
634

635
int32_t vnodeGetStbIdList(SVnode *pVnode, int64_t suid, SArray *list) {
139,980✔
636
  int32_t      code = TSDB_CODE_SUCCESS;
139,980✔
637
  SMStbCursor *pCur = metaOpenStbCursor(pVnode->pMeta, suid);
139,980✔
638
  if (!pCur) {
139,982!
639
    return TSDB_CODE_OUT_OF_MEMORY;
×
640
  }
641

642
  while (1) {
110,685✔
643
    tb_uid_t id = metaStbCursorNext(pCur);
250,667✔
644
    if (id == 0) {
250,666✔
645
      break;
139,982✔
646
    }
647

648
    if (NULL == taosArrayPush(list, &id)) {
110,685!
649
      qError("taosArrayPush failed");
×
650
      code = terrno;
×
651
      goto _exit;
×
652
    }
653
  }
654

655
_exit:
139,982✔
656
  metaCloseStbCursor(pCur);
139,982✔
657
  return code;
139,981✔
658
}
659

660
int32_t vnodeGetStbIdListByFilter(SVnode *pVnode, int64_t suid, SArray *list, bool (*filter)(void *arg, void *arg1),
×
661
                                  void *arg) {
662
  int32_t      code = TSDB_CODE_SUCCESS;
×
663
  SMStbCursor *pCur = metaOpenStbCursor(pVnode->pMeta, suid);
×
664
  if (!pCur) {
×
665
    return terrno;
×
666
  }
667

668
  while (1) {
×
669
    tb_uid_t id = metaStbCursorNext(pCur);
×
670
    if (id == 0) {
×
671
      break;
×
672
    }
673

674
    if ((*filter) && (*filter)(arg, &id)) {
×
675
      continue;
×
676
    }
677

678
    if (NULL == taosArrayPush(list, &id)) {
×
679
      qError("taosArrayPush failed");
×
680
      code = terrno;
×
681
      goto _exit;
×
682
    }
683
  }
684

685
_exit:
×
686
  metaCloseStbCursor(pCur);
×
687
  return code;
×
688
}
689

690
int32_t vnodeGetCtbNum(SVnode *pVnode, int64_t suid, int64_t *num) {
22,844✔
691
  SMCtbCursor *pCur = metaOpenCtbCursor(pVnode, suid, 0);
22,844✔
692
  if (!pCur) {
22,846✔
693
    return terrno;
1✔
694
  }
695

696
  *num = 0;
22,845✔
697
  while (1) {
20,088✔
698
    tb_uid_t id = metaCtbCursorNext(pCur);
42,933✔
699
    if (id == 0) {
42,935✔
700
      break;
22,847✔
701
    }
702

703
    ++(*num);
20,088✔
704
  }
705

706
  metaCloseCtbCursor(pCur);
22,847✔
707
  return TSDB_CODE_SUCCESS;
22,848✔
708
}
709

710
int32_t vnodeGetStbColumnNum(SVnode *pVnode, tb_uid_t suid, int *num) {
22,846✔
711
  SSchemaWrapper *pSW = metaGetTableSchema(pVnode->pMeta, suid, -1, 0, NULL);
22,846✔
712
  if (pSW) {
22,845!
713
    *num = pSW->nCols;
22,845!
714
    tDeleteSchemaWrapper(pSW);
715
  } else {
716
    *num = 2;
×
717
  }
718

719
  return TSDB_CODE_SUCCESS;
22,846✔
720
}
721

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

746
// exclude stbs of taoskeeper log
747
static int32_t vnodeGetTimeSeriesBlackList(SVnode *pVnode, int32_t *tbSize) {
139,963✔
748
  int32_t      code = TSDB_CODE_SUCCESS;
139,963✔
749
  int32_t      tbNum = 0;
139,963✔
750
  const char **pTbArr = NULL;
139,963✔
751
  const char  *dbName = NULL;
139,963✔
752
  *tbSize = 0;
139,963✔
753

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

778
  return code;
139,963✔
779
}
780
#endif
781

782
static bool vnodeTimeSeriesFilter(void *arg1, void *arg2) {
×
783
  SVnode *pVnode = (SVnode *)arg1;
×
784

785
  if (metaTbInFilterCache(pVnode->pMeta, arg2, 0)) {
×
786
    return true;
×
787
  }
788
  return false;
×
789
}
790

791
int32_t vnodeGetTimeSeriesNum(SVnode *pVnode, int64_t *num) {
139,963✔
792
  SArray *suidList = NULL;
139,963✔
793

794
  if (!(suidList = taosArrayInit(1, sizeof(tb_uid_t)))) {
139,963!
795
    return terrno;
×
796
  }
797

798
  int32_t tbFilterSize = 0;
139,964✔
799
  int32_t code = TSDB_CODE_SUCCESS;
139,964✔
800
#ifdef TD_ENTERPRISE
801
  code = vnodeGetTimeSeriesBlackList(pVnode, &tbFilterSize);
139,964✔
802
  if (TSDB_CODE_SUCCESS != code) {
139,964!
803
    goto _exit;
×
804
  }
805
#endif
806

807
  if ((!tbFilterSize && vnodeGetStbIdList(pVnode, 0, suidList) < 0) ||
139,964!
808
      (tbFilterSize && vnodeGetStbIdListByFilter(pVnode, 0, suidList, vnodeTimeSeriesFilter, pVnode) < 0)) {
139,964!
809
    qError("vgId:%d, failed to get stb id list error: %s", TD_VID(pVnode), terrstr());
×
810
    taosArrayDestroy(suidList);
×
811
    return terrno;
×
812
  }
813

814
  *num = 0;
139,965✔
815
  int64_t arrSize = taosArrayGetSize(suidList);
139,965✔
816
  for (int64_t i = 0; i < arrSize; ++i) {
250,665✔
817
    tb_uid_t suid = *(tb_uid_t *)taosArrayGet(suidList, i);
110,699✔
818

819
    int64_t ctbNum = 0;
110,698✔
820
    int32_t numOfCols = 0;
110,698✔
821
    code = metaGetStbStats(pVnode, suid, &ctbNum, &numOfCols);
110,698✔
822
    if (TSDB_CODE_SUCCESS != code) {
110,701!
823
      goto _exit;
×
824
    }
825
    *num += ctbNum * (numOfCols - 1);
110,701✔
826
  }
827

828
_exit:
139,966✔
829
  taosArrayDestroy(suidList);
139,966✔
830
  return TSDB_CODE_SUCCESS;
139,965✔
831
}
832

833
int32_t vnodeGetAllCtbNum(SVnode *pVnode, int64_t *num) {
×
834
  SMStbCursor *pCur = metaOpenStbCursor(pVnode->pMeta, 0);
×
835
  if (!pCur) {
×
836
    return terrno;
×
837
  }
838

839
  *num = 0;
×
840
  while (1) {
×
841
    tb_uid_t id = metaStbCursorNext(pCur);
×
842
    if (id == 0) {
×
843
      break;
×
844
    }
845

846
    int64_t ctbNum = 0;
×
847
    int32_t code = vnodeGetCtbNum(pVnode, id, &ctbNum);
×
848
    if (TSDB_CODE_SUCCESS != code) {
×
849
      metaCloseStbCursor(pCur);
×
850
      return code;
×
851
    }
852

853
    *num += ctbNum;
×
854
  }
855

856
  metaCloseStbCursor(pCur);
×
857
  return TSDB_CODE_SUCCESS;
×
858
}
859

860
void *vnodeGetIdx(void *pVnode) {
59,485✔
861
  if (pVnode == NULL) {
59,485!
862
    return NULL;
×
863
  }
864

865
  return metaGetIdx(((SVnode *)pVnode)->pMeta);
59,485✔
866
}
867

868
void *vnodeGetIvtIdx(void *pVnode) {
59,420✔
869
  if (pVnode == NULL) {
59,420!
870
    return NULL;
×
871
  }
872
  return metaGetIvtIdx(((SVnode *)pVnode)->pMeta);
59,420✔
873
}
874

875
int32_t vnodeGetTableSchema(void *pVnode, int64_t uid, STSchema **pSchema, int64_t *suid) {
248✔
876
  return tsdbGetTableSchema(((SVnode *)pVnode)->pMeta, uid, pSchema, suid);
248✔
877
}
878

879
int32_t vnodeGetDBSize(void *pVnode, SDbSizeStatisInfo *pInfo) {
22✔
880
  SVnode *pVnodeObj = pVnode;
22✔
881
  if (pVnodeObj == NULL) {
22!
882
    return TSDB_CODE_VND_NOT_EXIST;
×
883
  }
884
  int32_t code = 0;
22✔
885
  char    path[TSDB_FILENAME_LEN] = {0};
22✔
886

887
  char   *dirName[] = {VNODE_TSDB_DIR, VNODE_WAL_DIR, VNODE_META_DIR, VNODE_TSDB_CACHE_DIR};
22✔
888
  int64_t dirSize[4];
889

890
  vnodeGetPrimaryDir(pVnodeObj->path, pVnodeObj->diskPrimary, pVnodeObj->pTfs, path, TSDB_FILENAME_LEN);
22✔
891
  int32_t offset = strlen(path);
22✔
892

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

904
  pInfo->l1Size = dirSize[0] - dirSize[3];
22✔
905
  pInfo->walSize = dirSize[1];
22✔
906
  pInfo->metaSize = dirSize[2];
22✔
907
  pInfo->cacheSize = dirSize[3];
22✔
908

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

911
  return code;
22✔
912
}
913

914
int32_t vnodeGetStreamProgress(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
5,947✔
915
  int32_t            code = 0;
5,947✔
916
  SStreamProgressReq req;
917
  SStreamProgressRsp rsp = {0};
5,947✔
918
  SRpcMsg            rpcMsg = {.info = pMsg->info, .code = 0};
5,947✔
919
  char              *buf = NULL;
5,947✔
920
  int32_t            rspLen = 0;
5,947✔
921
  code = tDeserializeStreamProgressReq(pMsg->pCont, pMsg->contLen, &req);
5,947✔
922

923
  if (code == TSDB_CODE_SUCCESS) {
5,947!
924
    rsp.fetchIdx = req.fetchIdx;
5,947✔
925
    rsp.subFetchIdx = req.subFetchIdx;
5,947✔
926
    rsp.vgId = req.vgId;
5,947✔
927
    rsp.streamId = req.streamId;
5,947✔
928
    rspLen = tSerializeStreamProgressRsp(0, 0, &rsp);
5,947✔
929
    if (rspLen < 0) {
5,947!
UNCOV
930
      code = terrno;
×
931
      goto _OVER;
×
932
    }
933
    if (direct) {
5,947!
934
      buf = rpcMallocCont(rspLen);
×
935
    } else {
936
      buf = taosMemoryCalloc(1, rspLen);
5,947!
937
    }
938
    if (!buf) {
5,946!
939
      code = terrno;
×
940
      goto _OVER;
×
941
    }
942
  }
943

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

965
_OVER:
×
966
  if (buf) {
5,948!
967
    taosMemoryFree(buf);
×
968
  }
969
  return code;
5,948✔
970
}
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