enh: logs and show grants
This commit is contained in:
parent
993a340f3d
commit
3aa37460c7
|
@ -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
|
||||
|
|
|
@ -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},
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue