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

taosdata / TDengine / #3578

11 Jan 2025 11:19AM UTC coverage: 63.183% (-0.03%) from 63.211%
#3578

push

travis-ci

web-flow
Merge pull request #29546 from taosdata/merge/mainto3.0

merge: from main to 3.0 branch

139873 of 284461 branches covered (49.17%)

Branch coverage included in aggregate %.

20 of 26 new or added lines in 2 files covered. (76.92%)

717 existing lines in 102 files now uncovered.

217827 of 281671 relevant lines covered (77.33%)

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

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

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

35
int32_t fillTableColCmpr(SMetaReader *reader, SSchemaExt *pExt, int32_t numOfCol) {
1,295,653✔
36
  int8_t tblType = reader->me.type;
1,295,653✔
37
  if (useCompress(tblType)) {
1,295,653!
38
    SColCmprWrapper *p = &(reader->me.colCmpr);
1,295,805✔
39
    if (numOfCol != p->nCols) {
1,295,805!
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++) {
33,136,188✔
44
      SColCmpr *pCmpr = &p->pColCmpr[i];
31,840,383✔
45
      pExt[i].colId = pCmpr->id;
31,840,383✔
46
      pExt[i].compress = pCmpr->alg;
31,840,383✔
47
    }
48
  }
49
  return 0;
1,295,783✔
50
}
51

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

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

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

77
  if (!reqTbUid) {
1,305,702✔
78
    (void)tsnprintf(tableFName, TSDB_TABLE_FNAME_LEN, "%s.%s", infoReq.dbFName, infoReq.tbName);
1,303,923✔
79
    code = vnodeValidateTableHash(pVnode, tableFName);
1,305,022✔
80
    if (code) {
1,305,016!
81
      goto _exit4;
×
82
    }
83
  }
84

85
  // query meta
86
  metaReaderDoInit(&mer1, pVnode->pMeta, META_READER_LOCK);
1,306,795✔
87
  if (reqTbUid) {
1,305,552✔
88
    errno = 0;
534✔
89
    uint64_t tbUid = taosStr2UInt64(infoReq.tbName, NULL, 10);
534✔
90
    if (errno == ERANGE || tbUid == 0) {
534!
91
      code = TSDB_CODE_TDB_TABLE_NOT_EXIST;
×
92
      goto _exit3;
127✔
93
    }
94
    SMetaReader mr3 = {0};
534✔
95
    metaReaderDoInit(&mr3, ((SVnode *)pVnode)->pMeta, META_READER_NOLOCK);
534✔
96
    if ((code = metaReaderGetTableEntryByUid(&mr3, tbUid)) < 0) {
534✔
97
      metaReaderClear(&mr3);
127✔
98
      TAOS_CHECK_GOTO(code, NULL, _exit3);
127!
99
    }
100
    tstrncpy(metaRsp.tbName, mr3.me.name, TSDB_TABLE_NAME_LEN);
405✔
101
    metaReaderClear(&mr3);
405✔
102
    TAOS_CHECK_GOTO(metaGetTableEntryByName(&mer1, metaRsp.tbName), NULL, _exit3);
407!
103
  } else if (metaGetTableEntryByName(&mer1, infoReq.tbName) < 0) {
1,305,018✔
104
    code = terrno;
9,429✔
105
    goto _exit3;
9,583✔
106
  }
107

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

