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

taosdata / TDengine / #3568

27 Dec 2024 02:27PM UTC coverage: 63.286% (+0.6%) from 62.733%
#3568

push

travis-ci

web-flow
Merge pull request #29378 from taosdata/revert-29377-revert-29165-enh/TD-29974-improve-trans

Revert "Revert "Enh:[td 29974]improve trans""

139941 of 284289 branches covered (49.22%)

Branch coverage included in aggregate %.

105 of 355 new or added lines in 12 files covered. (29.58%)

4077 existing lines in 132 files now uncovered.

218122 of 281494 relevant lines covered (77.49%)

19355607.91 hits per line

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

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

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

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

35
int32_t fillTableColCmpr(SMetaReader *reader, SSchemaExt *pExt, int32_t numOfCol) {
899,479✔
36
  int8_t tblType = reader->me.type;
899,479✔
37
  if (useCompress(tblType)) {
899,479!
38
    SColCmprWrapper *p = &(reader->me.colCmpr);
899,564✔
39
    if (numOfCol != p->nCols) {
899,564!
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++) {
22,846,611✔
44
      SColCmpr *pCmpr = &p->pColCmpr[i];
21,947,047✔
45
      pExt[i].colId = pCmpr->id;
21,947,047✔
46
      pExt[i].compress = pCmpr->alg;
21,947,047✔
47
    }
48
  }
49
  return 0;
899,545✔
50
}
51

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

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

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

77
  if (!reqTbUid) {
909,263✔
78
    (void)tsnprintf(tableFName, TSDB_TABLE_FNAME_LEN, "%s.%s", infoReq.dbFName, infoReq.tbName);
908,129✔
79
    code = vnodeValidateTableHash(pVnode, tableFName);
908,681✔
80
    if (code) {
908,581!
81
      goto _exit4;
×
82
    }
83
  }
84

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

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

107
  if (mer1.me.type == TSDB_SUPER_TABLE) {
899,973✔
108
    tstrncpy(metaRsp.stbName, mer1.me.name, TSDB_TABLE_NAME_LEN);
479,629✔
109
    schema = mer1.me.stbEntry.schemaRow;
479,629✔
110
    schemaTag = mer1.me.stbEntry.schemaTag;
479,629✔
111
    metaRsp.suid = mer1.me.uid;
479,629✔
112
  } else if (mer1.me.type == TSDB_CHILD_TABLE) {
420,344✔
113
    metaReaderDoInit(&mer2, pVnode->pMeta, META_READER_NOLOCK);
398,628✔
114
    if (metaReaderGetTableEntryByUid(&mer2, mer1.me.ctbEntry.suid) < 0) goto _exit2;
398,628!
115

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

127
  metaRsp.numOfTags = schemaTag.nCols;
899,971✔
128
  metaRsp.numOfColumns = schema.nCols;
899,971✔
129
  metaRsp.precision = pVnode->config.tsdbCfg.precision;
899,971✔
130
  metaRsp.sversion = schema.version;
899,971✔
131
  metaRsp.tversion = schemaTag.version;
899,971✔
132
  metaRsp.pSchemas = (SSchema *)taosMemoryMalloc(sizeof(SSchema) * (metaRsp.numOfColumns + metaRsp.numOfTags));
899,971!
133
  metaRsp.pSchemaExt = (SSchemaExt *)taosMemoryCalloc(metaRsp.numOfColumns, sizeof(SSchemaExt));
899,848!
134
  if (NULL == metaRsp.pSchemas || NULL == metaRsp.pSchemaExt) {
899,692!
135
    code = terrno;
×
136
    goto _exit;
×
137
  }
138
  (void)memcpy(metaRsp.pSchemas, schema.pSchema, sizeof(SSchema) * schema.nCols);
899,726✔
139
  if (schemaTag.nCols) {
899,726✔
140
    (void)memcpy(metaRsp.pSchemas + schema.nCols, schemaTag.pSchema, sizeof(SSchema) * schemaTag.nCols);
877,602✔
141
  }
142
  if (metaRsp.pSchemaExt) {
899,726✔
143
    SMetaReader *pReader = mer1.me.type == TSDB_CHILD_TABLE ? &mer2 : &mer1;
899,399✔
144
    code = fillTableColCmpr(pReader, metaRsp.pSchemaExt, metaRsp.numOfColumns);
899,399✔
145
    if (code < 0) {
899,755!
146
      goto _exit;
×
147
    }
148
  } else {
149
    code = TSDB_CODE_OUT_OF_MEMORY;
327✔
150
    goto _exit;
327✔
151
  }
152

153
  // encode and send response
154
  rspLen = tSerializeSTableMetaRsp(NULL, 0, &metaRsp);
899,755✔
155
  if (rspLen < 0) {
899,699✔
156
    code = terrno;
163✔
157
    goto _exit;
×
158
  }
159

160
  if (direct) {
899,536✔
161
    pRsp = rpcMallocCont(rspLen);
222✔
162
  } else {
163
    pRsp = taosMemoryCalloc(1, rspLen);
899,314!
164
  }
165

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

171
  rspLen = tSerializeSTableMetaRsp(pRsp, rspLen, &metaRsp);
899,462✔
172
  if (rspLen < 0) {
899,779!
173
    code = terrno;
×
174
    goto _exit;
×
175
  }
176

177
_exit:
899,779✔
178
  taosMemoryFree(metaRsp.pSchemas);
900,106!
179
  taosMemoryFree(metaRsp.pSchemaExt);
899,825!
180
_exit2:
899,818✔
181
  metaReaderClear(&mer2);
899,818✔
182
_exit3:
909,061✔
183
  metaReaderClear(&mer1);
909,061✔
184
_exit4:
909,237✔
185
  rpcMsg.info = pMsg->info;
909,237✔
186
  rpcMsg.pCont = pRsp;
909,237✔
187
  rpcMsg.contLen = rspLen;
909,237✔
188
  rpcMsg.code = code;
909,237✔
189
  rpcMsg.msgType = pMsg->msgType;
909,237✔
190

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

195
  if (direct) {
909,158✔
196
    tmsgSendRsp(&rpcMsg);
1,777✔
197
  } else {
198
    *pMsg = rpcMsg;
907,381✔
199
  }
200

201
  return code;
909,151✔
202
}
203

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

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

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

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

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

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

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

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

