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

taosdata / TDengine / #3610

12 Feb 2025 09:54AM UTC coverage: 54.713% (-8.4%) from 63.066%
#3610

push

travis-ci

web-flow
Merge pull request #29745 from taosdata/fix/TD33664-3.0

fix: --version show information check for 3.0

120957 of 286549 branches covered (42.21%)

Branch coverage included in aggregate %.

190849 of 283342 relevant lines covered (67.36%)

4969786.97 hits per line

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

71.43
/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) {
1,288✔
22
  int32_t code = 0;
1,288✔
23
  if ((code = dmStartStatusThread(pMgmt)) != 0) {
1,288!
24
    return code;
×
25
  }
26

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

50
static void dmStopMgmt(SDnodeMgmt *pMgmt) {
1,288✔
51
  pMgmt->pData->stopped = true;
1,288✔
52
  dmStopMonitorThread(pMgmt);
1,288✔
53
  dmStopAuditThread(pMgmt);
1,288✔
54
  dmStopStatusThread(pMgmt);
1,288✔
55
  dmStopConfigThread(pMgmt);
1,288✔
56
  dmStopStatusInfoThread(pMgmt);
1,288✔
57
#if defined(TD_ENTERPRISE)
58
  dmStopNotifyThread(pMgmt);
1,288✔
59
#endif
60
  dmStopCrashReportThread(pMgmt);
1,288✔
61
}
1,288✔
62

63
static int32_t dmOpenMgmt(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) {
1,288✔
64
  int32_t     code = 0;
1,288✔
65
  SDnodeMgmt *pMgmt = taosMemoryCalloc(1, sizeof(SDnodeMgmt));
1,288!
66
  if (pMgmt == NULL) {
1,288!
67
    return terrno;
×
68
  }
69

70
  pMgmt->pData = pInput->pData;
1,288✔
71
  pMgmt->msgCb = pInput->msgCb;
1,288✔
72
  pMgmt->pTfs = pInput->pTfs;
1,288✔
73
  pMgmt->path = pInput->path;
1,288✔
74
  pMgmt->name = pInput->name;
1,288✔
75
  pMgmt->processCreateNodeFp = pInput->processCreateNodeFp;
1,288✔
76
  pMgmt->processAlterNodeTypeFp = pInput->processAlterNodeTypeFp;
1,288✔
77
  pMgmt->processDropNodeFp = pInput->processDropNodeFp;
1,288✔
78
  pMgmt->sendMonitorReportFp = pInput->sendMonitorReportFp;
1,288✔
79
  pMgmt->monitorCleanExpiredSamplesFp = pInput->monitorCleanExpiredSamplesFp;
1,288✔
80
  pMgmt->sendAuditRecordsFp = pInput->sendAuditRecordFp;
1,288✔
81
  pMgmt->getVnodeLoadsFp = pInput->getVnodeLoadsFp;
1,288✔
82
  pMgmt->getVnodeLoadsLiteFp = pInput->getVnodeLoadsLiteFp;
1,288✔
83
  pMgmt->getMnodeLoadsFp = pInput->getMnodeLoadsFp;
1,288✔
84
  pMgmt->getQnodeLoadsFp = pInput->getQnodeLoadsFp;
1,288✔
85

86
  if ((code = dmStartWorker(pMgmt)) != 0) {
1,288!
87
    return code;
×
88
  }
89

90
  if ((code = udfStartUdfd(pMgmt->pData->dnodeId)) != 0) {
1,288!
91
    dError("failed to start udfd since %s", tstrerror(code));
×
92
  }
93

94
  if ((code = taosAnalyticsInit()) != 0) {
1,288!
95
    dError("failed to init analysis env since %s", tstrerror(code));
×
96
  }
97

98
  pOutput->pMgmt = pMgmt;
1,288✔
99
  return 0;
1,288✔
100
}
101

102
static void dmCloseMgmt(SDnodeMgmt *pMgmt) {
1,288✔
103
  dmStopWorker(pMgmt);
1,288✔
104
  taosMemoryFree(pMgmt);
1,288!
105
}
1,288✔
106

107
static int32_t dmRequireMgmt(const SMgmtInputOpt *pInput, bool *required) {
1,291✔
108
  *required = true;
1,291✔
109
  return 0;
1,291✔
110
}
111

112
SMgmtFunc dmGetMgmtFunc() {
1,291✔
113
  SMgmtFunc mgmtFunc = {0};
1,291✔
114
  mgmtFunc.openFp = dmOpenMgmt;
1,291✔
115
  mgmtFunc.closeFp = (NodeCloseFp)dmCloseMgmt;
1,291✔
116
  mgmtFunc.startFp = (NodeStartFp)dmStartMgmt;
1,291✔
117
  mgmtFunc.stopFp = (NodeStopFp)dmStopMgmt;
1,291✔
118
  mgmtFunc.requiredFp = dmRequireMgmt;
1,291✔
119
  mgmtFunc.getHandlesFp = dmGetMsgHandles;
1,291✔
120

121
  return mgmtFunc;
1,291✔
122
}
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