112
  if (mer1.me.type == TSDB_SUPER_TABLE) {
1,296,237✔
113
    tstrncpy(metaRsp.stbName, mer1.me.name, TSDB_TABLE_NAME_LEN);
687,983✔
114
    schema = mer1.me.stbEntry.schemaRow;
687,983✔
115
    schemaTag = mer1.me.stbEntry.schemaTag;
687,983✔
116
    metaRsp.suid = mer1.me.uid;
687,983✔
117
  } else if (mer1.me.type == TSDB_CHILD_TABLE) {
608,254✔
118
    metaReaderDoInit(&mer2, pVnode->pMeta, META_READER_NOLOCK);
585,511✔
119
    if (metaReaderGetTableEntryByUid(&mer2, mer1.me.ctbEntry.suid) < 0) goto _exit2;
585,510!
120

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

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

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

165
  if (direct) {
1,295,651✔
166
    pRsp = rpcMallocCont(rspLen);
220✔
167
  } else {
168
    pRsp = taosMemoryCalloc(1, rspLen);
1,295,431!
169
  }
170

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

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

182
_exit:
1,295,977✔
183
  taosMemoryFree(metaRsp.pSchemas);
1,296,378!
184
  taosMemoryFree(metaRsp.pSchemaExt);
1,295,884!
185
_exit2:
1,296,022✔
186
  metaReaderClear(&mer2);
1,296,022✔
187
_exit3:
1,305,561✔
188
  metaReaderClear(&mer1);
1,305,561✔
189
_exit4:
1,305,646✔
190
  rpcMsg.info = pMsg->info;
1,305,646✔
191
  rpcMsg.pCont = pRsp;
1,305,646✔
192
  rpcMsg.contLen = rspLen;
1,305,646✔
193
  rpcMsg.code = code;
1,305,646✔
194
  rpcMsg.msgType = pMsg->msgType;
1,305,646✔
195

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

200
  if (direct) {
1,305,651✔
201
    tmsgSendRsp(&rpcMsg);
1,776✔
202
  } else {
203
    *pMsg = rpcMsg;
1,303,875✔
204
  }
205

206
  return code;
1,305,439✔
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,132,584✔
375
  int32_t      code = 0;
1,132,584✔
376
  int32_t      rspSize = 0;
1,132,584✔
377
  SBatchReq    batchReq = {0};
1,132,584✔
378
  SBatchMsg   *req = NULL;
1,132,584✔
379
  SBatchRspMsg rsp = {0};
1,132,584✔
380
  SBatchRsp    batchRsp = {0};
1,132,584✔
381
  SRpcMsg      reqMsg = *pMsg;
1,132,584✔
382
  SRpcMsg      rspMsg = {0};
1,132,584✔
383
  void        *pRsp = NULL;
1,132,584✔
384

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

391
  int32_t msgNum = taosArrayGetSize(batchReq.pMsgs);
1,133,247✔
392
  if (msgNum >= MAX_META_MSG_IN_BATCH) {
1,132,408!
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,132,408✔
399
  if (NULL == batchRsp.pRsps) {
1,133,323✔
400
    code = terrno;
46✔
401
    qError("taosArrayInit %d SBatchRspMsg failed", msgNum);
×
402
    goto _exit;
×
403
  }
404

405
  for (int32_t i = 0; i < msgNum; ++i) {
2,442,052✔
406
    req = taosArrayGet(batchReq.pMsgs, i);
1,309,347✔
407
    if (req == NULL) {
1,308,575✔
408
      code = terrno;
28✔
409
      goto _exit;
×
410
    }
411

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

416
    switch (req->msgType) {
1,308,547!
417
      case TDMT_VND_TABLE_META:
1,302,093✔
418
        // error code has been set into reqMsg, no need to handle it here.
419
        if (TSDB_CODE_SUCCESS != vnodeGetTableMeta(pVnode, &reqMsg, false)) {
1,302,093✔
420
          qWarn("vnodeGetBatchMeta failed, msgType:%d", req->msgType);
8,028!
421
        }
422
        break;
1,302,996✔
423
      case TDMT_VND_TABLE_NAME:
534✔
424
        // error code has been set into reqMsg, no need to handle it here.
425
        if (TSDB_CODE_SUCCESS != vnodeGetTableMeta(pVnode, &reqMsg, false)) {
534✔
426
          qWarn("vnodeGetBatchName failed, msgType:%d", req->msgType);
127!
427
        }
428
        break;
534✔
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,834✔
436
        // error code has been set into reqMsg, no need to handle it here.
437
        if (TSDB_CODE_SUCCESS != vnodeGetStreamProgress(pVnode, &reqMsg, false)) {
5,834!
438
          qWarn("vnodeGetBatchMeta failed, msgType:%d", req->msgType);
×
439
        }
440
        break;
5,834✔
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,309,450✔
450
    rsp.reqType = reqMsg.msgType;
1,309,450✔
451
    rsp.msgLen = reqMsg.contLen;
1,309,450✔
452
    rsp.rspCode = reqMsg.code;
1,309,450✔
453
    rsp.msg = reqMsg.pCont;
1,309,450✔
454

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

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

480
_exit:
1,133,339✔
481

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

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

492
  taosArrayDestroyEx(batchReq.pMsgs, tFreeSBatchReqMsg);
1,133,339✔
493
  taosArrayDestroyEx(batchRsp.pRsps, tFreeSBatchRspMsg);
1,133,127✔
494

495
  tmsgSendRsp(&rspMsg);
1,133,235✔
496

497
  return code;
1,133,200✔
498
}
499

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

503
  pLoad->vgId = TD_VID(pVnode);
1,085,203✔
504
  pLoad->syncState = state.state;
1,085,203✔
505
  pLoad->syncRestore = state.restored;
1,085,203✔
506
  pLoad->syncTerm = state.term;
1,085,203✔
507
  pLoad->roleTimeMs = state.roleTimeMs;
1,085,203✔
508
  pLoad->startTimeMs = state.startTimeMs;
1,085,203✔
509
  pLoad->syncCanRead = state.canRead;
1,085,203✔
510
  pLoad->learnerProgress = state.progress;
1,085,203✔
511
  pLoad->cacheUsage = tsdbCacheGetUsage(pVnode);
1,085,203✔
512
  pLoad->numOfCachedTables = tsdbCacheGetElems(pVnode);
1,085,203✔
513
  pLoad->numOfTables = metaGetTbNum(pVnode->pMeta);
1,085,203✔
514
  pLoad->numOfTimeSeries = metaGetTimeSeriesNum(pVnode->pMeta, 1);
1,085,203✔
515
  pLoad->totalStorage = (int64_t)3 * 1073741824;
1,085,203✔
516
  pLoad->compStorage = (int64_t)2 * 1073741824;
1,085,203✔
517
  pLoad->pointsWritten = 100;
1,085,203✔
518
  pLoad->numOfSelectReqs = 1;
1,085,203✔
519
  pLoad->numOfInsertReqs = atomic_load_64(&pVnode->statis.nInsert);
1,085,203✔
520
  pLoad->numOfInsertSuccessReqs = atomic_load_64(&pVnode->statis.nInsertSuccess);
1,085,203✔
521
  pLoad->numOfBatchInsertReqs = atomic_load_64(&pVnode->statis.nBatchInsert);
1,085,203✔
522
  pLoad->numOfBatchInsertSuccessReqs = atomic_load_64(&pVnode->statis.nBatchInsertSuccess);
1,085,203✔
523
  return 0;
1,085,203✔
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) {
925,729✔
550
  SVnode    *pVnodeObj = pVnode;
925,729✔
551
  SVnodeCfg *pConf = &pVnodeObj->config;
925,729✔
552

553
  if (dbname) {
925,729!
554
    *dbname = pConf->dbname;
926,814✔
555
  }
556

557
  if (vgId) {
925,729!
558
    *vgId = TD_VID(pVnodeObj);
925,886✔
559
  }
560

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

565
  if (numOfNormalTables) {
925,729!
566
    *numOfNormalTables = pConf->vndStats.numOfNTables;
×
567
  }
568
}
925,729✔
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,765,017✔
609
  int32_t      code = TSDB_CODE_SUCCESS;
2,765,017✔
610
  SVnode      *pVnodeObj = pVnode;
2,765,017✔
611
  SMCtbCursor *pCur = metaOpenCtbCursor(pVnodeObj, suid, 1);
2,765,017✔
612
  if (NULL == pCur) {
2,772,118!
613
    qError("vnode get all table list failed");
×
614
    return terrno;
×
615
  }
616

617
  while (1) {
9,250,972✔
618
    tb_uid_t id = metaCtbCursorNext(pCur);
12,023,090✔
619
    if (id == 0) {
12,019,727✔
620
      break;
2,774,109✔
621
    }
622

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

630
_exit:
2,774,109✔
631
  metaCloseCtbCursor(pCur);
2,774,109✔
632
  return code;
2,772,584✔
633
}
634

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

642
  while (1) {
130,095✔
643
    tb_uid_t id = metaStbCursorNext(pCur);
285,969✔
644
    if (id == 0) {
285,972✔
645
      break;
155,874✔
646
    }
647

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

655
_exit:
155,874✔
656
  metaCloseStbCursor(pCur);
155,874✔
657
  return code;
155,874✔
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) {
23,294✔
691
  SMCtbCursor *pCur = metaOpenCtbCursor(pVnode, suid, 0);
23,294✔
692
  if (!pCur) {
23,293!
693
    return terrno;
×
694
  }
695

696
  *num = 0;
23,293✔
697
  while (1) {
31,325✔
698
    tb_uid_t id = metaCtbCursorNext(pCur);
54,618✔
699
    if (id == 0) {
54,622✔
700
      break;
23,297✔
701
    }
702

703
    ++(*num);
31,325✔
704
  }
705

706
  metaCloseCtbCursor(pCur);
23,297✔
707
  return TSDB_CODE_SUCCESS;
23,299✔
708
}
709

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

719
  return TSDB_CODE_SUCCESS;
23,297✔
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) {
155,857✔
748
  int32_t      code = TSDB_CODE_SUCCESS;
155,857✔
749
  int32_t      tbNum = 0;
155,857✔
750
  const char **pTbArr = NULL;
155,857✔
751
  const char  *dbName = NULL;
155,857✔
752
  *tbSize = 0;
155,857✔
753

754
  if (!(dbName = strchr(pVnode->config.dbname, '.'))) return 0;
155,857!
755
  if (0 == strncmp(++dbName, "log", TSDB_DB_NAME_LEN)) {
155,857!
756
    tbNum = tkLogStbNum;
×
757
    pTbArr = (const char **)&tkLogStb;
×
758
  } else if (0 == strncmp(dbName, "audit", TSDB_DB_NAME_LEN)) {
155,857!
759
    tbNum = tkAuditStbNum;
×
760
    pTbArr = (const char **)&tkAuditStb;
×
761
  }
762
  if (tbNum && pTbArr) {
155,857!
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;
155,857✔
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) {
155,857✔
792
  SArray *suidList = NULL;
155,857✔
793

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

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

807
  if ((!tbFilterSize && vnodeGetStbIdList(pVnode, 0, suidList) < 0) ||
155,856!
808
      (tbFilterSize && vnodeGetStbIdListByFilter(pVnode, 0, suidList, vnodeTimeSeriesFilter, pVnode) < 0)) {
155,857!
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;
155,856✔
815
  int64_t arrSize = taosArrayGetSize(suidList);
155,856✔
816
  for (int64_t i = 0; i < arrSize; ++i) {
285,971✔
817
    tb_uid_t suid = *(tb_uid_t *)taosArrayGet(suidList, i);
130,112✔
818

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

828
_exit:
155,859✔
829
  taosArrayDestroy(suidList);
155,859✔
830
  return TSDB_CODE_SUCCESS;
155,857✔
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) {
42,476✔
861
  if (pVnode == NULL) {
42,476!
862
    return NULL;
×
863
  }
864

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

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

875
int32_t vnodeGetTableSchema(void *pVnode, int64_t uid, STSchema **pSchema, int64_t *suid) {
374✔
876
  return tsdbGetTableSchema(((SVnode *)pVnode)->pMeta, uid, pSchema, suid);
374✔
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,833✔
915
  int32_t            code = 0;
5,833✔
916
  SStreamProgressReq req;
917
  SStreamProgressRsp rsp = {0};
5,833✔
918
  SRpcMsg            rpcMsg = {.info = pMsg->info, .code = 0};
5,833✔
919
  char              *buf = NULL;
5,833✔
920
  int32_t            rspLen = 0;
5,833✔
921
  code = tDeserializeStreamProgressReq(pMsg->pCont, pMsg->contLen, &req);
5,833✔
922

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

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

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