249
    tstrncpy(cfgRsp.stbName, mer2.me.name, TSDB_TABLE_NAME_LEN);
69✔
250
    schema = mer2.me.stbEntry.schemaRow;
69✔
251
    schemaTag = mer2.me.stbEntry.schemaTag;
69✔
252
    cfgRsp.ttl = mer1.me.ctbEntry.ttlDays;
69✔
253
    cfgRsp.commentLen = mer1.me.ctbEntry.commentLen;
69✔
254
    if (mer1.me.ctbEntry.commentLen > 0) {
69!
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;
69✔
262
    cfgRsp.tagsLen = pTag->len;
69✔
263
    cfgRsp.pTags = taosMemoryMalloc(cfgRsp.tagsLen);
69!
264
    if (NULL == cfgRsp.pTags) {
69!
265
      code = terrno;
×
266
      goto _exit;
×
267
    }
268
    (void)memcpy(cfgRsp.pTags, pTag, cfgRsp.tagsLen);
69✔
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;
×
UNCOV
283
    goto _exit;
×
284
  }
285

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

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

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

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

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

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

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

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

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

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

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

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

354
  tFreeSTableCfgRsp(&cfgRsp);
86✔
355
  metaReaderClear(&mer2);
86✔
356
  metaReaderClear(&mer1);
86✔
357
  return code;
