diff --git a/src/mnode/inc/mgmtLog.h b/src/mnode/inc/mgmtInt.h similarity index 53% rename from src/mnode/inc/mgmtLog.h rename to src/mnode/inc/mgmtInt.h index a99fa225933b7935f463352a8ca58e92b44d1b97..17553ade721dd526717220033c3a212eec6f4e1a 100644 --- a/src/mnode/inc/mgmtLog.h +++ b/src/mnode/inc/mgmtInt.h @@ -27,39 +27,19 @@ extern int32_t mdebugFlag; extern int32_t sdbDebugFlag; // mnode log function -#define mError(...) \ - if (mdebugFlag & DEBUG_ERROR) { \ - taosPrintLog("ERROR MND ", 255, __VA_ARGS__); \ - } -#define mWarn(...) \ - if (mdebugFlag & DEBUG_WARN) { \ - taosPrintLog("WARN MND ", mdebugFlag, __VA_ARGS__); \ - } -#define mTrace(...) \ - if (mdebugFlag & DEBUG_TRACE) { \ - taosPrintLog("MND ", mdebugFlag, __VA_ARGS__); \ - } -#define mPrint(...) \ - { taosPrintLog("MND ", 255, __VA_ARGS__); } +#define mError(...) if (mdebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR MND ", 255, __VA_ARGS__); } +#define mWarn(...) if (mdebugFlag & DEBUG_WARN) { taosPrintLog("WARN MND ", mdebugFlag, __VA_ARGS__); } +#define mTrace(...) if (mdebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", mdebugFlag, __VA_ARGS__); } +#define mPrint(...) { taosPrintLog("MND ", 255, __VA_ARGS__); } #define mLError(...) monitorSaveLog(2, __VA_ARGS__); mError(__VA_ARGS__) #define mLWarn(...) monitorSaveLog(1, __VA_ARGS__); mWarn(__VA_ARGS__) #define mLPrint(...) monitorSaveLog(0, __VA_ARGS__); mPrint(__VA_ARGS__) -#define sdbError(...) \ - if (sdbDebugFlag & DEBUG_ERROR) { \ - taosPrintLog("ERROR MND-SDB ", 255, __VA_ARGS__); \ - } -#define sdbWarn(...) \ - if (sdbDebugFlag & DEBUG_WARN) { \ - taosPrintLog("WARN MND-SDB ", sdbDebugFlag, __VA_ARGS__); \ - } -#define sdbTrace(...) \ - if (sdbDebugFlag & DEBUG_TRACE) { \ - taosPrintLog("MND-SDB ", sdbDebugFlag, __VA_ARGS__); \ - } -#define sdbPrint(...) \ - { taosPrintLog("MND-SDB ", 255, __VA_ARGS__); } +#define sdbError(...) if (sdbDebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR MND-SDB ", 255, __VA_ARGS__); } +#define sdbWarn(...) if (sdbDebugFlag & DEBUG_WARN) { taosPrintLog("WARN MND-SDB ", sdbDebugFlag, __VA_ARGS__); } +#define sdbTrace(...) if (sdbDebugFlag & DEBUG_TRACE) { taosPrintLog("MND-SDB ", sdbDebugFlag, __VA_ARGS__);} +#define sdbPrint(...) { taosPrintLog("MND-SDB ", 255, __VA_ARGS__); } #define sdbLError(...) monitorSaveLog(2, __VA_ARGS__); sdbError(__VA_ARGS__) #define sdbLWarn(...) monitorSaveLog(1, __VA_ARGS__); sdbWarn(__VA_ARGS__) diff --git a/src/mnode/src/mgmtAcct.c b/src/mnode/src/mgmtAcct.c index 9b7815af120cff534137328208502e215414c482..1cacec96eee5d724109daa5428afdc0a20b03b5d 100644 --- a/src/mnode/src/mgmtAcct.c +++ b/src/mnode/src/mgmtAcct.c @@ -20,7 +20,7 @@ #include "tutil.h" #include "dnode.h" #include "mgmtDef.h" -#include "mgmtLog.h" +#include "mgmtInt.h" #include "mgmtAcct.h" #include "mgmtDb.h" #include "mgmtSdb.h" diff --git a/src/mnode/src/mgmtBalance.c b/src/mnode/src/mgmtBalance.c index d16a06fc5cc2a8241623c621c918794e56f4c01f..ff5b4008bbcbef3a8620e0ec95e2dc6ae991f7f6 100644 --- a/src/mnode/src/mgmtBalance.c +++ b/src/mnode/src/mgmtBalance.c @@ -19,7 +19,7 @@ #include "tbalance.h" #include "tglobal.h" #include "mgmtDef.h" -#include "mgmtLog.h" +#include "mgmtInt.h" #include "mgmtMnode.h" #include "mgmtDnode.h" #include "mgmtVgroup.h" diff --git a/src/mnode/src/mgmtDb.c b/src/mnode/src/mgmtDb.c index 5cee1f30cda5984ee8cda49eac9c4790dafa4946..8c6a80eb615e6ee9f4ea96c71474dec5437fbb13 100644 --- a/src/mnode/src/mgmtDb.c +++ b/src/mnode/src/mgmtDb.c @@ -25,7 +25,7 @@ #include "tbalance.h" #include "tdataformat.h" #include "mgmtDef.h" -#include "mgmtLog.h" +#include "mgmtInt.h" #include "mgmtAcct.h" #include "mgmtDb.h" #include "mgmtDnode.h" diff --git a/src/mnode/src/mgmtDnode.c b/src/mnode/src/mgmtDnode.c index 030123b804869d8afb1be0d1b632be10efca8d0b..a170aa2d02d1d12107c212930c0797e80c2aaa6e 100644 --- a/src/mnode/src/mgmtDnode.c +++ b/src/mnode/src/mgmtDnode.c @@ -27,7 +27,7 @@ #include "tdataformat.h" #include "dnode.h" #include "mgmtDef.h" -#include "mgmtLog.h" +#include "mgmtInt.h" #include "mgmtDnode.h" #include "mgmtMnode.h" #include "mgmtSdb.h" diff --git a/src/mnode/src/mgmtGrant.c b/src/mnode/src/mgmtGrant.c index 449799ef9572efbe3d1584550a3f4a35822e6ecb..f44b47e20c9b516ebb81b84e488664d74bdca8f5 100644 --- a/src/mnode/src/mgmtGrant.c +++ b/src/mnode/src/mgmtGrant.c @@ -18,7 +18,7 @@ #include "os.h" #include "taoserror.h" #include "tgrant.h" -#include "mgmtLog.h" +#include "mgmtInt.h" int32_t grantInit() { return TSDB_CODE_SUCCESS; } void grantCleanUp() {} diff --git a/src/mnode/src/mgmtMain.c b/src/mnode/src/mgmtMain.c index aa95381df3759e3861bc1d7211ddebaee1894a51..37edddec107904fbc3ef9c5de0fa476892a391a0 100644 --- a/src/mnode/src/mgmtMain.c +++ b/src/mnode/src/mgmtMain.c @@ -23,7 +23,7 @@ #include "tglobal.h" #include "dnode.h" #include "mgmtDef.h" -#include "mgmtLog.h" +#include "mgmtInt.h" #include "mgmtServer.h" #include "mgmtAcct.h" #include "mgmtDnode.h" diff --git a/src/mnode/src/mgmtMnode.c b/src/mnode/src/mgmtMnode.c index f28e286f79502fb41ab82507f96f8473b545073b..a78e5574c065b5a1b05d94cbff364a70662164e4 100644 --- a/src/mnode/src/mgmtMnode.c +++ b/src/mnode/src/mgmtMnode.c @@ -24,7 +24,7 @@ #include "tsocket.h" #include "tdataformat.h" #include "mgmtDef.h" -#include "mgmtLog.h" +#include "mgmtInt.h" #include "mgmtMnode.h" #include "mgmtDnode.h" #include "mgmtSdb.h" diff --git a/src/mnode/src/mgmtProfile.c b/src/mnode/src/mgmtProfile.c index 77871f037bcd5e39993febc83082c728e3b773fc..64ac8ed71058e6ef269d337585bfb7c4a8044a2c 100644 --- a/src/mnode/src/mgmtProfile.c +++ b/src/mnode/src/mgmtProfile.c @@ -19,7 +19,7 @@ #include "taoserror.h" #include "tutil.h" #include "mgmtDef.h" -#include "mgmtLog.h" +#include "mgmtInt.h" #include "mgmtAcct.h" #include "mgmtDnode.h" #include "mgmtDb.h" diff --git a/src/mnode/src/mgmtSdb.c b/src/mnode/src/mgmtSdb.c index fe25699b5f43e5a76a5894c6e399f403ea92ffc8..d2a5287f138a112c8aac2bd1fae1b9b8c8a6a6d6 100644 --- a/src/mnode/src/mgmtSdb.c +++ b/src/mnode/src/mgmtSdb.c @@ -27,7 +27,7 @@ #include "hashstr.h" #include "dnode.h" #include "mgmtDef.h" -#include "mgmtLog.h" +#include "mgmtInt.h" #include "mgmtMnode.h" #include "mgmtSdb.h" diff --git a/src/mnode/src/mgmtServer.c b/src/mnode/src/mgmtServer.c index 2fa6e68f6593e5cd38add2745096606dc1a5447e..a6b4362cbf08cfd6ca49777b0c26f23e3bb0fc17 100644 --- a/src/mnode/src/mgmtServer.c +++ b/src/mnode/src/mgmtServer.c @@ -25,7 +25,7 @@ #include "tglobal.h" #include "dnode.h" #include "mgmtDef.h" -#include "mgmtLog.h" +#include "mgmtInt.h" #include "mgmtDb.h" #include "mgmtMnode.h" #include "mgmtProfile.h" diff --git a/src/mnode/src/mgmtShell.c b/src/mnode/src/mgmtShell.c index 7264c850274609969254800592907081c994c7d9..3cb0225b970fa76ba307fa22e0180f93e0720fd9 100644 --- a/src/mnode/src/mgmtShell.c +++ b/src/mnode/src/mgmtShell.c @@ -26,7 +26,7 @@ #include "tcache.h" #include "dnode.h" #include "mgmtDef.h" -#include "mgmtLog.h" +#include "mgmtInt.h" #include "mgmtAcct.h" #include "mgmtDb.h" #include "mgmtDnode.h" diff --git a/src/mnode/src/mgmtTable.c b/src/mnode/src/mgmtTable.c index e9fdee7a0f0bb89e7600325396b6f448cbfb88c7..2225e08f58c4d94c75027280c545d99792870594 100644 --- a/src/mnode/src/mgmtTable.c +++ b/src/mnode/src/mgmtTable.c @@ -26,7 +26,7 @@ #include "tglobal.h" #include "dnode.h" #include "mgmtDef.h" -#include "mgmtLog.h" +#include "mgmtInt.h" #include "mgmtAcct.h" #include "mgmtDb.h" #include "mgmtDnode.h" diff --git a/src/mnode/src/mgmtUser.c b/src/mnode/src/mgmtUser.c index ecd3c217cae6af01ec1fc9a47de03a2d652377f7..b0e58a50525733f1659d581c727e58dc0aa793b2 100644 --- a/src/mnode/src/mgmtUser.c +++ b/src/mnode/src/mgmtUser.c @@ -23,7 +23,7 @@ #include "tdataformat.h" #include "dnode.h" #include "mgmtDef.h" -#include "mgmtLog.h" +#include "mgmtInt.h" #include "mgmtAcct.h" #include "mgmtMnode.h" #include "mgmtSdb.h" diff --git a/src/mnode/src/mgmtVgroup.c b/src/mnode/src/mgmtVgroup.c index 6be2a734440cbf1c9b7360a9f9a30a61614fb672..cbe235a26a75f463e9af14b487f4adb0bb5c87b4 100644 --- a/src/mnode/src/mgmtVgroup.c +++ b/src/mnode/src/mgmtVgroup.c @@ -26,7 +26,7 @@ #include "dnode.h" #include "tdataformat.h" #include "mgmtDef.h" -#include "mgmtLog.h" +#include "mgmtInt.h" #include "mgmtDb.h" #include "mgmtDnode.h" #include "mgmtMnode.h" diff --git a/src/os/linux/src/linuxSysPara.c b/src/os/linux/src/linuxSysPara.c index f43ed44a4bab19a8db80bc89fbb5074531edc514..6bab418385655f4869223033ae993ee4953cfb51 100644 --- a/src/os/linux/src/linuxSysPara.c +++ b/src/os/linux/src/linuxSysPara.c @@ -356,10 +356,15 @@ static bool taosGetCardName(char *ip, char *name) { break; } - if (strcmp(host, ip) == 0) { - strcpy(name, ifa->ifa_name); - ret = true; + if (strcmp(host, "127.0.0.1") == 0) { + continue; } + + // TODO: the ip not config + // if (strcmp(host, ip) == 0) { + strcpy(name, ifa->ifa_name); + ret = true; + // } } freeifaddrs(ifaddr); diff --git a/src/plugins/monitor/src/monitorMain.c b/src/plugins/monitor/src/monitorMain.c index 7836dbae85369bac1dceec392f3f8da8ae4ce2df..35787d1dfeedc59c9ac1a2c32c41412bbf1538ad 100644 --- a/src/plugins/monitor/src/monitorMain.c +++ b/src/plugins/monitor/src/monitorMain.c @@ -43,7 +43,7 @@ { taosPrintLog("MON ", 255, __VA_ARGS__); } #define SQL_LENGTH 1024 -#define LOG_LEN_STR 80 +#define LOG_LEN_STR 100 #define IP_LEN_STR 18 #define CHECK_INTERVAL 1000 @@ -148,8 +148,8 @@ static void dnodeBuildMonitorSql(char *sql, int32_t cmd) { if (cmd == MONITOR_CMD_CREATE_DB) { snprintf(sql, SQL_LENGTH, - "create database if not exists %s replica 1 days 10 keep 30 cache 2 " - "blocks 2 maxtables 32 precision 'us'", + "create database if not exists %s replica 1 days 10 keep 30 cache 1 " + "blocks 2 maxtables 16 precision 'us'", tsMonitorDbName); } else if (cmd == MONITOR_CMD_CREATE_MT_DN) { snprintf(sql, SQL_LENGTH, @@ -407,7 +407,7 @@ void monitorSaveLog(int32_t level, const char *const format, ...) { if (tsMonitorConn.state != MONITOR_STATE_INITIALIZED) return; - int32_t len = snprintf(sql, (size_t)max_length, "import into %s.log values(%" PRId64 ", %d,'", tsMonitorDbName, + int32_t len = snprintf(sql, (size_t)max_length, "insert into %s.log values(%" PRId64 ", %d,'", tsMonitorDbName, taosGetTimestampUs(), level); va_start(argpointer, format);