提交 e7bd0ca7 编写于 作者: H Hui Li

[TD-662]

上级 bb8a92e8
...@@ -21,7 +21,6 @@ extern "C" { ...@@ -21,7 +21,6 @@ extern "C" {
#endif #endif
int32_t dnodeInitCheck(); int32_t dnodeInitCheck();
void dnodeStartCheck();
void dnodeCleanupCheck(); void dnodeCleanupCheck();
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -14,12 +14,6 @@ ...@@ -14,12 +14,6 @@
*/ */
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include <stdio.h>
#include <sys/statfs.h>
#include <sys/vfs.h>
#include <sys/sysinfo.h>
#include <errno.h>
#include "os.h" #include "os.h"
#include "taosdef.h" #include "taosdef.h"
#include "tglobal.h" #include "tglobal.h"
...@@ -59,7 +53,6 @@ static int bindTcpPort(int port) { ...@@ -59,7 +53,6 @@ static int bindTcpPort(int port) {
return -1; return -1;
} }
if (listen(serverSocket, 5) < 0) { if (listen(serverSocket, 5) < 0) {
dError("port:%d listen() fail: %s", port, strerror(errno)); dError("port:%d listen() fail: %s", port, strerror(errno));
close(serverSocket); close(serverSocket);
...@@ -101,10 +94,12 @@ static int dnodeCheckNetwork() { ...@@ -101,10 +94,12 @@ static int dnodeCheckNetwork() {
for (int port = startPort; port < startPort + 12; port++) { for (int port = startPort; port < startPort + 12; port++) {
ret = bindTcpPort(port); ret = bindTcpPort(port);
if (0 != ret) { if (0 != ret) {
dError("failed to tcp bind port %d, quit", port);
return -1; return -1;
} }
ret = bindUdpPort(port); ret = bindUdpPort(port);
if (0 != ret) { if (0 != ret) {
dError("failed to udp bind port %d, quit", port);
return -1; return -1;
} }
} }
...@@ -258,10 +253,6 @@ int32_t dnodeInitCheck() { ...@@ -258,10 +253,6 @@ int32_t dnodeInitCheck() {
} }
} }
return 0;
}
void dnodeStartCheck() {
for (ECheckItemType index = 0; index < TSDB_CHECK_ITEM_MAX; ++index) { for (ECheckItemType index = 0; index < TSDB_CHECK_ITEM_MAX; ++index) {
if (tsCheckItem[index].enable && tsCheckItem[index].startFp) { if (tsCheckItem[index].enable && tsCheckItem[index].startFp) {
if ((*tsCheckItem[index].startFp)() != 0) { if ((*tsCheckItem[index].startFp)() != 0) {
...@@ -270,6 +261,9 @@ void dnodeStartCheck() { ...@@ -270,6 +261,9 @@ void dnodeStartCheck() {
} }
} }
} }
return 0;
} }
...@@ -49,6 +49,7 @@ typedef struct { ...@@ -49,6 +49,7 @@ typedef struct {
} SDnodeComponent; } SDnodeComponent;
static const SDnodeComponent tsDnodeComponents[] = { static const SDnodeComponent tsDnodeComponents[] = {
{"check", dnodeInitCheck, dnodeCleanupCheck}, // NOTES: dnodeInitCheck must be first component !!!
{"storage", dnodeInitStorage, dnodeCleanupStorage}, {"storage", dnodeInitStorage, dnodeCleanupStorage},
{"vread", dnodeInitVnodeRead, dnodeCleanupVnodeRead}, {"vread", dnodeInitVnodeRead, dnodeCleanupVnodeRead},
{"vwrite", dnodeInitVnodeWrite, dnodeCleanupVnodeWrite}, {"vwrite", dnodeInitVnodeWrite, dnodeCleanupVnodeWrite},
...@@ -62,7 +63,6 @@ static const SDnodeComponent tsDnodeComponents[] = { ...@@ -62,7 +63,6 @@ static const SDnodeComponent tsDnodeComponents[] = {
{"mgmt-tmr", dnodeInitMgmtTimer, dnodeCleanupMgmtTimer}, {"mgmt-tmr", dnodeInitMgmtTimer, dnodeCleanupMgmtTimer},
{"shell", dnodeInitShell, dnodeCleanupShell}, {"shell", dnodeInitShell, dnodeCleanupShell},
{"telemetry", dnodeInitTelemetry, dnodeCleanupTelemetry}, {"telemetry", dnodeInitTelemetry, dnodeCleanupTelemetry},
{"check", dnodeInitCheck, dnodeCleanupCheck},
}; };
static int dnodeCreateDir(const char *dir) { static int dnodeCreateDir(const char *dir) {
...@@ -125,7 +125,6 @@ int32_t dnodeInitSystem() { ...@@ -125,7 +125,6 @@ int32_t dnodeInitSystem() {
return -1; return -1;
} }
dnodeStartCheck();
dnodeStartModules(); dnodeStartModules();
dnodeSetRunStatus(TSDB_DNODE_RUN_STATUS_RUNING); dnodeSetRunStatus(TSDB_DNODE_RUN_STATUS_RUNING);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册