86✔
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) {
777,377✔
370
  int32_t      code = 0;
777,377✔
371
  int32_t      rspSize = 0;
777,377✔
372
  SBatchReq    batchReq = {0};
777,377✔
373
  SBatchMsg   *req = NULL;
777,377✔
374
  SBatchRspMsg rsp = {0};
777,377✔
375
  SBatchRsp    batchRsp = {0};
777,377✔
376
  SRpcMsg      reqMsg = *pMsg;
777,377✔
377
  SRpcMsg      rspMsg = {0};
777,377✔
378
  void        *pRsp = NULL;
777,377✔
379

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

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

393
  batchRsp.pRsps = taosArrayInit(msgNum, sizeof(SBatchRspMsg));
777,407✔
394
  if (NULL == batchRsp.pRsps) {
777,883!
395
    code = terrno;
×
396
    qError("taosArrayInit %d SBatchRspMsg failed", msgNum);
×
UNCOV
397
    goto _exit;
×
398
  }
399

400
  for (int32_t i = 0; i < msgNum; ++i) {
1,690,826✔
401
    req = taosArrayGet(batchReq.pMsgs, i);
913,262✔
402
    if (req == NULL) {
912,818✔
403
      code = terrno;
50✔
UNCOV
404
      goto _exit;
×
405
    }
406

407
    reqMsg.msgType = req->msgType;
912,768✔
408
    reqMsg.pCont = req->msg;
912,768✔
409
    reqMsg.contLen = req->msgLen;
912,768✔
410

411
    switch (req->msgType) {
912,768!
412
      case TDMT_VND_TABLE_META:
906,190✔
413
        // error code has been set into reqMsg, no need to handle it here.
414
        if (TSDB_CODE_SUCCESS != vnodeGetTableMeta(pVnode, &reqMsg, false)) {
906,190✔
415
          qWarn("vnodeGetBatchMeta failed, msgType:%d", req->msgType);
7,716!
416
        }
417
        break;
906,718✔
418
      case TDMT_VND_TABLE_NAME:
538✔
419
        // error code has been set into reqMsg, no need to handle it here.
420
        if (TSDB_CODE_SUCCESS != vnodeGetTableMeta(pVnode, &reqMsg, false)) {
538✔
421
          qWarn("vnodeGetBatchName failed, msgType:%d", req->msgType);
136!
422
        }
423
        break;
538✔
424
      case TDMT_VND_TABLE_CFG:
86✔
425
        // error code has been set into reqMsg, no need to handle it here.
426
        if (TSDB_CODE_SUCCESS != vnodeGetTableCfg(pVnode, &reqMsg, false)) {
86!
UNCOV
427
          qWarn("vnodeGetBatchMeta failed, msgType:%d", req->msgType);
×
428
        }
429
        break;
86✔
430
      case TDMT_VND_GET_STREAM_PROGRESS:
5,954✔
431
        // error code has been set into reqMsg, no need to handle it here.
432
        if (TSDB_CODE_SUCCESS != vnodeGetStreamProgress(pVnode, &reqMsg, false)) {
5,954!
UNCOV
433
          qWarn("vnodeGetBatchMeta failed, msgType:%d", req->msgType);
×
434
        }
435
        break;
5,954✔
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;
×
UNCOV
441
        break;
×
442
    }
443

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

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

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

475
_exit:
777,918✔
476

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

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

487
  taosArrayDestroyEx(batchReq.pMsgs, tFreeSBatchReqMsg);
777,918✔
488
  taosArrayDestroyEx(batchRsp.pRsps, tFreeSBatchRspMsg);
777,754✔
489

490
  tmsgSendRsp(&rspMsg);
777,800✔
491

492
  return code;
777,767✔
493
}
494

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

498
  pLoad->vgId = TD_VID(pVnode);
1,154,626✔
499
  pLoad->syncState = state.state;
1,154,626✔
500
  pLoad->syncRestore = state.restored;
1,154,626✔
501
  pLoad->syncTerm = state.term;
1,154,626✔
502
  pLoad->roleTimeMs = state.roleTimeMs;
1,154,626✔
503
  pLoad->startTimeMs = state.startTimeMs;
1,154,626✔
504
  pLoad->syncCanRead = state.canRead;
1,154,626✔
505
  pLoad->learnerProgress = state.progress;
1,154,626✔
506
  pLoad->cacheUsage = tsdbCacheGetUsage(pVnode);
1,154,626✔
507
  pLoad->numOfCachedTables = tsdbCacheGetElems(pVnode);
1,154,626✔
508
  pLoad->numOfTables = metaGetTbNum(pVnode->pMeta);
1,154,626✔
509
  pLoad->numOfTimeSeries = metaGetTimeSeriesNum(pVnode->pMeta, 1);
1,154,626✔
510
  pLoad->totalStorage = (int64_t)3 * 1073741824;
1,154,626✔
511
  pLoad->compStorage = (int64_t)2 * 1073741824;
1,154,626✔
512
  pLoad->pointsWritten = 100;
1,154,626✔
513
  pLoad->numOfSelectReqs = 1;
1,154,626✔
514
  pLoad->numOfInsertReqs = atomic_load_64(&pVnode->statis.nInsert);
1,154,626✔
515
  pLoad->numOfInsertSuccessReqs = atomic_load_64(&pVnode->statis.nInsertSuccess);
1,154,626✔
516
  pLoad->numOfBatchInsertReqs = atomic_load_64(&pVnode->statis.nBatchInsert);
1,154,626✔
517
  pLoad->numOfBatchInsertSuccessReqs = atomic_load_64(&pVnode->statis.nBatchInsertSuccess);
1,154,626✔
518
  return 0;
1,154,626✔
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);
×
UNCOV
526
    return 0;
×
527
  }
