diff --git a/src/dnode/inc/dnodeCheck.h b/src/dnode/inc/dnodeCheck.h index 73f6423134aefd8918f8bebde9ff1df22b7c4074..a4880b3c114342c8900337372bd1dfd07e7815b7 100644 --- a/src/dnode/inc/dnodeCheck.h +++ b/src/dnode/inc/dnodeCheck.h @@ -21,7 +21,6 @@ extern "C" { #endif int32_t dnodeInitCheck(); -void dnodeStartCheck(); void dnodeCleanupCheck(); #ifdef __cplusplus diff --git a/src/dnode/src/dnodeCheck.c b/src/dnode/src/dnodeCheck.c index ce03fd093b6084df838854828f053770f24e7a0f..a5b6fa09dd5196ccfd088ddc1e628ef8495ea995 100644 --- a/src/dnode/src/dnodeCheck.c +++ b/src/dnode/src/dnodeCheck.c @@ -14,12 +14,6 @@ */ #define _DEFAULT_SOURCE -#include -#include -#include -#include -#include - #include "os.h" #include "taosdef.h" #include "tglobal.h" @@ -59,7 +53,6 @@ static int bindTcpPort(int port) { return -1; } - if (listen(serverSocket, 5) < 0) { dError("port:%d listen() fail: %s", port, strerror(errno)); close(serverSocket); @@ -101,10 +94,12 @@ static int dnodeCheckNetwork() { for (int port = startPort; port < startPort + 12; port++) { ret = bindTcpPort(port); if (0 != ret) { + dError("failed to tcp bind port %d, quit", port); return -1; } ret = bindUdpPort(port); if (0 != ret) { + dError("failed to udp bind port %d, quit", port); return -1; } } @@ -258,10 +253,6 @@ int32_t dnodeInitCheck() { } } - return 0; -} - -void dnodeStartCheck() { for (ECheckItemType index = 0; index < TSDB_CHECK_ITEM_MAX; ++index) { if (tsCheckItem[index].enable && tsCheckItem[index].startFp) { if ((*tsCheckItem[index].startFp)() != 0) { @@ -270,6 +261,9 @@ void dnodeStartCheck() { } } } + + return 0; } + diff --git a/src/dnode/src/dnodeMain.c b/src/dnode/src/dnodeMain.c index 9d2249348522d3f242d79ed6f5db823d502f6cbb..dded10bd1c7c8e1ea0448e942175e92b7e09a169 100644 --- a/src/dnode/src/dnodeMain.c +++ b/src/dnode/src/dnodeMain.c @@ -49,6 +49,7 @@ typedef struct { } SDnodeComponent; static const SDnodeComponent tsDnodeComponents[] = { + {"check", dnodeInitCheck, dnodeCleanupCheck}, // NOTES: dnodeInitCheck must be first component !!! {"storage", dnodeInitStorage, dnodeCleanupStorage}, {"vread", dnodeInitVnodeRead, dnodeCleanupVnodeRead}, {"vwrite", dnodeInitVnodeWrite, dnodeCleanupVnodeWrite}, @@ -62,7 +63,6 @@ static const SDnodeComponent tsDnodeComponents[] = { {"mgmt-tmr", dnodeInitMgmtTimer, dnodeCleanupMgmtTimer}, {"shell", dnodeInitShell, dnodeCleanupShell}, {"telemetry", dnodeInitTelemetry, dnodeCleanupTelemetry}, - {"check", dnodeInitCheck, dnodeCleanupCheck}, }; static int dnodeCreateDir(const char *dir) { @@ -125,7 +125,6 @@ int32_t dnodeInitSystem() { return -1; } - dnodeStartCheck(); dnodeStartModules(); dnodeSetRunStatus(TSDB_DNODE_RUN_STATUS_RUNING);