diff --git a/include/common/tgrant.h b/include/common/tgrant.h index ca9e030117..ac0d3155c7 100644 --- a/include/common/tgrant.h +++ b/include/common/tgrant.h @@ -61,9 +61,6 @@ typedef enum { int32_t grantCheck(EGrantType grant); int32_t grantCheckExpire(EGrantType grant); char* tGetMachineId(); -#ifdef TD_UNIQ_GRANT -int32_t grantCheckLE(EGrantType grant); -#endif // #ifndef GRANTS_CFG #ifdef TD_ENTERPRISE @@ -76,7 +73,7 @@ int32_t grantCheckLE(EGrantType grant); {.name = "state", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ {.name = "timeseries", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ {.name = "dnodes", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ - {.name = "cpu_cores", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ + {.name = "cpu_cores", .bytes = 13 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ } #else #define GRANTS_SCHEMA \ @@ -88,7 +85,7 @@ int32_t grantCheckLE(EGrantType grant); {.name = "state", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ {.name = "timeseries", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ {.name = "dnodes", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ - {.name = "cpu_cores", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ + {.name = "cpu_cores", .bytes = 13 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, \ } #endif // #define GRANT_CFG_ADD diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 25cc5d7c79..8ef0d1061c 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -363,6 +363,9 @@ static const SSysDbTableSchema useGrantsLogsSchema[] = { static const SSysDbTableSchema useMachinesSchema[] = { {.name = "id", .bytes = TSDB_CLUSTER_ID_LEN + 1 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, +#ifndef TD_UNIQ_GRANT + {.name = "machine_num", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true}, +#endif {.name = "machine", .bytes = 7552 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, }; diff --git a/source/common/src/tgrant.c b/source/common/src/tgrant.c index 2b5d91788e..fa1a7d90b7 100644 --- a/source/common/src/tgrant.c +++ b/source/common/src/tgrant.c @@ -21,11 +21,5 @@ int32_t grantCheck(EGrantType grant) { return TSDB_CODE_SUCCESS; } int32_t grantCheckExpire(EGrantType grant) { return TSDB_CODE_SUCCESS; } -#ifdef TD_UNIQ_GRANT -int32_t grantCheckLE(EGrantType grant) { return TSDB_CODE_SUCCESS; } -#endif #else -#ifdef TD_UNIQ_GRANT -int32_t grantCheckExpire(EGrantType grant) { return TSDB_CODE_SUCCESS; } -#endif #endif \ No newline at end of file diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index eae02125d2..16ca1b64c3 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -41,6 +41,12 @@ #define LOG_BUF_SIZE(x) ((x)->buffSize) #define LOG_BUF_MUTEX(x) ((x)->buffMutex) +#ifdef TD_ENTERPRISE +#define LOG_EDITION_FLG ("E") +#else +#define LOG_EDITION_FLG ("C") +#endif + typedef struct { char *buffer; int32_t buffStart; @@ -490,8 +496,9 @@ static inline int32_t taosBuildLogHead(char *buffer, const char *flags) { time_t curTime = timeSecs.tv_sec; ptm = taosLocalTime(&curTime, &Tm, NULL); - return sprintf(buffer, "%02d/%02d %02d:%02d:%02d.%06d %08" PRId64 " %s", ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_hour, - ptm->tm_min, ptm->tm_sec, (int32_t)timeSecs.tv_usec, taosGetSelfPthreadId(), flags); + return sprintf(buffer, "%02d/%02d %02d:%02d:%02d.%06d %08" PRId64 " %s %s", ptm->tm_mon + 1, ptm->tm_mday, + ptm->tm_hour, ptm->tm_min, ptm->tm_sec, (int32_t)timeSecs.tv_usec, taosGetSelfPthreadId(), + LOG_EDITION_FLG, flags); } static inline void taosPrintLogImp(ELogLevel level, int32_t dflag, const char *buffer, int32_t len) {