UNCOV
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) {
919,389✔
545
  SVnode    *pVnodeObj = pVnode;
919,389✔
546
  SVnodeCfg *pConf = &pVnodeObj->config;
919,389✔
547

548
  if (dbname) {
919,389!
549
    *dbname = pConf->dbname;
920,262✔
550
  }
551

552
  if (vgId) {
919,389✔
553
    *vgId = TD_VID(pVnodeObj);
919,296✔
554
  }
555

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

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

565
int32_t vnodeGetTableList(void *pVnode, int8_t type, SArray *pList) {
×
566
  if (type == TSDB_SUPER_TABLE) {
×
UNCOV
567
    return vnodeGetStbIdList(pVnode, 0, pList);
×
568
  } else {
UNCOV
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");
×
UNCOV
578
    return terrno;
×
579
  }
580

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

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

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

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

612
  while (1) {
7,670,259✔
613
    tb_uid_t id = metaCtbCursorNext(pCur);
9,929,533✔
614
    if (id == 0) {
9,924,182✔
615
      break;
2,261,977✔
616
    }
617

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

625
_exit:
2,261,977✔
626
  metaCloseCtbCursor(pCur);
2,261,977✔
627
  return code;
2,261,384✔
628
}
629

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

637
  while (1) {
104,427✔
638
    tb_uid_t id = metaStbCursorNext(pCur);
247,286✔
639
    if (id == 0) {
247,290✔
640
      break;
142,859✔
641
    }
642

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

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

UNCOV
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) {
×
UNCOV
660
    return terrno;
×
661
  }
662

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

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

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

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

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

691
  *num = 0;
22,604✔
692
  while (1) {
23,520✔
693
    tb_uid_t id = metaCtbCursorNext(pCur);
46,124✔
694
    if (id == 0) {
46,125✔
695
      break;
22,605✔
696
    }
697

698
    ++(*num);
23,520✔
699
  }
700

701
  metaCloseCtbCursor(pCur);
22,605✔
702
  return TSDB_CODE_SUCCESS;
22,606✔
703
}
704

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

714
  return TSDB_CODE_SUCCESS;
22,606✔
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) {
142,841✔
743
  int32_t      code = TSDB_CODE_SUCCESS;
142,841✔
744
  int32_t      tbNum = 0;
142,841✔
745
  const char **pTbArr = NULL;
142,841✔
746
  const char  *dbName = NULL;
142,841✔
747
  *tbSize = 0;
142,841✔
748

749
  if (!(dbName = strchr(pVnode->config.dbname, '.'))) return 0;
142,841!
750
  if (0 == strncmp(++dbName, "log", TSDB_DB_NAME_LEN)) {
142,841!
751
    tbNum = tkLogStbNum;
×
UNCOV
752
    pTbArr = (const char **)&tkLogStb;
×
753
  } else if (0 == strncmp(dbName, "audit", TSDB_DB_NAME_LEN)) {
142,841!
754
    tbNum = tkAuditStbNum;
×
UNCOV
755
    pTbArr = (const char **)&tkAuditStb;
×
756
  }
757
  if (tbNum && pTbArr) {
142,841!
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) {
×
UNCOV
765
            return code;
×
766
          }
767
        }
768
      }
UNCOV
769
      *tbSize = metaSizeOfTbFilterCache(pVnode->pMeta, 0);
×
770
    }
771
  }
772

773
  return code;
142,841✔
774
}
775
#endif
776

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

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

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

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

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

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

809
  *num = 0;
142,841✔
810
  int64_t arrSize = taosArrayGetSize(suidList);
142,841✔
811
  for (int64_t i = 0; i < arrSize; ++i) {
247,267✔
812
    tb_uid_t suid = *(tb_uid_t *)taosArrayGet(suidList, i);
104,425✔
813

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

823
_exit:
142,842✔
824
  taosArrayDestroy(suidList);
142,842✔
825
  return TSDB_CODE_SUCCESS;
142,842✔
826
}
827

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

834
  *num = 0;
×
835
  while (1) {
×
836
    tb_uid_t id = metaStbCursorNext(pCur);
×
837
    if (id == 0) {
×
UNCOV
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);
×
UNCOV
845
      return code;
×
846
    }
847

UNCOV
848
    *num += ctbNum;
×
849
  }
850

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

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

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

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

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

874
int32_t vnodeGetDBSize(void *pVnode, SDbSizeStatisInfo *pInfo) {
22✔
875
  SVnode *pVnodeObj = pVnode;
22✔
876
  if (pVnodeObj == NULL) {
22!
UNCOV
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!
UNCOV
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,954✔
910
  int32_t            code = 0;
5,954✔
911
  SStreamProgressReq req;
912
  SStreamProgressRsp rsp = {0};
5,954✔
913
  SRpcMsg            rpcMsg = {.info = pMsg->info, .code = 0};
5,954✔
914
  char              *buf = NULL;
5,954✔
915
  int32_t            rspLen = 0;
5,954✔
916
  code = tDeserializeStreamProgressReq(pMsg->pCont, pMsg->contLen, &req);
5,954✔
917

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

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

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