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

taosdata / TDengine / #4829

30 Oct 2025 09:25AM UTC coverage: 49.734% (-11.3%) from 61.071%
#4829

push

travis-ci

web-flow
Merge pull request #33435 from taosdata/3.0

merge 3.0

123072 of 323930 branches covered (37.99%)

Branch coverage included in aggregate %.

7 of 25 new or added lines in 3 files covered. (28.0%)

35232 existing lines in 327 files now uncovered.

172062 of 269495 relevant lines covered (63.85%)

70709785.06 hits per line

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

74.79
/source/dnode/mgmt/mgmt_dnode/src/dmInt.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
#define _DEFAULT_SOURCE
17
#include "dmInt.h"
18
#include "libs/function/tudf.h"
19
#include "tanalytics.h"
20

21
static int32_t dmStartMgmt(SDnodeMgmt *pMgmt) {
140,930✔
22
  int32_t code = 0;
140,930✔
23
  if ((code = dmStartStatusThread(pMgmt)) != 0) {
140,930!
24
    return code;
×
25
  }
26

27
  if ((code = dmStartConfigThread(pMgmt)) != 0) {
140,930!
28
    return code;
×
29
  }
30
  if ((code = dmStartStatusInfoThread(pMgmt)) != 0) {
140,930!
31
    return code;
×
32
  }
33
#if defined(TD_ENTERPRISE)
34
  if ((code = dmStartNotifyThread(pMgmt)) != 0) {
140,930!
35
    return code;
×
36
  }
37
#endif
38
  if ((code = dmStartMonitorThread(pMgmt)) != 0) {
140,930!
39
    return code;
×
40
  }
41
  if ((code = dmStartAuditThread(pMgmt)) != 0) {
140,930!
42
    return code;
×
43
  }
44
  if ((code = dmStartCrashReportThread(pMgmt)) != 0) {
140,930!
45
    return code;
×
46
  }
47
  if ((code = dmStartMetricsThread(pMgmt)) != 0) {
140,930!
48
    return code;
×
49
  }
50
  return 0;
140,930✔
51
}
52

53
static void dmStopMgmt(SDnodeMgmt *pMgmt) {
140,930✔
54
  pMgmt->pData->stopped = true;
140,930✔
55
  dmStopMonitorThread(pMgmt);
140,930✔
56
  dmStopAuditThread(pMgmt);
140,930✔
57
  dmStopStatusThread(pMgmt);
140,930✔
58
  dmStopConfigThread(pMgmt);
140,930✔
59
  dmStopStatusInfoThread(pMgmt);
140,930✔
60
#if defined(TD_ENTERPRISE)
61
  dmStopNotifyThread(pMgmt);
140,930✔
62
#endif
63
  dmStopCrashReportThread(pMgmt);
140,930✔
64
  dmStopMetricsThread(pMgmt);
140,930✔
65
}
140,930✔
66

67
static int32_t dmOpenMgmt(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) {
140,930✔
68
  int32_t     code = 0;
140,930✔
69
  SDnodeMgmt *pMgmt = taosMemoryCalloc(1, sizeof(SDnodeMgmt));
140,930!
70
  if (pMgmt == NULL) {
140,930!
71
    return terrno;
×
72
  }
73

74
  pMgmt->pData = pInput->pData;
140,930✔
75
  pMgmt->msgCb = pInput->msgCb;
140,930✔
76
  pMgmt->pTfs = pInput->pTfs;
140,930✔
77
  pMgmt->path = pInput->path;
140,930✔
78
  pMgmt->name = pInput->name;
140,930✔
79
  pMgmt->processCreateNodeFp = pInput->processCreateNodeFp;
140,930✔
80
  pMgmt->processAlterNodeFp = pInput->processAlterNodeFp;
140,930✔
81
  pMgmt->processAlterNodeTypeFp = pInput->processAlterNodeTypeFp;
140,930✔
82
  pMgmt->processDropNodeFp = pInput->processDropNodeFp;
140,930✔
83
  pMgmt->sendMonitorReportFp = pInput->sendMonitorReportFp;
140,930✔
84
  pMgmt->sendMetricsReportFp = pInput->sendMetricsReportFp;
140,930✔
85
  pMgmt->monitorCleanExpiredSamplesFp = pInput->monitorCleanExpiredSamplesFp;
140,930✔
86
  pMgmt->metricsCleanExpiredSamplesFp = pInput->metricsCleanExpiredSamplesFp;
140,930✔
87
  pMgmt->sendAuditRecordsFp = pInput->sendAuditRecordFp;
140,930✔
88
  pMgmt->getVnodeLoadsFp = pInput->getVnodeLoadsFp;
140,930✔
89
  pMgmt->getVnodeLoadsLiteFp = pInput->getVnodeLoadsLiteFp;
140,930✔
90
  pMgmt->getMnodeLoadsFp = pInput->getMnodeLoadsFp;
140,930✔
91
  pMgmt->getQnodeLoadsFp = pInput->getQnodeLoadsFp;
140,930✔
92
  pMgmt->setMnodeSyncTimeoutFp = pInput->setMnodeSyncTimeoutFp;
140,930✔
93
  pMgmt->setVnodeSyncTimeoutFp = pInput->setVnodeSyncTimeoutFp;
140,930✔
94

95
  if ((code = dmStartWorker(pMgmt)) != 0) {
140,930!
96
    return code;
×
97
  }
98

99
  if ((code = udfStartUdfd(pMgmt->pData->dnodeId)) != 0) {
140,930!
UNCOV
100
    dError("failed to start taosudf since %s", tstrerror(code));
×
101
  }
102

103
  if ((code = taosAnalyticsInit()) != 0) {
140,930!
104
    dError("failed to init analysis env since %s", tstrerror(code));
×
105
  }
106

107
  pOutput->pMgmt = pMgmt;
140,930✔
108
  return 0;
140,930✔
109
}
110

111
static void dmCloseMgmt(SDnodeMgmt *pMgmt) {
140,930✔
112
  dmStopWorker(pMgmt);
140,930✔
113
  taosMemoryFree(pMgmt);
140,930!
114
}
140,930✔
115

116
static int32_t dmRequireMgmt(const SMgmtInputOpt *pInput, bool *required) {
141,011✔
117
  *required = true;
141,011✔
118
  return 0;
141,011✔
119
}
120

121
SMgmtFunc dmGetMgmtFunc() {
141,011✔
122
  SMgmtFunc mgmtFunc = {0};
141,011✔
123
  mgmtFunc.openFp = dmOpenMgmt;
141,011✔
124
  mgmtFunc.closeFp = (NodeCloseFp)dmCloseMgmt;
141,011✔
125
  mgmtFunc.startFp = (NodeStartFp)dmStartMgmt;
141,011✔
126
  mgmtFunc.stopFp = (NodeStopFp)dmStopMgmt;
141,011✔
127
  mgmtFunc.requiredFp = dmRequireMgmt;
141,011✔
128
  mgmtFunc.getHandlesFp = dmGetMsgHandles;
141,011✔
129

130
  return mgmtFunc;
141,011✔
131
}
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