other: merge 3.0
This commit is contained in:
commit
60f5056ab7
|
@ -176,6 +176,14 @@ IF(APPLE)
|
|||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
ENDIF()
|
||||
|
||||
IF(TD_WINDOWS)
|
||||
IF(MSVC)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:8388608")
|
||||
ELSEIF(MINGW)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,8388608")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
MESSAGE(STATUS "Platform arch:" ${PLATFORM_ARCH_STR})
|
||||
|
||||
set(TD_DEPS_DIR "x86")
|
||||
|
|
|
@ -12,7 +12,7 @@ The FQDN of all hosts must be setup properly. For e.g. FQDNs may have to be conf
|
|||
|
||||
### Step 1
|
||||
|
||||
If any previous version of TDengine has been installed and configured on any host, the installation needs to be removed and the data needs to be cleaned up. For details about uninstalling please refer to [Install and Uninstall](/operation/pkg-install). To clean up the data, please use `rm -rf /var/lib/taos/\*` assuming the `dataDir` is configured as `/var/lib/taos`.
|
||||
If any previous version of TDengine has been installed and configured on any host, the installation needs to be removed and the data needs to be cleaned up. For details about uninstalling please refer to [Install and Uninstall](../../operation/pkg-install). To clean up the data, please use `rm -rf /var/lib/taos/\*` assuming the `dataDir` is configured as `/var/lib/taos`.
|
||||
|
||||
:::note
|
||||
FQDN information is written to file. If you have started TDengine without configuring or changing the FQDN, ensure that data is backed up or no longer needed before running the `rm -rf /var/lib\taos/\*` command.
|
||||
|
|
|
@ -13,7 +13,7 @@ taosBenchmark (formerly taosdemo ) is a tool for testing the performance of TDen
|
|||
|
||||
There are two ways to install taosBenchmark:
|
||||
|
||||
- Installing the official TDengine installer will automatically install taosBenchmark. Please refer to [TDengine installation](/operation/pkg-install) for details.
|
||||
- Installing the official TDengine installer will automatically install taosBenchmark. Please refer to [TDengine installation](../../operation/pkg-install) for details.
|
||||
|
||||
- Compile taos-tools separately and install them. Please refer to the [taos-tools](https://github.com/taosdata/taos-tools) repository for details.
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ taosKeeper is a tool for TDengine that exports monitoring metrics. With taosKeep
|
|||
There are two ways to install taosKeeper:
|
||||
Methods of installing taosKeeper:
|
||||
|
||||
- Installing the official TDengine installer will automatically install taosKeeper. Please refer to [TDengine installation](/operation/pkg-install) for details.
|
||||
- Installing the official TDengine installer will automatically install taosKeeper. Please refer to [TDengine installation](../../operation/pkg-install) for details.
|
||||
|
||||
- You can compile taosKeeper separately and install it. Please refer to the [taosKeeper](https://github.com/taosdata/taoskeeper) repository for details.
|
||||
## Configuration and Launch
|
||||
|
|
|
@ -21,7 +21,7 @@ TDengine Source Connector is used to read data from TDengine in real-time and se
|
|||
1. Linux operating system
|
||||
2. Java 8 and Maven installed
|
||||
3. Git/curl/vi is installed
|
||||
4. TDengine is installed and started. If not, please refer to [Installation and Uninstallation](/operation/pkg-install)
|
||||
4. TDengine is installed and started. If not, please refer to [Installation and Uninstallation](../../operation/pkg-install)
|
||||
|
||||
## Install Kafka
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ taosBenchmark (曾用名 taosdemo ) 是一个用于测试 TDengine 产品性能
|
|||
|
||||
taosBenchmark 有两种安装方式:
|
||||
|
||||
- 安装 TDengine 官方安装包的同时会自动安装 taosBenchmark, 详情请参考 [TDengine 安装](../../get-started/)。
|
||||
- 安装 TDengine 官方安装包的同时会自动安装 taosBenchmark, 详情请参考[ TDengine 安装](../../get-started/)。
|
||||
|
||||
- 单独编译 taos-tools 并安装, 详情请参考 [taos-tools](https://github.com/taosdata/taos-tools) 仓库。
|
||||
|
||||
|
|
|
@ -268,6 +268,13 @@ typedef enum tmq_conf_res_t {
|
|||
TMQ_CONF_OK = 0,
|
||||
} tmq_conf_res_t;
|
||||
|
||||
typedef enum tmq_res_t {
|
||||
TMQ_RES_INVALID = -1,
|
||||
TMQ_RES_DATA = 1,
|
||||
TMQ_RES_TABLE_META = 2,
|
||||
TMQ_RES_METADATA = 3,
|
||||
} tmq_res_t;
|
||||
|
||||
typedef struct tmq_topic_assignment {
|
||||
int32_t vgId;
|
||||
int64_t currentOffset;
|
||||
|
@ -302,6 +309,8 @@ DLL_EXPORT int32_t tmq_offset_seek(tmq_t *tmq, const char *pTopicName, int32_t
|
|||
DLL_EXPORT int64_t tmq_position(tmq_t *tmq, const char *pTopicName, int32_t vgId); // The current offset is the offset of the last consumed message + 1
|
||||
DLL_EXPORT int64_t tmq_committed(tmq_t *tmq, const char *pTopicName, int32_t vgId);
|
||||
|
||||
DLL_EXPORT const char *tmq_get_table_name(TAOS_RES *res);
|
||||
DLL_EXPORT tmq_res_t tmq_get_res_type(TAOS_RES *res);
|
||||
DLL_EXPORT const char *tmq_get_topic_name(TAOS_RES *res);
|
||||
DLL_EXPORT const char *tmq_get_db_name(TAOS_RES *res);
|
||||
DLL_EXPORT int32_t tmq_get_vgroup_id(TAOS_RES *res);
|
||||
|
@ -309,34 +318,22 @@ DLL_EXPORT int64_t tmq_get_vgroup_offset(TAOS_RES* res);
|
|||
DLL_EXPORT const char *tmq_err2str(int32_t code);
|
||||
|
||||
/* ------------------------------ TAOSX -----------------------------------*/
|
||||
// note: following apis are unstable
|
||||
enum tmq_res_t {
|
||||
TMQ_RES_INVALID = -1,
|
||||
TMQ_RES_DATA = 1,
|
||||
TMQ_RES_TABLE_META = 2,
|
||||
TMQ_RES_METADATA = 3,
|
||||
};
|
||||
|
||||
typedef struct tmq_raw_data {
|
||||
void *raw;
|
||||
uint32_t raw_len;
|
||||
uint16_t raw_type;
|
||||
} tmq_raw_data;
|
||||
|
||||
typedef enum tmq_res_t tmq_res_t;
|
||||
|
||||
DLL_EXPORT const char *tmq_get_table_name(TAOS_RES *res);
|
||||
DLL_EXPORT tmq_res_t tmq_get_res_type(TAOS_RES *res);
|
||||
DLL_EXPORT int32_t tmq_get_raw(TAOS_RES *res, tmq_raw_data *raw);
|
||||
DLL_EXPORT int32_t tmq_write_raw(TAOS *taos, tmq_raw_data raw);
|
||||
DLL_EXPORT int taos_write_raw_block(TAOS *taos, int numOfRows, char *pData, const char *tbname);
|
||||
DLL_EXPORT int taos_write_raw_block_with_fields(TAOS *taos, int rows, char *pData, const char *tbname,
|
||||
TAOS_FIELD *fields, int numFields);
|
||||
DLL_EXPORT void tmq_free_raw(tmq_raw_data raw);
|
||||
|
||||
// Returning null means error. Returned result need to be freed by tmq_free_json_meta
|
||||
DLL_EXPORT char *tmq_get_json_meta(TAOS_RES *res);
|
||||
DLL_EXPORT void tmq_free_json_meta(char *jsonMeta);
|
||||
|
||||
/* ---------------------------- TAOSX END -------------------------------- */
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -88,6 +88,7 @@ extern int64_t tsMndLogRetention;
|
|||
extern int8_t tsGrant;
|
||||
extern int32_t tsMndGrantMode;
|
||||
extern bool tsMndSkipGrant;
|
||||
extern bool tsEnableWhiteList;
|
||||
|
||||
// dnode
|
||||
extern int64_t tsDndStart;
|
||||
|
|
|
@ -184,6 +184,8 @@ typedef enum _mgmt_table {
|
|||
#define TSDB_ALTER_USER_REMOVE_WRITE_TABLE 0x10
|
||||
#define TSDB_ALTER_USER_ADD_ALL_TABLE 0x11
|
||||
#define TSDB_ALTER_USER_REMOVE_ALL_TABLE 0x12
|
||||
#define TSDB_ALTER_USER_ADD_WHITE_LIST 0x13
|
||||
#define TSDB_ALTER_USER_DROP_WHITE_LIST 0x14
|
||||
|
||||
#define TSDB_ALTER_USER_PRIVILEGES 0x2
|
||||
|
||||
|
@ -418,10 +420,9 @@ typedef enum ENodeType {
|
|||
QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT,
|
||||
QUERY_NODE_PHYSICAL_PLAN_HASH_JOIN,
|
||||
QUERY_NODE_PHYSICAL_PLAN_GROUP_CACHE,
|
||||
QUERY_NODE_PHYSICAL_PLAN_DYN_QUERY_CTRL
|
||||
QUERY_NODE_PHYSICAL_PLAN_DYN_QUERY_CTRL
|
||||
} ENodeType;
|
||||
|
||||
|
||||
typedef struct {
|
||||
int32_t vgId;
|
||||
char* dbFName;
|
||||
|
@ -874,29 +875,39 @@ typedef struct {
|
|||
int32_t tSerializeSDropUserReq(void* buf, int32_t bufLen, SDropUserReq* pReq);
|
||||
int32_t tDeserializeSDropUserReq(void* buf, int32_t bufLen, SDropUserReq* pReq);
|
||||
|
||||
typedef struct SIpV4Range {
|
||||
uint32_t ip;
|
||||
uint32_t mask;
|
||||
} SIpV4Range;
|
||||
|
||||
typedef struct {
|
||||
int8_t createType;
|
||||
int8_t superUser; // denote if it is a super user or not
|
||||
int8_t sysInfo;
|
||||
int8_t enable;
|
||||
char user[TSDB_USER_LEN];
|
||||
char pass[TSDB_USET_PASSWORD_LEN];
|
||||
int8_t createType;
|
||||
int8_t superUser; // denote if it is a super user or not
|
||||
int8_t sysInfo;
|
||||
int8_t enable;
|
||||
char user[TSDB_USER_LEN];
|
||||
char pass[TSDB_USET_PASSWORD_LEN];
|
||||
int32_t numIpRanges;
|
||||
SIpV4Range* pIpRanges;
|
||||
} SCreateUserReq;
|
||||
|
||||
int32_t tSerializeSCreateUserReq(void* buf, int32_t bufLen, SCreateUserReq* pReq);
|
||||
int32_t tDeserializeSCreateUserReq(void* buf, int32_t bufLen, SCreateUserReq* pReq);
|
||||
void tFreeSCreateUserReq(SCreateUserReq* pReq);
|
||||
|
||||
typedef struct {
|
||||
int8_t alterType;
|
||||
int8_t superUser;
|
||||
int8_t sysInfo;
|
||||
int8_t enable;
|
||||
char user[TSDB_USER_LEN];
|
||||
char pass[TSDB_USET_PASSWORD_LEN];
|
||||
char objname[TSDB_DB_FNAME_LEN]; // db or topic
|
||||
char tabName[TSDB_TABLE_NAME_LEN];
|
||||
char* tagCond;
|
||||
int32_t tagCondLen;
|
||||
int8_t alterType;
|
||||
int8_t superUser;
|
||||
int8_t sysInfo;
|
||||
int8_t enable;
|
||||
char user[TSDB_USER_LEN];
|
||||
char pass[TSDB_USET_PASSWORD_LEN];
|
||||
char objname[TSDB_DB_FNAME_LEN]; // db or topic
|
||||
char tabName[TSDB_TABLE_NAME_LEN];
|
||||
char* tagCond;
|
||||
int32_t tagCondLen;
|
||||
int32_t numIpRanges;
|
||||
SIpV4Range* pIpRanges;
|
||||
} SAlterUserReq;
|
||||
|
||||
int32_t tSerializeSAlterUserReq(void* buf, int32_t bufLen, SAlterUserReq* pReq);
|
||||
|
@ -973,14 +984,12 @@ typedef struct {
|
|||
int64_t offset;
|
||||
} SInterval;
|
||||
|
||||
|
||||
typedef struct STbVerInfo {
|
||||
char tbFName[TSDB_TABLE_FNAME_LEN];
|
||||
int32_t sversion;
|
||||
int32_t tversion;
|
||||
} STbVerInfo;
|
||||
|
||||
|
||||
typedef struct {
|
||||
int32_t code;
|
||||
int64_t affectedRows;
|
||||
|
@ -1203,13 +1212,13 @@ typedef struct {
|
|||
int16_t sstTrigger;
|
||||
} SDbCfgRsp;
|
||||
|
||||
typedef SDbCfgRsp SDbCfgInfo;
|
||||
typedef SDbCfgRsp SDbCfgInfo;
|
||||
|
||||
int32_t tSerializeSDbCfgRspImpl(SEncoder *encoder, const SDbCfgRsp *pRsp);
|
||||
int32_t tSerializeSDbCfgRspImpl(SEncoder* encoder, const SDbCfgRsp* pRsp);
|
||||
int32_t tSerializeSDbCfgRsp(void* buf, int32_t bufLen, const SDbCfgRsp* pRsp);
|
||||
int32_t tDeserializeSDbCfgRsp(void* buf, int32_t bufLen, SDbCfgRsp* pRsp);
|
||||
int32_t tDeserializeSDbCfgRspImpl(SDecoder* decoder, SDbCfgRsp *pRsp);
|
||||
void tFreeSDbCfgRsp(SDbCfgRsp *pRsp);
|
||||
int32_t tDeserializeSDbCfgRspImpl(SDecoder* decoder, SDbCfgRsp* pRsp);
|
||||
void tFreeSDbCfgRsp(SDbCfgRsp* pRsp);
|
||||
|
||||
typedef struct {
|
||||
int32_t rowNum;
|
||||
|
@ -1266,8 +1275,8 @@ int32_t tDeserializeSDnodeListRsp(void* buf, int32_t bufLen, SDnodeListRsp* pRsp
|
|||
void tFreeSDnodeListRsp(SDnodeListRsp* pRsp);
|
||||
|
||||
typedef struct {
|
||||
SUseDbRsp *useDbRsp;
|
||||
SDbCfgRsp *cfgRsp;
|
||||
SUseDbRsp* useDbRsp;
|
||||
SDbCfgRsp* cfgRsp;
|
||||
} SDbHbRsp;
|
||||
|
||||
typedef struct {
|
||||
|
@ -1368,6 +1377,7 @@ typedef struct {
|
|||
char locale[TD_LOCALE_LEN]; // tsLocale
|
||||
char charset[TD_LOCALE_LEN]; // tsCharset
|
||||
int8_t ttlChangeOnWrite;
|
||||
int8_t enableWhiteList;
|
||||
} SClusterCfg;
|
||||
|
||||
typedef struct {
|
||||
|
@ -1402,7 +1412,7 @@ typedef struct {
|
|||
int64_t numOfBatchInsertReqs;
|
||||
int64_t numOfBatchInsertSuccessReqs;
|
||||
int32_t numOfCachedTables;
|
||||
int32_t learnerProgress; // use one reservered
|
||||
int32_t learnerProgress; // use one reservered
|
||||
} SVnodeLoad;
|
||||
|
||||
typedef struct {
|
||||
|
@ -2062,17 +2072,16 @@ typedef struct {
|
|||
int32_t tversion;
|
||||
} SResReadyRsp;
|
||||
|
||||
|
||||
typedef struct SOperatorParam {
|
||||
int32_t opType;
|
||||
int32_t downstreamIdx;
|
||||
void* value;
|
||||
SArray* pChildren; //SArray<SOperatorParam*>
|
||||
int32_t opType;
|
||||
int32_t downstreamIdx;
|
||||
void* value;
|
||||
SArray* pChildren; // SArray<SOperatorParam*>
|
||||
} SOperatorParam;
|
||||
|
||||
typedef struct STableScanOperatorParam {
|
||||
bool tableSeq;
|
||||
SArray* pUidList;
|
||||
bool tableSeq;
|
||||
SArray* pUidList;
|
||||
} STableScanOperatorParam;
|
||||
|
||||
typedef struct {
|
||||
|
@ -2161,7 +2170,6 @@ typedef struct {
|
|||
int32_t tSerializeSTaskDropReq(void* buf, int32_t bufLen, STaskDropReq* pReq);
|
||||
int32_t tDeserializeSTaskDropReq(void* buf, int32_t bufLen, STaskDropReq* pReq);
|
||||
|
||||
|
||||
typedef enum {
|
||||
TASK_NOTIFY_FINISHED = 1,
|
||||
} ETaskNotifyType;
|
||||
|
@ -2285,10 +2293,10 @@ typedef struct {
|
|||
char clientId[256];
|
||||
SArray* topicNames; // SArray<char**>
|
||||
|
||||
int8_t withTbName;
|
||||
int8_t autoCommit;
|
||||
int32_t autoCommitInterval;
|
||||
int8_t resetOffsetCfg;
|
||||
int8_t withTbName;
|
||||
int8_t autoCommit;
|
||||
int32_t autoCommitInterval;
|
||||
int8_t resetOffsetCfg;
|
||||
} SCMSubscribeReq;
|
||||
|
||||
static FORCE_INLINE int32_t tSerializeSCMSubscribeReq(void** buf, const SCMSubscribeReq* pReq) {
|
||||
|
@ -2665,7 +2673,7 @@ typedef struct {
|
|||
int32_t newTTL;
|
||||
int32_t newCommentLen;
|
||||
char* newComment;
|
||||
int64_t ctimeMs; // fill by vnode
|
||||
int64_t ctimeMs; // fill by vnode
|
||||
} SVAlterTbReq;
|
||||
|
||||
int32_t tEncodeSVAlterTbReq(SEncoder* pEncoder, const SVAlterTbReq* pReq);
|
||||
|
@ -3069,7 +3077,7 @@ typedef struct {
|
|||
int64_t suid;
|
||||
} SMqRebVgReq;
|
||||
|
||||
static FORCE_INLINE int tEncodeSMqRebVgReq(SEncoder *pCoder, const SMqRebVgReq* pReq) {
|
||||
static FORCE_INLINE int tEncodeSMqRebVgReq(SEncoder* pCoder, const SMqRebVgReq* pReq) {
|
||||
if (tStartEncode(pCoder) < 0) return -1;
|
||||
if (tEncodeI64(pCoder, pReq->leftForVer) < 0) return -1;
|
||||
if (tEncodeI32(pCoder, pReq->vgId) < 0) return -1;
|
||||
|
@ -3089,7 +3097,7 @@ static FORCE_INLINE int tEncodeSMqRebVgReq(SEncoder *pCoder, const SMqRebVgReq*
|
|||
return 0;
|
||||
}
|
||||
|
||||
static FORCE_INLINE int tDecodeSMqRebVgReq(SDecoder *pCoder, SMqRebVgReq* pReq) {
|
||||
static FORCE_INLINE int tDecodeSMqRebVgReq(SDecoder* pCoder, SMqRebVgReq* pReq) {
|
||||
if (tStartDecode(pCoder) < 0) return -1;
|
||||
|
||||
if (tDecodeI64(pCoder, &pReq->leftForVer) < 0) return -1;
|
||||
|
@ -3105,7 +3113,7 @@ static FORCE_INLINE int tDecodeSMqRebVgReq(SDecoder *pCoder, SMqRebVgReq* pReq)
|
|||
if (tDecodeCStr(pCoder, &pReq->qmsg) < 0) return -1;
|
||||
} else if (pReq->subType == TOPIC_SUB_TYPE__TABLE) {
|
||||
if (tDecodeI64(pCoder, &pReq->suid) < 0) return -1;
|
||||
if (!tDecodeIsEnd(pCoder)){
|
||||
if (!tDecodeIsEnd(pCoder)) {
|
||||
if (tDecodeCStr(pCoder, &pReq->qmsg) < 0) return -1;
|
||||
}
|
||||
}
|
||||
|
@ -3629,12 +3637,12 @@ typedef struct {
|
|||
int32_t vgId;
|
||||
STqOffsetVal offset;
|
||||
int64_t rows;
|
||||
}OffsetRows;
|
||||
} OffsetRows;
|
||||
|
||||
typedef struct{
|
||||
char topicName[TSDB_TOPIC_FNAME_LEN];
|
||||
SArray* offsetRows;
|
||||
}TopicOffsetRows;
|
||||
typedef struct {
|
||||
char topicName[TSDB_TOPIC_FNAME_LEN];
|
||||
SArray* offsetRows;
|
||||
} TopicOffsetRows;
|
||||
|
||||
typedef struct {
|
||||
int64_t consumerId;
|
||||
|
@ -3647,9 +3655,9 @@ typedef struct {
|
|||
} SMqHbRsp;
|
||||
|
||||
typedef struct {
|
||||
SMsgHead head;
|
||||
int64_t consumerId;
|
||||
char subKey[TSDB_SUBSCRIBE_KEY_LEN];
|
||||
SMsgHead head;
|
||||
int64_t consumerId;
|
||||
char subKey[TSDB_SUBSCRIBE_KEY_LEN];
|
||||
} SMqSeekReq;
|
||||
|
||||
#define TD_AUTO_CREATE_TABLE 0x1
|
||||
|
@ -3703,7 +3711,7 @@ typedef struct SDeleteRes {
|
|||
int64_t affectedRows;
|
||||
char tableFName[TSDB_TABLE_NAME_LEN];
|
||||
char tsColName[TSDB_COL_NAME_LEN];
|
||||
int64_t ctimeMs; // fill by vnode
|
||||
int64_t ctimeMs; // fill by vnode
|
||||
} SDeleteRes;
|
||||
|
||||
int32_t tEncodeDeleteRes(SEncoder* pCoder, const SDeleteRes* pRes);
|
||||
|
@ -3781,8 +3789,8 @@ int32_t tSerializeSMqHbReq(void* buf, int32_t bufLen, SMqHbReq* pReq);
|
|||
int32_t tDeserializeSMqHbReq(void* buf, int32_t bufLen, SMqHbReq* pReq);
|
||||
int32_t tDeatroySMqHbReq(SMqHbReq* pReq);
|
||||
|
||||
int32_t tSerializeSMqSeekReq(void *buf, int32_t bufLen, SMqSeekReq *pReq);
|
||||
int32_t tDeserializeSMqSeekReq(void *buf, int32_t bufLen, SMqSeekReq *pReq);
|
||||
int32_t tSerializeSMqSeekReq(void* buf, int32_t bufLen, SMqSeekReq* pReq);
|
||||
int32_t tDeserializeSMqSeekReq(void* buf, int32_t bufLen, SMqSeekReq* pReq);
|
||||
|
||||
#define SUBMIT_REQ_AUTO_CREATE_TABLE 0x1
|
||||
#define SUBMIT_REQ_COLUMN_DATA_FORMAT 0x2
|
||||
|
@ -3797,7 +3805,7 @@ typedef struct {
|
|||
SArray* aRowP;
|
||||
SArray* aCol;
|
||||
};
|
||||
int64_t ctimeMs;
|
||||
int64_t ctimeMs;
|
||||
} SSubmitTbData;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#ifndef _TD_COMMON_TOKEN_H_
|
||||
#define _TD_COMMON_TOKEN_H_
|
||||
|
||||
|
||||
#define TK_OR 1
|
||||
#define TK_AND 2
|
||||
#define TK_UNION 3
|
||||
|
@ -48,313 +49,313 @@
|
|||
#define TK_USERS 30
|
||||
#define TK_CONNS 31
|
||||
#define TK_STATE 32
|
||||
#define TK_USER 33
|
||||
#define TK_ENABLE 34
|
||||
#define TK_NK_INTEGER 35
|
||||
#define TK_SYSINFO 36
|
||||
#define TK_DROP 37
|
||||
#define TK_GRANT 38
|
||||
#define TK_ON 39
|
||||
#define TK_TO 40
|
||||
#define TK_REVOKE 41
|
||||
#define TK_FROM 42
|
||||
#define TK_SUBSCRIBE 43
|
||||
#define TK_NK_COMMA 44
|
||||
#define TK_READ 45
|
||||
#define TK_WRITE 46
|
||||
#define TK_NK_DOT 47
|
||||
#define TK_WITH 48
|
||||
#define TK_DNODE 49
|
||||
#define TK_PORT 50
|
||||
#define TK_DNODES 51
|
||||
#define TK_RESTORE 52
|
||||
#define TK_NK_IPTOKEN 53
|
||||
#define TK_FORCE 54
|
||||
#define TK_UNSAFE 55
|
||||
#define TK_LOCAL 56
|
||||
#define TK_QNODE 57
|
||||
#define TK_BNODE 58
|
||||
#define TK_SNODE 59
|
||||
#define TK_MNODE 60
|
||||
#define TK_VNODE 61
|
||||
#define TK_DATABASE 62
|
||||
#define TK_USE 63
|
||||
#define TK_FLUSH 64
|
||||
#define TK_TRIM 65
|
||||
#define TK_COMPACT 66
|
||||
#define TK_IF 67
|
||||
#define TK_NOT 68
|
||||
#define TK_EXISTS 69
|
||||
#define TK_BUFFER 70
|
||||
#define TK_CACHEMODEL 71
|
||||
#define TK_CACHESIZE 72
|
||||
#define TK_COMP 73
|
||||
#define TK_DURATION 74
|
||||
#define TK_NK_VARIABLE 75
|
||||
#define TK_MAXROWS 76
|
||||
#define TK_MINROWS 77
|
||||
#define TK_KEEP 78
|
||||
#define TK_PAGES 79
|
||||
#define TK_PAGESIZE 80
|
||||
#define TK_TSDB_PAGESIZE 81
|
||||
#define TK_PRECISION 82
|
||||
#define TK_REPLICA 83
|
||||
#define TK_VGROUPS 84
|
||||
#define TK_SINGLE_STABLE 85
|
||||
#define TK_RETENTIONS 86
|
||||
#define TK_SCHEMALESS 87
|
||||
#define TK_WAL_LEVEL 88
|
||||
#define TK_WAL_FSYNC_PERIOD 89
|
||||
#define TK_WAL_RETENTION_PERIOD 90
|
||||
#define TK_WAL_RETENTION_SIZE 91
|
||||
#define TK_WAL_ROLL_PERIOD 92
|
||||
#define TK_WAL_SEGMENT_SIZE 93
|
||||
#define TK_STT_TRIGGER 94
|
||||
#define TK_TABLE_PREFIX 95
|
||||
#define TK_TABLE_SUFFIX 96
|
||||
#define TK_NK_COLON 97
|
||||
#define TK_BWLIMIT 98
|
||||
#define TK_START 99
|
||||
#define TK_TIMESTAMP 100
|
||||
#define TK_END 101
|
||||
#define TK_TABLE 102
|
||||
#define TK_NK_LP 103
|
||||
#define TK_NK_RP 104
|
||||
#define TK_STABLE 105
|
||||
#define TK_ADD 106
|
||||
#define TK_COLUMN 107
|
||||
#define TK_MODIFY 108
|
||||
#define TK_RENAME 109
|
||||
#define TK_TAG 110
|
||||
#define TK_SET 111
|
||||
#define TK_NK_EQ 112
|
||||
#define TK_USING 113
|
||||
#define TK_TAGS 114
|
||||
#define TK_BOOL 115
|
||||
#define TK_TINYINT 116
|
||||
#define TK_SMALLINT 117
|
||||
#define TK_INT 118
|
||||
#define TK_INTEGER 119
|
||||
#define TK_BIGINT 120
|
||||
#define TK_FLOAT 121
|
||||
#define TK_DOUBLE 122
|
||||
#define TK_BINARY 123
|
||||
#define TK_NCHAR 124
|
||||
#define TK_UNSIGNED 125
|
||||
#define TK_JSON 126
|
||||
#define TK_VARCHAR 127
|
||||
#define TK_MEDIUMBLOB 128
|
||||
#define TK_BLOB 129
|
||||
#define TK_VARBINARY 130
|
||||
#define TK_GEOMETRY 131
|
||||
#define TK_DECIMAL 132
|
||||
#define TK_COMMENT 133
|
||||
#define TK_MAX_DELAY 134
|
||||
#define TK_WATERMARK 135
|
||||
#define TK_ROLLUP 136
|
||||
#define TK_TTL 137
|
||||
#define TK_SMA 138
|
||||
#define TK_DELETE_MARK 139
|
||||
#define TK_FIRST 140
|
||||
#define TK_LAST 141
|
||||
#define TK_SHOW 142
|
||||
#define TK_PRIVILEGES 143
|
||||
#define TK_DATABASES 144
|
||||
#define TK_TABLES 145
|
||||
#define TK_STABLES 146
|
||||
#define TK_MNODES 147
|
||||
#define TK_QNODES 148
|
||||
#define TK_FUNCTIONS 149
|
||||
#define TK_INDEXES 150
|
||||
#define TK_ACCOUNTS 151
|
||||
#define TK_APPS 152
|
||||
#define TK_CONNECTIONS 153
|
||||
#define TK_LICENCES 154
|
||||
#define TK_GRANTS 155
|
||||
#define TK_QUERIES 156
|
||||
#define TK_SCORES 157
|
||||
#define TK_TOPICS 158
|
||||
#define TK_VARIABLES 159
|
||||
#define TK_CLUSTER 160
|
||||
#define TK_BNODES 161
|
||||
#define TK_SNODES 162
|
||||
#define TK_TRANSACTIONS 163
|
||||
#define TK_DISTRIBUTED 164
|
||||
#define TK_CONSUMERS 165
|
||||
#define TK_SUBSCRIPTIONS 166
|
||||
#define TK_VNODES 167
|
||||
#define TK_ALIVE 168
|
||||
#define TK_LIKE 169
|
||||
#define TK_TBNAME 170
|
||||
#define TK_QTAGS 171
|
||||
#define TK_AS 172
|
||||
#define TK_INDEX 173
|
||||
#define TK_FUNCTION 174
|
||||
#define TK_INTERVAL 175
|
||||
#define TK_COUNT 176
|
||||
#define TK_LAST_ROW 177
|
||||
#define TK_META 178
|
||||
#define TK_ONLY 179
|
||||
#define TK_TOPIC 180
|
||||
#define TK_CONSUMER 181
|
||||
#define TK_GROUP 182
|
||||
#define TK_DESC 183
|
||||
#define TK_DESCRIBE 184
|
||||
#define TK_RESET 185
|
||||
#define TK_QUERY 186
|
||||
#define TK_CACHE 187
|
||||
#define TK_EXPLAIN 188
|
||||
#define TK_ANALYZE 189
|
||||
#define TK_VERBOSE 190
|
||||
#define TK_NK_BOOL 191
|
||||
#define TK_RATIO 192
|
||||
#define TK_NK_FLOAT 193
|
||||
#define TK_OUTPUTTYPE 194
|
||||
#define TK_AGGREGATE 195
|
||||
#define TK_BUFSIZE 196
|
||||
#define TK_LANGUAGE 197
|
||||
#define TK_REPLACE 198
|
||||
#define TK_STREAM 199
|
||||
#define TK_INTO 200
|
||||
#define TK_PAUSE 201
|
||||
#define TK_RESUME 202
|
||||
#define TK_TRIGGER 203
|
||||
#define TK_AT_ONCE 204
|
||||
#define TK_WINDOW_CLOSE 205
|
||||
#define TK_IGNORE 206
|
||||
#define TK_EXPIRED 207
|
||||
#define TK_FILL_HISTORY 208
|
||||
#define TK_UPDATE 209
|
||||
#define TK_SUBTABLE 210
|
||||
#define TK_UNTREATED 211
|
||||
#define TK_KILL 212
|
||||
#define TK_CONNECTION 213
|
||||
#define TK_TRANSACTION 214
|
||||
#define TK_BALANCE 215
|
||||
#define TK_VGROUP 216
|
||||
#define TK_LEADER 217
|
||||
#define TK_MERGE 218
|
||||
#define TK_REDISTRIBUTE 219
|
||||
#define TK_SPLIT 220
|
||||
#define TK_DELETE 221
|
||||
#define TK_INSERT 222
|
||||
#define TK_NULL 223
|
||||
#define TK_NK_QUESTION 224
|
||||
#define TK_NK_ARROW 225
|
||||
#define TK_ROWTS 226
|
||||
#define TK_QSTART 227
|
||||
#define TK_QEND 228
|
||||
#define TK_QDURATION 229
|
||||
#define TK_WSTART 230
|
||||
#define TK_WEND 231
|
||||
#define TK_WDURATION 232
|
||||
#define TK_IROWTS 233
|
||||
#define TK_ISFILLED 234
|
||||
#define TK_CAST 235
|
||||
#define TK_NOW 236
|
||||
#define TK_TODAY 237
|
||||
#define TK_TIMEZONE 238
|
||||
#define TK_CLIENT_VERSION 239
|
||||
#define TK_SERVER_VERSION 240
|
||||
#define TK_SERVER_STATUS 241
|
||||
#define TK_CURRENT_USER 242
|
||||
#define TK_CASE 243
|
||||
#define TK_WHEN 244
|
||||
#define TK_THEN 245
|
||||
#define TK_ELSE 246
|
||||
#define TK_BETWEEN 247
|
||||
#define TK_IS 248
|
||||
#define TK_NK_LT 249
|
||||
#define TK_NK_GT 250
|
||||
#define TK_NK_LE 251
|
||||
#define TK_NK_GE 252
|
||||
#define TK_NK_NE 253
|
||||
#define TK_MATCH 254
|
||||
#define TK_NMATCH 255
|
||||
#define TK_CONTAINS 256
|
||||
#define TK_IN 257
|
||||
#define TK_JOIN 258
|
||||
#define TK_INNER 259
|
||||
#define TK_SELECT 260
|
||||
#define TK_NK_HINT 261
|
||||
#define TK_DISTINCT 262
|
||||
#define TK_WHERE 263
|
||||
#define TK_PARTITION 264
|
||||
#define TK_BY 265
|
||||
#define TK_SESSION 266
|
||||
#define TK_STATE_WINDOW 267
|
||||
#define TK_EVENT_WINDOW 268
|
||||
#define TK_SLIDING 269
|
||||
#define TK_FILL 270
|
||||
#define TK_VALUE 271
|
||||
#define TK_VALUE_F 272
|
||||
#define TK_NONE 273
|
||||
#define TK_PREV 274
|
||||
#define TK_NULL_F 275
|
||||
#define TK_LINEAR 276
|
||||
#define TK_NEXT 277
|
||||
#define TK_HAVING 278
|
||||
#define TK_RANGE 279
|
||||
#define TK_EVERY 280
|
||||
#define TK_ORDER 281
|
||||
#define TK_SLIMIT 282
|
||||
#define TK_SOFFSET 283
|
||||
#define TK_LIMIT 284
|
||||
#define TK_OFFSET 285
|
||||
#define TK_ASC 286
|
||||
#define TK_NULLS 287
|
||||
#define TK_ABORT 288
|
||||
#define TK_AFTER 289
|
||||
#define TK_ATTACH 290
|
||||
#define TK_BEFORE 291
|
||||
#define TK_BEGIN 292
|
||||
#define TK_BITAND 293
|
||||
#define TK_BITNOT 294
|
||||
#define TK_BITOR 295
|
||||
#define TK_BLOCKS 296
|
||||
#define TK_CHANGE 297
|
||||
#define TK_COMMA 298
|
||||
#define TK_CONCAT 299
|
||||
#define TK_CONFLICT 300
|
||||
#define TK_COPY 301
|
||||
#define TK_DEFERRED 302
|
||||
#define TK_DELIMITERS 303
|
||||
#define TK_DETACH 304
|
||||
#define TK_DIVIDE 305
|
||||
#define TK_DOT 306
|
||||
#define TK_EACH 307
|
||||
#define TK_FAIL 308
|
||||
#define TK_FILE 309
|
||||
#define TK_FOR 310
|
||||
#define TK_GLOB 311
|
||||
#define TK_ID 312
|
||||
#define TK_IMMEDIATE 313
|
||||
#define TK_IMPORT 314
|
||||
#define TK_INITIALLY 315
|
||||
#define TK_INSTEAD 316
|
||||
#define TK_ISNULL 317
|
||||
#define TK_KEY 318
|
||||
#define TK_MODULES 319
|
||||
#define TK_NK_BITNOT 320
|
||||
#define TK_NK_SEMI 321
|
||||
#define TK_NOTNULL 322
|
||||
#define TK_OF 323
|
||||
#define TK_PLUS 324
|
||||
#define TK_PRIVILEGE 325
|
||||
#define TK_RAISE 326
|
||||
#define TK_RESTRICT 327
|
||||
#define TK_ROW 328
|
||||
#define TK_SEMI 329
|
||||
#define TK_STAR 330
|
||||
#define TK_STATEMENT 331
|
||||
#define TK_STRICT 332
|
||||
#define TK_STRING 333
|
||||
#define TK_TIMES 334
|
||||
#define TK_VALUES 335
|
||||
#define TK_VARIABLE 336
|
||||
#define TK_VIEW 337
|
||||
#define TK_WAL 338
|
||||
|
||||
#define TK_NK_COMMA 33
|
||||
#define TK_HOST 34
|
||||
#define TK_USER 35
|
||||
#define TK_ENABLE 36
|
||||
#define TK_NK_INTEGER 37
|
||||
#define TK_SYSINFO 38
|
||||
#define TK_ADD 39
|
||||
#define TK_DROP 40
|
||||
#define TK_GRANT 41
|
||||
#define TK_ON 42
|
||||
#define TK_TO 43
|
||||
#define TK_REVOKE 44
|
||||
#define TK_FROM 45
|
||||
#define TK_SUBSCRIBE 46
|
||||
#define TK_READ 47
|
||||
#define TK_WRITE 48
|
||||
#define TK_NK_DOT 49
|
||||
#define TK_WITH 50
|
||||
#define TK_DNODE 51
|
||||
#define TK_PORT 52
|
||||
#define TK_DNODES 53
|
||||
#define TK_RESTORE 54
|
||||
#define TK_NK_IPTOKEN 55
|
||||
#define TK_FORCE 56
|
||||
#define TK_UNSAFE 57
|
||||
#define TK_LOCAL 58
|
||||
#define TK_QNODE 59
|
||||
#define TK_BNODE 60
|
||||
#define TK_SNODE 61
|
||||
#define TK_MNODE 62
|
||||
#define TK_VNODE 63
|
||||
#define TK_DATABASE 64
|
||||
#define TK_USE 65
|
||||
#define TK_FLUSH 66
|
||||
#define TK_TRIM 67
|
||||
#define TK_COMPACT 68
|
||||
#define TK_IF 69
|
||||
#define TK_NOT 70
|
||||
#define TK_EXISTS 71
|
||||
#define TK_BUFFER 72
|
||||
#define TK_CACHEMODEL 73
|
||||
#define TK_CACHESIZE 74
|
||||
#define TK_COMP 75
|
||||
#define TK_DURATION 76
|
||||
#define TK_NK_VARIABLE 77
|
||||
#define TK_MAXROWS 78
|
||||
#define TK_MINROWS 79
|
||||
#define TK_KEEP 80
|
||||
#define TK_PAGES 81
|
||||
#define TK_PAGESIZE 82
|
||||
#define TK_TSDB_PAGESIZE 83
|
||||
#define TK_PRECISION 84
|
||||
#define TK_REPLICA 85
|
||||
#define TK_VGROUPS 86
|
||||
#define TK_SINGLE_STABLE 87
|
||||
#define TK_RETENTIONS 88
|
||||
#define TK_SCHEMALESS 89
|
||||
#define TK_WAL_LEVEL 90
|
||||
#define TK_WAL_FSYNC_PERIOD 91
|
||||
#define TK_WAL_RETENTION_PERIOD 92
|
||||
#define TK_WAL_RETENTION_SIZE 93
|
||||
#define TK_WAL_ROLL_PERIOD 94
|
||||
#define TK_WAL_SEGMENT_SIZE 95
|
||||
#define TK_STT_TRIGGER 96
|
||||
#define TK_TABLE_PREFIX 97
|
||||
#define TK_TABLE_SUFFIX 98
|
||||
#define TK_NK_COLON 99
|
||||
#define TK_BWLIMIT 100
|
||||
#define TK_START 101
|
||||
#define TK_TIMESTAMP 102
|
||||
#define TK_END 103
|
||||
#define TK_TABLE 104
|
||||
#define TK_NK_LP 105
|
||||
#define TK_NK_RP 106
|
||||
#define TK_STABLE 107
|
||||
#define TK_COLUMN 108
|
||||
#define TK_MODIFY 109
|
||||
#define TK_RENAME 110
|
||||
#define TK_TAG 111
|
||||
#define TK_SET 112
|
||||
#define TK_NK_EQ 113
|
||||
#define TK_USING 114
|
||||
#define TK_TAGS 115
|
||||
#define TK_BOOL 116
|
||||
#define TK_TINYINT 117
|
||||
#define TK_SMALLINT 118
|
||||
#define TK_INT 119
|
||||
#define TK_INTEGER 120
|
||||
#define TK_BIGINT 121
|
||||
#define TK_FLOAT 122
|
||||
#define TK_DOUBLE 123
|
||||
#define TK_BINARY 124
|
||||
#define TK_NCHAR 125
|
||||
#define TK_UNSIGNED 126
|
||||
#define TK_JSON 127
|
||||
#define TK_VARCHAR 128
|
||||
#define TK_MEDIUMBLOB 129
|
||||
#define TK_BLOB 130
|
||||
#define TK_VARBINARY 131
|
||||
#define TK_GEOMETRY 132
|
||||
#define TK_DECIMAL 133
|
||||
#define TK_COMMENT 134
|
||||
#define TK_MAX_DELAY 135
|
||||
#define TK_WATERMARK 136
|
||||
#define TK_ROLLUP 137
|
||||
#define TK_TTL 138
|
||||
#define TK_SMA 139
|
||||
#define TK_DELETE_MARK 140
|
||||
#define TK_FIRST 141
|
||||
#define TK_LAST 142
|
||||
#define TK_SHOW 143
|
||||
#define TK_PRIVILEGES 144
|
||||
#define TK_DATABASES 145
|
||||
#define TK_TABLES 146
|
||||
#define TK_STABLES 147
|
||||
#define TK_MNODES 148
|
||||
#define TK_QNODES 149
|
||||
#define TK_FUNCTIONS 150
|
||||
#define TK_INDEXES 151
|
||||
#define TK_ACCOUNTS 152
|
||||
#define TK_APPS 153
|
||||
#define TK_CONNECTIONS 154
|
||||
#define TK_LICENCES 155
|
||||
#define TK_GRANTS 156
|
||||
#define TK_QUERIES 157
|
||||
#define TK_SCORES 158
|
||||
#define TK_TOPICS 159
|
||||
#define TK_VARIABLES 160
|
||||
#define TK_CLUSTER 161
|
||||
#define TK_BNODES 162
|
||||
#define TK_SNODES 163
|
||||
#define TK_TRANSACTIONS 164
|
||||
#define TK_DISTRIBUTED 165
|
||||
#define TK_CONSUMERS 166
|
||||
#define TK_SUBSCRIPTIONS 167
|
||||
#define TK_VNODES 168
|
||||
#define TK_ALIVE 169
|
||||
#define TK_LIKE 170
|
||||
#define TK_TBNAME 171
|
||||
#define TK_QTAGS 172
|
||||
#define TK_AS 173
|
||||
#define TK_INDEX 174
|
||||
#define TK_FUNCTION 175
|
||||
#define TK_INTERVAL 176
|
||||
#define TK_COUNT 177
|
||||
#define TK_LAST_ROW 178
|
||||
#define TK_META 179
|
||||
#define TK_ONLY 180
|
||||
#define TK_TOPIC 181
|
||||
#define TK_CONSUMER 182
|
||||
#define TK_GROUP 183
|
||||
#define TK_DESC 184
|
||||
#define TK_DESCRIBE 185
|
||||
#define TK_RESET 186
|
||||
#define TK_QUERY 187
|
||||
#define TK_CACHE 188
|
||||
#define TK_EXPLAIN 189
|
||||
#define TK_ANALYZE 190
|
||||
#define TK_VERBOSE 191
|
||||
#define TK_NK_BOOL 192
|
||||
#define TK_RATIO 193
|
||||
#define TK_NK_FLOAT 194
|
||||
#define TK_OUTPUTTYPE 195
|
||||
#define TK_AGGREGATE 196
|
||||
#define TK_BUFSIZE 197
|
||||
#define TK_LANGUAGE 198
|
||||
#define TK_REPLACE 199
|
||||
#define TK_STREAM 200
|
||||
#define TK_INTO 201
|
||||
#define TK_PAUSE 202
|
||||
#define TK_RESUME 203
|
||||
#define TK_TRIGGER 204
|
||||
#define TK_AT_ONCE 205
|
||||
#define TK_WINDOW_CLOSE 206
|
||||
#define TK_IGNORE 207
|
||||
#define TK_EXPIRED 208
|
||||
#define TK_FILL_HISTORY 209
|
||||
#define TK_UPDATE 210
|
||||
#define TK_SUBTABLE 211
|
||||
#define TK_UNTREATED 212
|
||||
#define TK_KILL 213
|
||||
#define TK_CONNECTION 214
|
||||
#define TK_TRANSACTION 215
|
||||
#define TK_BALANCE 216
|
||||
#define TK_VGROUP 217
|
||||
#define TK_LEADER 218
|
||||
#define TK_MERGE 219
|
||||
#define TK_REDISTRIBUTE 220
|
||||
#define TK_SPLIT 221
|
||||
#define TK_DELETE 222
|
||||
#define TK_INSERT 223
|
||||
#define TK_NULL 224
|
||||
#define TK_NK_QUESTION 225
|
||||
#define TK_NK_ARROW 226
|
||||
#define TK_ROWTS 227
|
||||
#define TK_QSTART 228
|
||||
#define TK_QEND 229
|
||||
#define TK_QDURATION 230
|
||||
#define TK_WSTART 231
|
||||
#define TK_WEND 232
|
||||
#define TK_WDURATION 233
|
||||
#define TK_IROWTS 234
|
||||
#define TK_ISFILLED 235
|
||||
#define TK_CAST 236
|
||||
#define TK_NOW 237
|
||||
#define TK_TODAY 238
|
||||
#define TK_TIMEZONE 239
|
||||
#define TK_CLIENT_VERSION 240
|
||||
#define TK_SERVER_VERSION 241
|
||||
#define TK_SERVER_STATUS 242
|
||||
#define TK_CURRENT_USER 243
|
||||
#define TK_CASE 244
|
||||
#define TK_WHEN 245
|
||||
#define TK_THEN 246
|
||||
#define TK_ELSE 247
|
||||
#define TK_BETWEEN 248
|
||||
#define TK_IS 249
|
||||
#define TK_NK_LT 250
|
||||
#define TK_NK_GT 251
|
||||
#define TK_NK_LE 252
|
||||
#define TK_NK_GE 253
|
||||
#define TK_NK_NE 254
|
||||
#define TK_MATCH 255
|
||||
#define TK_NMATCH 256
|
||||
#define TK_CONTAINS 257
|
||||
#define TK_IN 258
|
||||
#define TK_JOIN 259
|
||||
#define TK_INNER 260
|
||||
#define TK_SELECT 261
|
||||
#define TK_NK_HINT 262
|
||||
#define TK_DISTINCT 263
|
||||
#define TK_WHERE 264
|
||||
#define TK_PARTITION 265
|
||||
#define TK_BY 266
|
||||
#define TK_SESSION 267
|
||||
#define TK_STATE_WINDOW 268
|
||||
#define TK_EVENT_WINDOW 269
|
||||
#define TK_SLIDING 270
|
||||
#define TK_FILL 271
|
||||
#define TK_VALUE 272
|
||||
#define TK_VALUE_F 273
|
||||
#define TK_NONE 274
|
||||
#define TK_PREV 275
|
||||
#define TK_NULL_F 276
|
||||
#define TK_LINEAR 277
|
||||
#define TK_NEXT 278
|
||||
#define TK_HAVING 279
|
||||
#define TK_RANGE 280
|
||||
#define TK_EVERY 281
|
||||
#define TK_ORDER 282
|
||||
#define TK_SLIMIT 283
|
||||
#define TK_SOFFSET 284
|
||||
#define TK_LIMIT 285
|
||||
#define TK_OFFSET 286
|
||||
#define TK_ASC 287
|
||||
#define TK_NULLS 288
|
||||
#define TK_ABORT 289
|
||||
#define TK_AFTER 290
|
||||
#define TK_ATTACH 291
|
||||
#define TK_BEFORE 292
|
||||
#define TK_BEGIN 293
|
||||
#define TK_BITAND 294
|
||||
#define TK_BITNOT 295
|
||||
#define TK_BITOR 296
|
||||
#define TK_BLOCKS 297
|
||||
#define TK_CHANGE 298
|
||||
#define TK_COMMA 299
|
||||
#define TK_CONCAT 300
|
||||
#define TK_CONFLICT 301
|
||||
#define TK_COPY 302
|
||||
#define TK_DEFERRED 303
|
||||
#define TK_DELIMITERS 304
|
||||
#define TK_DETACH 305
|
||||
#define TK_DIVIDE 306
|
||||
#define TK_DOT 307
|
||||
#define TK_EACH 308
|
||||
#define TK_FAIL 309
|
||||
#define TK_FILE 310
|
||||
#define TK_FOR 311
|
||||
#define TK_GLOB 312
|
||||
#define TK_ID 313
|
||||
#define TK_IMMEDIATE 314
|
||||
#define TK_IMPORT 315
|
||||
#define TK_INITIALLY 316
|
||||
#define TK_INSTEAD 317
|
||||
#define TK_ISNULL 318
|
||||
#define TK_KEY 319
|
||||
#define TK_MODULES 320
|
||||
#define TK_NK_BITNOT 321
|
||||
#define TK_NK_SEMI 322
|
||||
#define TK_NOTNULL 323
|
||||
#define TK_OF 324
|
||||
#define TK_PLUS 325
|
||||
#define TK_PRIVILEGE 326
|
||||
#define TK_RAISE 327
|
||||
#define TK_RESTRICT 328
|
||||
#define TK_ROW 329
|
||||
#define TK_SEMI 330
|
||||
#define TK_STAR 331
|
||||
#define TK_STATEMENT 332
|
||||
#define TK_STRICT 333
|
||||
#define TK_STRING 334
|
||||
#define TK_TIMES 335
|
||||
#define TK_VALUES 336
|
||||
#define TK_VARIABLE 337
|
||||
#define TK_VIEW 338
|
||||
#define TK_WAL 339
|
||||
|
||||
|
||||
#define TK_NK_SPACE 600
|
||||
|
|
|
@ -222,6 +222,10 @@ typedef struct SCreateUserStmt {
|
|||
char userName[TSDB_USER_LEN];
|
||||
char password[TSDB_USET_PASSWORD_LEN];
|
||||
int8_t sysinfo;
|
||||
int32_t numIpRanges;
|
||||
SIpV4Range* pIpRanges;
|
||||
|
||||
SNodeList* pNodeListIpRanges;
|
||||
} SCreateUserStmt;
|
||||
|
||||
typedef struct SAlterUserStmt {
|
||||
|
@ -231,6 +235,10 @@ typedef struct SAlterUserStmt {
|
|||
char password[TSDB_USET_PASSWORD_LEN];
|
||||
int8_t enable;
|
||||
int8_t sysinfo;
|
||||
int32_t numIpRanges;
|
||||
SIpV4Range* pIpRanges;
|
||||
|
||||
SNodeList* pNodeListIpRanges;
|
||||
} SAlterUserStmt;
|
||||
|
||||
typedef struct SDropUserStmt {
|
||||
|
|
|
@ -29,54 +29,6 @@ extern "C" {
|
|||
|
||||
#include "storageapi.h"
|
||||
|
||||
// void* streamBackendInit(const char* path);
|
||||
// void streamBackendCleanup(void* arg);
|
||||
// SListNode* streamBackendAddCompare(void* backend, void* arg);
|
||||
// void streamBackendDelCompare(void* backend, void* arg);
|
||||
|
||||
// <<<<<<< HEAD
|
||||
// typedef struct STdbState {
|
||||
// rocksdb_t* rocksdb;
|
||||
// rocksdb_column_family_handle_t** pHandle;
|
||||
// rocksdb_writeoptions_t* writeOpts;
|
||||
// rocksdb_readoptions_t* readOpts;
|
||||
// rocksdb_options_t** cfOpts;
|
||||
// rocksdb_options_t* dbOpt;
|
||||
// struct SStreamTask* pOwner;
|
||||
// void* param;
|
||||
// void* env;
|
||||
// SListNode* pComparNode;
|
||||
// void* pBackend;
|
||||
// char idstr[64];
|
||||
// void* compactFactory;
|
||||
// TdThreadRwlock rwLock;
|
||||
// =======
|
||||
// typedef struct STdbState {
|
||||
// rocksdb_t* rocksdb;
|
||||
// rocksdb_column_family_handle_t** pHandle;
|
||||
// rocksdb_writeoptions_t* writeOpts;
|
||||
// rocksdb_readoptions_t* readOpts;
|
||||
// rocksdb_options_t** cfOpts;
|
||||
// rocksdb_options_t* dbOpt;
|
||||
// struct SStreamTask* pOwner;
|
||||
// void* param;
|
||||
// void* env;
|
||||
// SListNode* pComparNode;
|
||||
// void* pBackendHandle;
|
||||
// char idstr[64];
|
||||
// void* compactFactory;
|
||||
//
|
||||
// TDB* db;
|
||||
// TTB* pStateDb;
|
||||
// TTB* pFuncStateDb;
|
||||
// TTB* pFillStateDb; // todo refactor
|
||||
// TTB* pSessionStateDb;
|
||||
// TTB* pParNameDb;
|
||||
// TTB* pParTagDb;
|
||||
// TXN* txn;
|
||||
//} STdbState;
|
||||
//>>>>>>> enh/dev3.0
|
||||
|
||||
SStreamState* streamStateOpen(char* path, void* pTask, bool specPath, int32_t szPage, int32_t pages);
|
||||
void streamStateClose(SStreamState* pState, bool remove);
|
||||
int32_t streamStateBegin(SStreamState* pState);
|
||||
|
|
|
@ -112,6 +112,8 @@ int32_t taosGetErrorFile(TdFilePtr pFile);
|
|||
|
||||
int32_t taosCompressFile(char *srcFileName, char *destFileName);
|
||||
|
||||
int32_t taosSetFileHandlesLimit();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -39,7 +39,7 @@ int64_t taosGetOsUptime();
|
|||
int32_t taosGetEmail(char *email, int32_t maxLen);
|
||||
int32_t taosGetOsReleaseName(char *releaseName, char* sName, char* ver, int32_t maxLen);
|
||||
int32_t taosGetCpuInfo(char *cpuModel, int32_t maxLen, float *numOfCores);
|
||||
int32_t taosGetCpuCores(float *numOfCores);
|
||||
int32_t taosGetCpuCores(float *numOfCores, bool physical);
|
||||
void taosGetCpuUsage(double *cpu_system, double *cpu_engine);
|
||||
int32_t taosGetCpuInstructions(char* sse42, char* avx, char* avx2, char* fma);
|
||||
int32_t taosGetTotalMemory(int64_t *totalKB);
|
||||
|
|
|
@ -710,6 +710,7 @@ int32_t* taosGetErrno();
|
|||
#define TSDB_CODE_PAR_SYSTABLE_NOT_ALLOWED_FUNC TAOS_DEF_ERROR_CODE(0, 0x2668)
|
||||
#define TSDB_CODE_PAR_SYSTABLE_NOT_ALLOWED TAOS_DEF_ERROR_CODE(0, 0x2669)
|
||||
#define TSDB_CODE_PAR_INVALID_VARBINARY TAOS_DEF_ERROR_CODE(0, 0x266A)
|
||||
#define TSDB_CODE_PAR_INVALID_IP_RANGE TAOS_DEF_ERROR_CODE(0, 0x266B)
|
||||
#define TSDB_CODE_PAR_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x26FF)
|
||||
|
||||
//planner
|
||||
|
|
|
@ -152,7 +152,6 @@ typedef struct {
|
|||
int32_t vgId;
|
||||
int32_t vgStatus;
|
||||
int32_t vgSkipCnt; // here used to mark the slow vgroups
|
||||
// bool receivedInfoFromVnode; // has already received info from vnode
|
||||
int64_t emptyBlockReceiveTs; // once empty block is received, idle for ignoreCnt then start to poll data
|
||||
bool seekUpdated; // offset is updated by seek operator, therefore, not update by vnode rsp.
|
||||
SEpSet epSet;
|
||||
|
@ -190,17 +189,13 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
int64_t refId;
|
||||
int32_t epoch;
|
||||
void* pParam;
|
||||
__tmq_askep_fn_t pUserFn;
|
||||
} SMqAskEpCbParam;
|
||||
|
||||
typedef struct {
|
||||
int64_t refId;
|
||||
int32_t epoch;
|
||||
char topicName[TSDB_TOPIC_FNAME_LEN];
|
||||
// SMqClientVg* pVg;
|
||||
// SMqClientTopic* pTopic;
|
||||
int32_t vgId;
|
||||
uint64_t requestId; // request id for debug purpose
|
||||
} SMqPollCbParam;
|
||||
|
@ -237,7 +232,6 @@ typedef struct {
|
|||
int64_t refId;
|
||||
int32_t epoch;
|
||||
int32_t waitingRspNum;
|
||||
int32_t totalRspNum;
|
||||
int32_t code;
|
||||
tmq_commit_cb* callbackFn;
|
||||
/*SArray* successfulOffsets;*/
|
||||
|
@ -445,7 +439,6 @@ static int32_t tmqCommitCb(void* param, SDataBuf* pBuf, int32_t code) {
|
|||
SMqCommitCbParam* pParam = (SMqCommitCbParam*)param;
|
||||
SMqCommitCbParamSet* pParamSet = (SMqCommitCbParamSet*)pParam->params;
|
||||
|
||||
// taosMemoryFree(pParam->pOffset);
|
||||
taosMemoryFree(pBuf->pData);
|
||||
taosMemoryFree(pBuf->pEpSet);
|
||||
|
||||
|
@ -516,14 +509,14 @@ static int32_t doSendCommitMsg(tmq_t* tmq, int32_t vgId, SEpSet* epSet, STqOffse
|
|||
pMsgSendInfo->fp = tmqCommitCb;
|
||||
pMsgSendInfo->msgType = TDMT_VND_TMQ_COMMIT_OFFSET;
|
||||
|
||||
atomic_add_fetch_32(&pParamSet->waitingRspNum, 1);
|
||||
atomic_add_fetch_32(&pParamSet->totalRspNum, 1);
|
||||
|
||||
SEp* pEp = GET_ACTIVE_EP(epSet);
|
||||
|
||||
|
||||
int64_t transporterId = 0;
|
||||
return asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, epSet, &transporterId, pMsgSendInfo);
|
||||
atomic_add_fetch_32(&pParamSet->waitingRspNum, 1);
|
||||
code = asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, epSet, &transporterId, pMsgSendInfo);
|
||||
if(code != 0){
|
||||
atomic_sub_fetch_32(&pParamSet->waitingRspNum, 1);
|
||||
return code;
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
static SMqClientTopic* getTopicByName(tmq_t* tmq, const char* pTopicName) {
|
||||
|
@ -556,8 +549,6 @@ static SMqCommitCbParamSet* prepareCommitCbParamSet(tmq_t* tmq, tmq_commit_cb* p
|
|||
return pParamSet;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int32_t getClientVg(tmq_t* tmq, char* pTopicName, int32_t vgId, SMqClientVg** pVg){
|
||||
SMqClientTopic* pTopic = getTopicByName(tmq, pTopicName);
|
||||
if (pTopic == NULL) {
|
||||
|
@ -578,11 +569,10 @@ static int32_t getClientVg(tmq_t* tmq, char* pTopicName, int32_t vgId, SMqClient
|
|||
}
|
||||
|
||||
static int32_t asyncCommitOffset(tmq_t* tmq, char* pTopicName, int32_t vgId, STqOffsetVal* offsetVal, tmq_commit_cb* pCommitFp, void* userParam) {
|
||||
int32_t code = 0;
|
||||
tscInfo("consumer:0x%" PRIx64 " do manual commit offset for %s, vgId:%d", tmq->consumerId, pTopicName, vgId);
|
||||
taosRLockLatch(&tmq->lock);
|
||||
SMqClientVg* pVg = NULL;
|
||||
code = getClientVg(tmq, pTopicName, vgId, &pVg);
|
||||
int32_t code = getClientVg(tmq, pTopicName, vgId, &pVg);
|
||||
if(code != 0){
|
||||
goto end;
|
||||
}
|
||||
|
@ -711,7 +701,7 @@ static void asyncCommitAllOffsets(tmq_t* tmq, tmq_commit_cb* pCommitFp, void* us
|
|||
tscInfo("consumer:0x%" PRIx64 " total commit:%d for %d topics", tmq->consumerId, pParamSet->waitingRspNum - 1, numOfTopics);
|
||||
|
||||
// request is sent
|
||||
if (pParamSet->totalRspNum != 0) {
|
||||
if (pParamSet->waitingRspNum != 1) {
|
||||
// count down since waiting rsp num init as 1
|
||||
commitRspCountDown(pParamSet, tmq->consumerId, "", 0);
|
||||
return;
|
||||
|
@ -750,20 +740,6 @@ void tmqAssignDelayedCommitTask(void* param, void* tmrId) {
|
|||
taosMemoryFree(param);
|
||||
}
|
||||
|
||||
//void tmqAssignDelayedReportTask(void* param, void* tmrId) {
|
||||
// int64_t refId = *(int64_t*)param;
|
||||
// tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId);
|
||||
// if (tmq != NULL) {
|
||||
// int8_t* pTaskType = taosAllocateQitem(sizeof(int8_t), DEF_QITEM, 0);
|
||||
// *pTaskType = TMQ_DELAYED_TASK__REPORT;
|
||||
// taosWriteQitem(tmq->delayedTask, pTaskType);
|
||||
// tsem_post(&tmq->rspSem);
|
||||
// }
|
||||
//
|
||||
// taosReleaseRef(tmqMgmt.rsetId, refId);
|
||||
// taosMemoryFree(param);
|
||||
//}
|
||||
|
||||
int32_t tmqHbCb(void* param, SDataBuf* pMsg, int32_t code) {
|
||||
if (pMsg) {
|
||||
taosMemoryFree(pMsg->pData);
|
||||
|
@ -1092,7 +1068,6 @@ tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) {
|
|||
pTmq->status = TMQ_CONSUMER_STATUS__INIT;
|
||||
pTmq->pollCnt = 0;
|
||||
pTmq->epoch = 0;
|
||||
// pTmq->needReportOffsetRows = true;
|
||||
|
||||
// set conf
|
||||
strcpy(pTmq->clientId, conf->clientId);
|
||||
|
@ -1153,7 +1128,7 @@ _failed:
|
|||
}
|
||||
|
||||
int32_t tmq_subscribe(tmq_t* tmq, const tmq_list_t* topic_list) {
|
||||
if(tmq == NULL) return TSDB_CODE_INVALID_PARA;
|
||||
if(tmq == NULL || topic_list == NULL) return TSDB_CODE_INVALID_PARA;
|
||||
const int32_t MAX_RETRY_COUNT = 120 * 2; // let's wait for 2 mins at most
|
||||
const SArray* container = &topic_list->container;
|
||||
int32_t sz = taosArrayGetSize(container);
|
||||
|
@ -1229,7 +1204,10 @@ int32_t tmq_subscribe(tmq_t* tmq, const tmq_list_t* topic_list) {
|
|||
SEpSet epSet = getEpSet_s(&tmq->pTscObj->pAppInfo->mgmtEp);
|
||||
|
||||
int64_t transporterId = 0;
|
||||
asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, &epSet, &transporterId, sendInfo);
|
||||
code = asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, &epSet, &transporterId, sendInfo);
|
||||
if(code != 0){
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
// avoid double free if msg is sent
|
||||
buf = NULL;
|
||||
|
@ -1246,7 +1224,7 @@ int32_t tmq_subscribe(tmq_t* tmq, const tmq_list_t* topic_list) {
|
|||
int32_t retryCnt = 0;
|
||||
while (TSDB_CODE_MND_CONSUMER_NOT_READY == doAskEp(tmq)) {
|
||||
if (retryCnt++ > MAX_RETRY_COUNT) {
|
||||
tscError("consumer:0x%" PRIx64 ", mnd not ready for subscribe, retry:%d in 500ms", tmq->consumerId, retryCnt);
|
||||
tscError("consumer:0x%" PRIx64 ", mnd not ready for subscribe, retry more than 2 minutes", tmq->consumerId);
|
||||
code = TSDB_CODE_MND_CONSUMER_NOT_READY;
|
||||
goto FAIL;
|
||||
}
|
||||
|
@ -1311,54 +1289,50 @@ static SMqClientTopic* getTopicInfo(tmq_t* tmq, char* topicName){
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void setVgIdle(tmq_t* tmq, char* topicName, int32_t vgId){
|
||||
taosWLockLatch(&tmq->lock);
|
||||
SMqClientVg* pVg = getVgInfo(tmq, topicName, vgId);
|
||||
if(pVg){
|
||||
atomic_store_32(&pVg->vgStatus, TMQ_VG_STATUS__IDLE);
|
||||
}
|
||||
taosWUnLockLatch(&tmq->lock);
|
||||
}
|
||||
|
||||
int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
|
||||
SMqPollCbParam* pParam = (SMqPollCbParam*)param;
|
||||
|
||||
int64_t refId = pParam->refId;
|
||||
// SMqClientVg* pVg = pParam->pVg;
|
||||
// SMqClientTopic* pTopic = pParam->pTopic;
|
||||
|
||||
int64_t refId = pParam->refId;
|
||||
int32_t vgId = pParam->vgId;
|
||||
uint64_t requestId = pParam->requestId;
|
||||
tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId);
|
||||
if (tmq == NULL) {
|
||||
taosMemoryFree(pParam);
|
||||
taosMemoryFree(pMsg->pData);
|
||||
taosMemoryFree(pMsg->pEpSet);
|
||||
taosMemoryFreeClear(pMsg->pData);
|
||||
taosMemoryFreeClear(pMsg->pEpSet);
|
||||
terrno = TSDB_CODE_TMQ_CONSUMER_CLOSED;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int32_t epoch = pParam->epoch;
|
||||
int32_t vgId = pParam->vgId;
|
||||
uint64_t requestId = pParam->requestId;
|
||||
|
||||
if (code != 0) {
|
||||
if (pMsg->pData) taosMemoryFree(pMsg->pData);
|
||||
if (pMsg->pEpSet) taosMemoryFree(pMsg->pEpSet);
|
||||
|
||||
// in case of consumer mismatch, wait for 500ms and retry
|
||||
if (code == TSDB_CODE_TMQ_CONSUMER_MISMATCH) {
|
||||
// taosMsleep(500);
|
||||
atomic_store_8(&tmq->status, TMQ_CONSUMER_STATUS__RECOVER);
|
||||
tscDebug("consumer:0x%" PRIx64 " wait for the re-balance, wait for 500ms and set status to be RECOVER",
|
||||
tscDebug("consumer:0x%" PRIx64 " wait for the re-balance, set status to be RECOVER",
|
||||
tmq->consumerId);
|
||||
} else if (code == TSDB_CODE_TQ_NO_COMMITTED_OFFSET) {
|
||||
SMqPollRspWrapper* pRspWrapper = taosAllocateQitem(sizeof(SMqPollRspWrapper), DEF_QITEM, 0);
|
||||
if (pRspWrapper == NULL) {
|
||||
tscWarn("consumer:0x%" PRIx64 " msg from vgId:%d discarded, epoch %d since out of memory, reqId:0x%" PRIx64,
|
||||
tmq->consumerId, vgId, epoch, requestId);
|
||||
goto CREATE_MSG_FAIL;
|
||||
tscWarn("consumer:0x%" PRIx64 " msg from vgId:%d discarded, since out of memory, reqId:0x%" PRIx64,
|
||||
tmq->consumerId, vgId, requestId);
|
||||
goto END;
|
||||
}
|
||||
|
||||
pRspWrapper->tmqRspType = TMQ_MSG_TYPE__END_RSP;
|
||||
taosWriteQitem(tmq->mqueue, pRspWrapper);
|
||||
// } else if (code == TSDB_CODE_WAL_LOG_NOT_EXIST) { // poll data while insert
|
||||
// taosMsleep(5);
|
||||
} else{
|
||||
tscError("consumer:0x%" PRIx64 " msg from vgId:%d discarded, epoch %d, since %s, reqId:0x%" PRIx64, tmq->consumerId,
|
||||
vgId, epoch, tstrerror(code), requestId);
|
||||
tscError("consumer:0x%" PRIx64 " msg from vgId:%d discarded, since %s, reqId:0x%" PRIx64, tmq->consumerId,
|
||||
vgId, tstrerror(code), requestId);
|
||||
}
|
||||
|
||||
goto CREATE_MSG_FAIL;
|
||||
goto END;
|
||||
}
|
||||
|
||||
int32_t msgEpoch = ((SMqRspHead*)pMsg->pData)->epoch;
|
||||
|
@ -1368,43 +1342,29 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
tscWarn("consumer:0x%" PRIx64
|
||||
" msg discard from vgId:%d since from earlier epoch, rsp epoch %d, current epoch %d, reqId:0x%" PRIx64,
|
||||
tmq->consumerId, vgId, msgEpoch, clientEpoch, requestId);
|
||||
|
||||
tsem_post(&tmq->rspSem);
|
||||
taosReleaseRef(tmqMgmt.rsetId, refId);
|
||||
|
||||
taosMemoryFree(pMsg->pData);
|
||||
taosMemoryFree(pMsg->pEpSet);
|
||||
taosMemoryFree(pParam);
|
||||
|
||||
return 0;
|
||||
code = -1;
|
||||
goto END;
|
||||
}
|
||||
|
||||
if (msgEpoch != clientEpoch) {
|
||||
tscWarn("consumer:0x%" PRIx64 " mismatch rsp from vgId:%d, epoch %d, current epoch %d, reqId:0x%" PRIx64,
|
||||
tmq->consumerId, vgId, msgEpoch, clientEpoch, requestId);
|
||||
}
|
||||
ASSERT(msgEpoch == clientEpoch);
|
||||
|
||||
// handle meta rsp
|
||||
int8_t rspType = ((SMqRspHead*)pMsg->pData)->mqMsgType;
|
||||
|
||||
SMqPollRspWrapper* pRspWrapper = taosAllocateQitem(sizeof(SMqPollRspWrapper), DEF_QITEM, 0);
|
||||
if (pRspWrapper == NULL) {
|
||||
taosMemoryFree(pMsg->pData);
|
||||
taosMemoryFree(pMsg->pEpSet);
|
||||
tscWarn("consumer:0x%" PRIx64 " msg discard from vgId:%d, epoch %d since out of memory", tmq->consumerId, vgId,
|
||||
epoch);
|
||||
goto CREATE_MSG_FAIL;
|
||||
tscWarn("consumer:0x%" PRIx64 " msg discard from vgId:%d, since out of memory", tmq->consumerId, vgId);
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
goto END;
|
||||
}
|
||||
|
||||
pRspWrapper->tmqRspType = rspType;
|
||||
// pRspWrapper->vgHandle = pVg;
|
||||
// pRspWrapper->topicHandle = pTopic;
|
||||
pRspWrapper->reqId = requestId;
|
||||
pRspWrapper->pEpset = pMsg->pEpSet;
|
||||
pMsg->pEpSet = NULL;
|
||||
pRspWrapper->vgId = vgId;
|
||||
strcpy(pRspWrapper->topicName, pParam->topicName);
|
||||
|
||||
pMsg->pEpSet = NULL;
|
||||
if (rspType == TMQ_MSG_TYPE__POLL_DATA_RSP) {
|
||||
SDecoder decoder;
|
||||
tDecoderInit(&decoder, POINTER_SHIFT(pMsg->pData, sizeof(SMqRspHead)), pMsg->len - sizeof(SMqRspHead));
|
||||
|
@ -1432,34 +1392,24 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
tscError("consumer:0x%" PRIx64 " invalid rsp msg received, type:%d ignored", tmq->consumerId, rspType);
|
||||
}
|
||||
|
||||
taosMemoryFree(pMsg->pData);
|
||||
taosWriteQitem(tmq->mqueue, pRspWrapper);
|
||||
|
||||
int32_t total = taosQueueItemSize(tmq->mqueue);
|
||||
tscDebug("consumer:0x%" PRIx64 " put poll res into mqueue, type:%d, vgId:%d, total in queue:%d, reqId:0x%" PRIx64,
|
||||
tmq->consumerId, rspType, vgId, total, requestId);
|
||||
|
||||
tsem_post(&tmq->rspSem);
|
||||
taosReleaseRef(tmqMgmt.rsetId, refId);
|
||||
taosMemoryFree(pParam);
|
||||
|
||||
return 0;
|
||||
|
||||
CREATE_MSG_FAIL:
|
||||
if (epoch == tmq->epoch) {
|
||||
taosWLockLatch(&tmq->lock);
|
||||
SMqClientVg* pVg = getVgInfo(tmq, pParam->topicName, vgId);
|
||||
if(pVg){
|
||||
atomic_store_32(&pVg->vgStatus, TMQ_VG_STATUS__IDLE);
|
||||
}
|
||||
taosWUnLockLatch(&tmq->lock);
|
||||
END:
|
||||
if(code != 0){
|
||||
setVgIdle(tmq, pParam->topicName, vgId);
|
||||
}
|
||||
|
||||
tsem_post(&tmq->rspSem);
|
||||
taosReleaseRef(tmqMgmt.rsetId, refId);
|
||||
taosMemoryFree(pParam);
|
||||
taosMemoryFreeClear(pMsg->pData);
|
||||
taosMemoryFreeClear(pMsg->pEpSet);
|
||||
|
||||
return -1;
|
||||
return code;
|
||||
}
|
||||
|
||||
typedef struct SVgroupSaveInfo {
|
||||
|
@ -1467,6 +1417,7 @@ typedef struct SVgroupSaveInfo {
|
|||
STqOffsetVal commitOffset;
|
||||
STqOffsetVal seekOffset;
|
||||
int64_t numOfRows;
|
||||
int32_t vgStatus;
|
||||
} SVgroupSaveInfo;
|
||||
|
||||
static void initClientTopicFromRsp(SMqClientTopic* pTopic, SMqSubTopicEp* pTopicEp, SHashObj* pVgOffsetHashMap,
|
||||
|
@ -1475,7 +1426,7 @@ static void initClientTopicFromRsp(SMqClientTopic* pTopic, SMqSubTopicEp* pTopic
|
|||
pTopicEp->schema.nCols = 0;
|
||||
pTopicEp->schema.pSchema = NULL;
|
||||
|
||||
char vgKey[TSDB_TOPIC_FNAME_LEN + 22];
|
||||
char vgKey[TSDB_TOPIC_FNAME_LEN + 22] = {0};
|
||||
int32_t vgNumGet = taosArrayGetSize(pTopicEp->vgs);
|
||||
|
||||
tstrncpy(pTopic->topicName, pTopicEp->topic, TSDB_TOPIC_FNAME_LEN);
|
||||
|
@ -1497,7 +1448,7 @@ static void initClientTopicFromRsp(SMqClientTopic* pTopic, SMqSubTopicEp* pTopic
|
|||
.pollCnt = 0,
|
||||
.vgId = pVgEp->vgId,
|
||||
.epSet = pVgEp->epSet,
|
||||
.vgStatus = TMQ_VG_STATUS__IDLE,
|
||||
.vgStatus = pInfo ? pInfo->vgStatus : TMQ_VG_STATUS__IDLE,
|
||||
.vgSkipCnt = 0,
|
||||
.emptyBlockReceiveTs = 0,
|
||||
.numOfRows = pInfo ? pInfo->numOfRows : 0,
|
||||
|
@ -1509,7 +1460,6 @@ static void initClientTopicFromRsp(SMqClientTopic* pTopic, SMqSubTopicEp* pTopic
|
|||
clientVg.offsetInfo.walVerBegin = -1;
|
||||
clientVg.offsetInfo.walVerEnd = -1;
|
||||
clientVg.seekUpdated = false;
|
||||
// clientVg.receivedInfoFromVnode = false;
|
||||
|
||||
taosArrayPush(pTopic->vgs, &clientVg);
|
||||
}
|
||||
|
@ -1546,10 +1496,9 @@ static bool doUpdateLocalEp(tmq_t* tmq, int32_t epoch, const SMqAskEpRsp* pRsp)
|
|||
taosWLockLatch(&tmq->lock);
|
||||
int32_t topicNumCur = taosArrayGetSize(tmq->clientTopics);
|
||||
|
||||
char vgKey[TSDB_TOPIC_FNAME_LEN + 22];
|
||||
char vgKey[TSDB_TOPIC_FNAME_LEN + 22] = {0};
|
||||
tscInfo("consumer:0x%" PRIx64 " update ep epoch from %d to epoch %d, incoming topics:%d, existed topics:%d",
|
||||
tmq->consumerId, tmq->epoch, epoch, topicNumGet, topicNumCur);
|
||||
// todo extract method
|
||||
for (int32_t i = 0; i < topicNumCur; i++) {
|
||||
// find old topic
|
||||
SMqClientTopic* pTopicCur = taosArrayGet(tmq->clientTopics, i);
|
||||
|
@ -1565,7 +1514,9 @@ static bool doUpdateLocalEp(tmq_t* tmq, int32_t epoch, const SMqAskEpRsp* pRsp)
|
|||
tscInfo("consumer:0x%" PRIx64 ", epoch:%d vgId:%d vgKey:%s, offset:%s", tmq->consumerId, epoch, pVgCur->vgId,
|
||||
vgKey, buf);
|
||||
|
||||
SVgroupSaveInfo info = {.currentOffset = pVgCur->offsetInfo.endOffset, .seekOffset = pVgCur->offsetInfo.beginOffset, .commitOffset = pVgCur->offsetInfo.committedOffset, .numOfRows = pVgCur->numOfRows};
|
||||
SVgroupSaveInfo info = {.currentOffset = pVgCur->offsetInfo.endOffset, .seekOffset = pVgCur->offsetInfo.beginOffset,
|
||||
.commitOffset = pVgCur->offsetInfo.committedOffset, .numOfRows = pVgCur->numOfRows,
|
||||
.vgStatus = pVgCur->vgStatus};
|
||||
taosHashPut(pVgOffsetHashMap, vgKey, strlen(vgKey), &info, sizeof(SVgroupSaveInfo));
|
||||
}
|
||||
}
|
||||
|
@ -1598,32 +1549,17 @@ static bool doUpdateLocalEp(tmq_t* tmq, int32_t epoch, const SMqAskEpRsp* pRsp)
|
|||
int32_t askEpCallbackFn(void* param, SDataBuf* pMsg, int32_t code) {
|
||||
SMqAskEpCbParam* pParam = (SMqAskEpCbParam*)param;
|
||||
tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, pParam->refId);
|
||||
|
||||
if (tmq == NULL) {
|
||||
terrno = TSDB_CODE_TMQ_CONSUMER_CLOSED;
|
||||
// pParam->pUserFn(tmq, terrno, NULL, pParam->pParam);
|
||||
|
||||
taosMemoryFree(pMsg->pData);
|
||||
taosMemoryFree(pMsg->pEpSet);
|
||||
taosMemoryFree(pParam);
|
||||
return terrno;
|
||||
code = TSDB_CODE_TMQ_CONSUMER_CLOSED;
|
||||
goto END;
|
||||
}
|
||||
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
tscError("consumer:0x%" PRIx64 ", get topic endpoint error, code:%s", tmq->consumerId, tstrerror(code));
|
||||
pParam->pUserFn(tmq, code, NULL, pParam->pParam);
|
||||
|
||||
taosReleaseRef(tmqMgmt.rsetId, pParam->refId);
|
||||
|
||||
taosMemoryFree(pMsg->pData);
|
||||
taosMemoryFree(pMsg->pEpSet);
|
||||
taosMemoryFree(pParam);
|
||||
return code;
|
||||
goto END;
|
||||
}
|
||||
|
||||
// tmq's epoch is monotonically increase,
|
||||
// so it's safe to discard any old epoch msg.
|
||||
// Epoch will only increase when received newer epoch ep msg
|
||||
SMqRspHead* head = pMsg->pData;
|
||||
int32_t epoch = atomic_load_32(&tmq->epoch);
|
||||
if (head->epoch <= epoch) {
|
||||
|
@ -1642,10 +1578,10 @@ int32_t askEpCallbackFn(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
tscInfo("consumer:0x%" PRIx64 ", recv ep, msg epoch %d, current epoch %d, update local ep", tmq->consumerId,
|
||||
head->epoch, epoch);
|
||||
}
|
||||
|
||||
pParam->pUserFn(tmq, code, pMsg, pParam->pParam);
|
||||
taosReleaseRef(tmqMgmt.rsetId, pParam->refId);
|
||||
|
||||
END:
|
||||
pParam->pUserFn(tmq, code, pMsg, pParam->pParam);
|
||||
taosMemoryFree(pMsg->pEpSet);
|
||||
taosMemoryFree(pMsg->pData);
|
||||
taosMemoryFree(pParam);
|
||||
|
@ -1734,50 +1670,46 @@ SMqTaosxRspObj* tmqBuildTaosxRspFromWrapper(SMqPollRspWrapper* pWrapper, SMqClie
|
|||
return pRspObj;
|
||||
}
|
||||
|
||||
static int32_t handleErrorBeforePoll(SMqClientVg* pVg, tmq_t* pTmq) {
|
||||
atomic_store_32(&pVg->vgStatus, TMQ_VG_STATUS__IDLE);
|
||||
tsem_post(&pTmq->rspSem);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int32_t doTmqPollImpl(tmq_t* pTmq, SMqClientTopic* pTopic, SMqClientVg* pVg, int64_t timeout) {
|
||||
SMqPollReq req = {0};
|
||||
char* msg = NULL;
|
||||
SMqPollCbParam* pParam = NULL;
|
||||
SMsgSendInfo* sendInfo = NULL;
|
||||
int code = 0;
|
||||
tmqBuildConsumeReqImpl(&req, pTmq, timeout, pTopic, pVg);
|
||||
|
||||
int32_t msgSize = tSerializeSMqPollReq(NULL, 0, &req);
|
||||
if (msgSize < 0) {
|
||||
return handleErrorBeforePoll(pVg, pTmq);
|
||||
if (msgSize < 0){
|
||||
code = TSDB_CODE_INVALID_MSG;
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
char* msg = taosMemoryCalloc(1, msgSize);
|
||||
msg = taosMemoryCalloc(1, msgSize);
|
||||
if (NULL == msg) {
|
||||
return handleErrorBeforePoll(pVg, pTmq);
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
if (tSerializeSMqPollReq(msg, msgSize, &req) < 0) {
|
||||
taosMemoryFree(msg);
|
||||
return handleErrorBeforePoll(pVg, pTmq);
|
||||
code = TSDB_CODE_INVALID_MSG;
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
SMqPollCbParam* pParam = taosMemoryMalloc(sizeof(SMqPollCbParam));
|
||||
pParam = taosMemoryMalloc(sizeof(SMqPollCbParam));
|
||||
if (pParam == NULL) {
|
||||
taosMemoryFree(msg);
|
||||
return handleErrorBeforePoll(pVg, pTmq);
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
pParam->refId = pTmq->refId;
|
||||
pParam->epoch = pTmq->epoch;
|
||||
// pParam->pVg = pVg; // pVg may be released,fix it
|
||||
// pParam->pTopic = pTopic;
|
||||
strcpy(pParam->topicName, pTopic->topicName);
|
||||
pParam->vgId = pVg->vgId;
|
||||
pParam->requestId = req.reqId;
|
||||
|
||||
SMsgSendInfo* sendInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo));
|
||||
sendInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo));
|
||||
if (sendInfo == NULL) {
|
||||
taosMemoryFree(pParam);
|
||||
taosMemoryFree(msg);
|
||||
return handleErrorBeforePoll(pVg, pTmq);
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
sendInfo->msgInfo = (SDataBuf){.pData = msg, .len = msgSize, .handle = NULL};
|
||||
|
@ -1793,13 +1725,21 @@ static int32_t doTmqPollImpl(tmq_t* pTmq, SMqClientTopic* pTopic, SMqClientVg* p
|
|||
|
||||
tscDebug("consumer:0x%" PRIx64 " send poll to %s vgId:%d, epoch %d, req:%s, reqId:0x%" PRIx64, pTmq->consumerId,
|
||||
pTopic->topicName, pVg->vgId, pTmq->epoch, offsetFormatBuf, req.reqId);
|
||||
asyncSendMsgToServer(pTmq->pTscObj->pAppInfo->pTransporter, &pVg->epSet, &transporterId, sendInfo);
|
||||
code = asyncSendMsgToServer(pTmq->pTscObj->pAppInfo->pTransporter, &pVg->epSet, &transporterId, sendInfo);
|
||||
if(code != 0){
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
pVg->pollCnt++;
|
||||
pVg->seekUpdated = false; // reset this flag.
|
||||
pTmq->pollCnt++;
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
return 0;
|
||||
|
||||
FAIL:
|
||||
taosMemoryFreeClear(pParam);
|
||||
taosMemoryFreeClear(msg);
|
||||
return code;
|
||||
}
|
||||
|
||||
// broadcast the poll request to all related vnodes
|
||||
|
@ -1836,6 +1776,8 @@ static int32_t tmqPollImpl(tmq_t* tmq, int64_t timeout) {
|
|||
atomic_store_32(&pVg->vgSkipCnt, 0);
|
||||
code = doTmqPollImpl(tmq, pTopic, pVg, timeout);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
atomic_store_32(&pVg->vgStatus, TMQ_VG_STATUS__IDLE);
|
||||
tsem_post(&tmq->rspSem);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
@ -1847,19 +1789,15 @@ end:
|
|||
return code;
|
||||
}
|
||||
|
||||
static int32_t tmqHandleNoPollRsp(tmq_t* tmq, SMqRspWrapper* rspWrapper, bool* pReset) {
|
||||
static int32_t tmqHandleNoPollRsp(tmq_t* tmq, SMqRspWrapper* rspWrapper) {
|
||||
if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__EP_RSP) {
|
||||
/*printf("ep %d %d\n", rspMsg->head.epoch, tmq->epoch);*/
|
||||
if (rspWrapper->epoch > atomic_load_32(&tmq->epoch)) {
|
||||
SMqAskEpRspWrapper* pEpRspWrapper = (SMqAskEpRspWrapper*)rspWrapper;
|
||||
SMqAskEpRsp* rspMsg = &pEpRspWrapper->msg;
|
||||
doUpdateLocalEp(tmq, rspWrapper->epoch, rspMsg);
|
||||
/*tmqClearUnhandleMsg(tmq);*/
|
||||
tDeleteSMqAskEpRsp(rspMsg);
|
||||
*pReset = true;
|
||||
} else {
|
||||
tmqFreeRspWrapper(rspWrapper);
|
||||
*pReset = false;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
|
@ -1882,10 +1820,9 @@ static void updateVgInfo(SMqClientVg* pVg, STqOffsetVal* reqOffset, STqOffsetVal
|
|||
// update the valid wal version range
|
||||
pVg->offsetInfo.walVerBegin = sver;
|
||||
pVg->offsetInfo.walVerEnd = ever + 1;
|
||||
// pVg->receivedInfoFromVnode = true;
|
||||
}
|
||||
|
||||
static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
|
||||
static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout) {
|
||||
tscDebug("consumer:0x%" PRIx64 " start to handle the rsp, total:%d", tmq->consumerId, tmq->qall->numOfItems);
|
||||
|
||||
while (1) {
|
||||
|
@ -1961,6 +1898,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
|
|||
} else {
|
||||
tscInfo("consumer:0x%" PRIx64 " vgId:%d msg discard since epoch mismatch: msg epoch %d, consumer epoch %d",
|
||||
tmq->consumerId, pollRspWrapper->vgId, pDataRsp->head.epoch, consumerEpoch);
|
||||
setVgIdle(tmq, pollRspWrapper->topicName, pollRspWrapper->vgId);
|
||||
pRspWrapper = tmqFreeRspWrapper(pRspWrapper);
|
||||
taosFreeQitem(pollRspWrapper);
|
||||
}
|
||||
|
@ -1992,6 +1930,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
|
|||
} else {
|
||||
tscInfo("consumer:0x%" PRIx64 " vgId:%d msg discard since epoch mismatch: msg epoch %d, consumer epoch %d",
|
||||
tmq->consumerId, pollRspWrapper->vgId, pollRspWrapper->metaRsp.head.epoch, consumerEpoch);
|
||||
setVgIdle(tmq, pollRspWrapper->topicName, pollRspWrapper->vgId);
|
||||
pRspWrapper = tmqFreeRspWrapper(pRspWrapper);
|
||||
taosFreeQitem(pollRspWrapper);
|
||||
}
|
||||
|
@ -2036,12 +1975,12 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
|
|||
|
||||
tmq->totalRows += numOfRows;
|
||||
|
||||
char buf[TSDB_OFFSET_LEN] = {0};
|
||||
tFormatOffset(buf, TSDB_OFFSET_LEN, &pVg->offsetInfo.endOffset);
|
||||
tscDebug("consumer:0x%" PRIx64 " process taosx poll rsp, vgId:%d, offset:%s, blocks:%d, rows:%" PRId64
|
||||
", vg total:%" PRId64 ", total:%" PRId64 ", reqId:0x%" PRIx64,
|
||||
tmq->consumerId, pVg->vgId, buf, pollRspWrapper->dataRsp.blockNum, numOfRows, pVg->numOfRows,
|
||||
tmq->totalRows, pollRspWrapper->reqId);
|
||||
char buf[TSDB_OFFSET_LEN] = {0};
|
||||
tFormatOffset(buf, TSDB_OFFSET_LEN, &pVg->offsetInfo.endOffset);
|
||||
tscDebug("consumer:0x%" PRIx64 " process taosx poll rsp, vgId:%d, offset:%s, blocks:%d, rows:%" PRId64
|
||||
", vg total:%" PRId64 ", total:%" PRId64 ", reqId:0x%" PRIx64,
|
||||
tmq->consumerId, pVg->vgId, buf, pollRspWrapper->dataRsp.blockNum, numOfRows, pVg->numOfRows,
|
||||
tmq->totalRows, pollRspWrapper->reqId);
|
||||
|
||||
taosFreeQitem(pollRspWrapper);
|
||||
taosWUnLockLatch(&tmq->lock);
|
||||
|
@ -2049,19 +1988,14 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
|
|||
} else {
|
||||
tscInfo("consumer:0x%" PRIx64 " vgId:%d msg discard since epoch mismatch: msg epoch %d, consumer epoch %d",
|
||||
tmq->consumerId, pollRspWrapper->vgId, pollRspWrapper->taosxRsp.head.epoch, consumerEpoch);
|
||||
setVgIdle(tmq, pollRspWrapper->topicName, pollRspWrapper->vgId);
|
||||
pRspWrapper = tmqFreeRspWrapper(pRspWrapper);
|
||||
taosFreeQitem(pollRspWrapper);
|
||||
}
|
||||
} else {
|
||||
tscDebug("consumer:0x%" PRIx64 " not data msg received", tmq->consumerId);
|
||||
|
||||
bool reset = false;
|
||||
tmqHandleNoPollRsp(tmq, pRspWrapper, &reset);
|
||||
tmqHandleNoPollRsp(tmq, pRspWrapper);
|
||||
taosFreeQitem(pRspWrapper);
|
||||
if (pollIfReset && reset) {
|
||||
tscDebug("consumer:0x%" PRIx64 ", reset and repoll", tmq->consumerId);
|
||||
tmqPollImpl(tmq, timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2069,7 +2003,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
|
|||
TAOS_RES* tmq_consumer_poll(tmq_t* tmq, int64_t timeout) {
|
||||
if(tmq == NULL) return NULL;
|
||||
|
||||
void* rspObj;
|
||||
void* rspObj = NULL;
|
||||
int64_t startTime = taosGetTimestampMs();
|
||||
|
||||
tscInfo("consumer:0x%" PRIx64 " start to poll at %" PRId64 ", timeout:%" PRId64, tmq->consumerId, startTime,
|
||||
|
@ -2101,7 +2035,7 @@ TAOS_RES* tmq_consumer_poll(tmq_t* tmq, int64_t timeout) {
|
|||
tscError("consumer:0x%" PRIx64 " return due to poll error", tmq->consumerId);
|
||||
}
|
||||
|
||||
rspObj = tmqHandleAllRsp(tmq, timeout, false);
|
||||
rspObj = tmqHandleAllRsp(tmq, timeout);
|
||||
if (rspObj) {
|
||||
tscDebug("consumer:0x%" PRIx64 " return rsp %p", tmq->consumerId, rspObj);
|
||||
return (TAOS_RES*)rspObj;
|
||||
|
@ -2473,23 +2407,29 @@ end:
|
|||
}
|
||||
}
|
||||
|
||||
void updateEpCallbackFn(tmq_t* pTmq, int32_t code, SDataBuf* pDataBuf, void* param) {
|
||||
void defaultAskEpCb(tmq_t* pTmq, int32_t code, SDataBuf* pDataBuf, void* param) {
|
||||
SAskEpInfo* pInfo = param;
|
||||
pInfo->code = code;
|
||||
|
||||
if (code == TSDB_CODE_SUCCESS) {
|
||||
SMqRspHead* head = pDataBuf->pData;
|
||||
|
||||
SMqAskEpRsp rsp;
|
||||
tDecodeSMqAskEpRsp(POINTER_SHIFT(pDataBuf->pData, sizeof(SMqRspHead)), &rsp);
|
||||
doUpdateLocalEp(pTmq, head->epoch, &rsp);
|
||||
tDeleteSMqAskEpRsp(&rsp);
|
||||
if (pTmq == NULL || code != TSDB_CODE_SUCCESS){
|
||||
goto END;
|
||||
}
|
||||
|
||||
SMqRspHead* head = pDataBuf->pData;
|
||||
SMqAskEpRsp rsp;
|
||||
tDecodeSMqAskEpRsp(POINTER_SHIFT(pDataBuf->pData, sizeof(SMqRspHead)), &rsp);
|
||||
doUpdateLocalEp(pTmq, head->epoch, &rsp);
|
||||
tDeleteSMqAskEpRsp(&rsp);
|
||||
|
||||
END:
|
||||
tsem_post(&pInfo->sem);
|
||||
}
|
||||
|
||||
void addToQueueCallbackFn(tmq_t* pTmq, int32_t code, SDataBuf* pDataBuf, void* param) {
|
||||
if (pTmq == NULL){
|
||||
terrno = TSDB_CODE_TMQ_CONSUMER_CLOSED;
|
||||
return;
|
||||
}
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
terrno = code;
|
||||
return;
|
||||
|
@ -2515,7 +2455,7 @@ int32_t doAskEp(tmq_t* pTmq) {
|
|||
SAskEpInfo* pInfo = taosMemoryMalloc(sizeof(SAskEpInfo));
|
||||
tsem_init(&pInfo->sem, 0, 0);
|
||||
|
||||
asyncAskEp(pTmq, updateEpCallbackFn, pInfo);
|
||||
asyncAskEp(pTmq, defaultAskEpCb, pInfo);
|
||||
tsem_wait(&pInfo->sem);
|
||||
|
||||
int32_t code = pInfo->code;
|
||||
|
@ -2529,49 +2469,45 @@ void asyncAskEp(tmq_t* pTmq, __tmq_askep_fn_t askEpFn, void* param) {
|
|||
req.consumerId = pTmq->consumerId;
|
||||
req.epoch = pTmq->epoch;
|
||||
strcpy(req.cgroup, pTmq->groupId);
|
||||
int code = 0;
|
||||
SMqAskEpCbParam* pParam = NULL;
|
||||
void* pReq = NULL;
|
||||
|
||||
int32_t tlen = tSerializeSMqAskEpReq(NULL, 0, &req);
|
||||
if (tlen < 0) {
|
||||
tscError("consumer:0x%" PRIx64 ", tSerializeSMqAskEpReq failed", pTmq->consumerId);
|
||||
askEpFn(pTmq, TSDB_CODE_INVALID_PARA, NULL, param);
|
||||
return;
|
||||
code = TSDB_CODE_INVALID_PARA;
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
void* pReq = taosMemoryCalloc(1, tlen);
|
||||
pReq = taosMemoryCalloc(1, tlen);
|
||||
if (pReq == NULL) {
|
||||
tscError("consumer:0x%" PRIx64 ", failed to malloc askEpReq msg, size:%d", pTmq->consumerId, tlen);
|
||||
askEpFn(pTmq, TSDB_CODE_OUT_OF_MEMORY, NULL, param);
|
||||
return;
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
if (tSerializeSMqAskEpReq(pReq, tlen, &req) < 0) {
|
||||
tscError("consumer:0x%" PRIx64 ", tSerializeSMqAskEpReq %d failed", pTmq->consumerId, tlen);
|
||||
taosMemoryFree(pReq);
|
||||
|
||||
askEpFn(pTmq, TSDB_CODE_INVALID_PARA, NULL, param);
|
||||
return;
|
||||
code = TSDB_CODE_INVALID_PARA;
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
SMqAskEpCbParam* pParam = taosMemoryCalloc(1, sizeof(SMqAskEpCbParam));
|
||||
pParam = taosMemoryCalloc(1, sizeof(SMqAskEpCbParam));
|
||||
if (pParam == NULL) {
|
||||
tscError("consumer:0x%" PRIx64 ", failed to malloc subscribe param", pTmq->consumerId);
|
||||
taosMemoryFree(pReq);
|
||||
|
||||
askEpFn(pTmq, TSDB_CODE_OUT_OF_MEMORY, NULL, param);
|
||||
return;
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
pParam->refId = pTmq->refId;
|
||||
pParam->epoch = pTmq->epoch;
|
||||
pParam->pUserFn = askEpFn;
|
||||
pParam->pParam = param;
|
||||
|
||||
SMsgSendInfo* sendInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo));
|
||||
if (sendInfo == NULL) {
|
||||
taosMemoryFree(pParam);
|
||||
taosMemoryFree(pReq);
|
||||
askEpFn(pTmq, TSDB_CODE_OUT_OF_MEMORY, NULL, param);
|
||||
return;
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
goto FAIL;
|
||||
}
|
||||
|
||||
sendInfo->msgInfo = (SDataBuf){.pData = pReq, .len = tlen, .handle = NULL};
|
||||
|
@ -2586,7 +2522,15 @@ void asyncAskEp(tmq_t* pTmq, __tmq_askep_fn_t askEpFn, void* param) {
|
|||
tscInfo("consumer:0x%" PRIx64 " ask ep from mnode, reqId:0x%" PRIx64, pTmq->consumerId, sendInfo->requestId);
|
||||
|
||||
int64_t transporterId = 0;
|
||||
asyncSendMsgToServer(pTmq->pTscObj->pAppInfo->pTransporter, &epSet, &transporterId, sendInfo);
|
||||
code = asyncSendMsgToServer(pTmq->pTscObj->pAppInfo->pTransporter, &epSet, &transporterId, sendInfo);
|
||||
if(code == 0){
|
||||
return;
|
||||
}
|
||||
|
||||
FAIL:
|
||||
taosMemoryFreeClear(pParam);
|
||||
taosMemoryFreeClear(pReq);
|
||||
askEpFn(pTmq, code, NULL, param);
|
||||
}
|
||||
|
||||
int32_t makeTopicVgroupKey(char* dst, const char* topicName, int32_t vg) {
|
||||
|
@ -2609,8 +2553,6 @@ int32_t tmqCommitDone(SMqCommitCbParamSet* pParamSet) {
|
|||
}
|
||||
|
||||
taosMemoryFree(pParamSet);
|
||||
// tmq->needReportOffsetRows = true;
|
||||
|
||||
taosReleaseRef(tmqMgmt.rsetId, refId);
|
||||
return 0;
|
||||
}
|
||||
|
@ -2783,7 +2725,14 @@ int64_t getCommittedFromServer(tmq_t *tmq, char* tname, int32_t vgId, SEpSet* ep
|
|||
sendInfo->msgType = TDMT_VND_TMQ_VG_COMMITTEDINFO;
|
||||
|
||||
int64_t transporterId = 0;
|
||||
asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, epSet, &transporterId, sendInfo);
|
||||
code = asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, epSet, &transporterId, sendInfo);
|
||||
if(code != 0){
|
||||
taosMemoryFree(buf);
|
||||
taosMemoryFree(sendInfo);
|
||||
tsem_destroy(&pParam->sem);
|
||||
taosMemoryFree(pParam);
|
||||
return code;
|
||||
}
|
||||
|
||||
tsem_wait(&pParam->sem);
|
||||
code = pParam->code;
|
||||
|
@ -3042,7 +2991,12 @@ int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_a
|
|||
|
||||
tscInfo("consumer:0x%" PRIx64 " %s retrieve wal info vgId:%d, epoch %d, req:%s, reqId:0x%" PRIx64,
|
||||
tmq->consumerId, pTopic->topicName, pClientVg->vgId, tmq->epoch, offsetFormatBuf, req.reqId);
|
||||
asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, &pClientVg->epSet, &transporterId, sendInfo);
|
||||
code = asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, &pClientVg->epSet, &transporterId, sendInfo);
|
||||
if(code != 0){
|
||||
taosMemoryFree(pParam);
|
||||
taosMemoryFree(msg);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
tsem_wait(&pCommon->rsp);
|
||||
|
@ -3192,7 +3146,14 @@ int32_t tmq_offset_seek(tmq_t* tmq, const char* pTopicName, int32_t vgId, int64_
|
|||
sendInfo->msgType = TDMT_VND_TMQ_SEEK;
|
||||
|
||||
int64_t transporterId = 0;
|
||||
asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, &epSet, &transporterId, sendInfo);
|
||||
code = asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, &epSet, &transporterId, sendInfo);
|
||||
if(code != 0){
|
||||
taosMemoryFree(msg);
|
||||
taosMemoryFree(sendInfo);
|
||||
tsem_destroy(&pParam->sem);
|
||||
taosMemoryFree(pParam);
|
||||
return code;
|
||||
}
|
||||
|
||||
tsem_wait(&pParam->sem);
|
||||
code = pParam->code;
|
||||
|
|
|
@ -2460,10 +2460,10 @@ int32_t tColDataAddValueByDataBlock(SColData *pColData, int8_t type, int32_t byt
|
|||
code = tColDataAppendValueImpl[pColData->flag][CV_FLAG_NULL](pColData, NULL, 0);
|
||||
if (code) goto _exit;
|
||||
} else {
|
||||
if (ASSERT(varDataTLen(data + offset) <= bytes)) {
|
||||
if (varDataTLen(data + offset) > bytes) {
|
||||
uError("var data length invalid, varDataTLen(data + offset):%d <= bytes:%d", (int)varDataTLen(data + offset),
|
||||
bytes);
|
||||
code = TSDB_CODE_INVALID_PARA;
|
||||
code = TSDB_CODE_PAR_VALUE_TOO_LONG;
|
||||
goto _exit;
|
||||
}
|
||||
code = tColDataAppendValueImpl[pColData->flag][CV_FLAG_VALUE](pColData, (uint8_t *)varDataVal(data + offset),
|
||||
|
|
|
@ -81,6 +81,7 @@ int64_t tsMndLogRetention = 2000;
|
|||
int8_t tsGrant = 1;
|
||||
int32_t tsMndGrantMode = 0;
|
||||
bool tsMndSkipGrant = false;
|
||||
bool tsEnableWhiteList = false; // ip white list cfg
|
||||
|
||||
// dnode
|
||||
int64_t tsDndStart = 0;
|
||||
|
@ -659,6 +660,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
|
|||
if (cfgAddInt64(pCfg, "minDiskFreeSize", tsMinDiskFreeSize, TFS_MIN_DISK_FREE_SIZE, 1024 * 1024 * 1024,
|
||||
CFG_SCOPE_SERVER) != 0)
|
||||
return -1;
|
||||
if (cfgAddBool(pCfg, "enableWhiteList", tsEnableWhiteList, CFG_SCOPE_SERVER) != 0) return -1;
|
||||
|
||||
GRANT_CFG_ADD;
|
||||
return 0;
|
||||
|
@ -1047,6 +1049,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
|
|||
tsMndLogRetention = cfgGetItem(pCfg, "mndLogRetention")->i64;
|
||||
tsMndSkipGrant = cfgGetItem(pCfg, "skipGrant")->bval;
|
||||
tsMndGrantMode = cfgGetItem(pCfg, "grantMode")->i32;
|
||||
tsEnableWhiteList = cfgGetItem(pCfg, "enableWhiteList")->bval;
|
||||
|
||||
tsStartUdfd = cfgGetItem(pCfg, "udf")->bval;
|
||||
tstrncpy(tsUdfdResFuncs, cfgGetItem(pCfg, "udfdResFuncs")->str, sizeof(tsUdfdResFuncs));
|
||||
|
@ -1598,6 +1601,7 @@ int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile
|
|||
if (taosSetS3Cfg(tsCfg) != 0) return -1;
|
||||
}
|
||||
taosSetSystemCfg(tsCfg);
|
||||
if (taosSetFileHandlesLimit() != 0) return -1;
|
||||
|
||||
cfgDumpCfg(tsCfg, tsc, false);
|
||||
|
||||
|
|
|
@ -1060,6 +1060,7 @@ int32_t tSerializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) {
|
|||
if (tEncodeCStr(&encoder, pReq->clusterCfg.timezone) < 0) return -1;
|
||||
if (tEncodeCStr(&encoder, pReq->clusterCfg.locale) < 0) return -1;
|
||||
if (tEncodeCStr(&encoder, pReq->clusterCfg.charset) < 0) return -1;
|
||||
if (tEncodeI8(&encoder, pReq->clusterCfg.enableWhiteList) < 0) return -1;
|
||||
|
||||
// vnode loads
|
||||
int32_t vlen = (int32_t)taosArrayGetSize(pReq->pVloads);
|
||||
|
@ -1147,6 +1148,7 @@ int32_t tDeserializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) {
|
|||
if (tDecodeCStrTo(&decoder, pReq->clusterCfg.timezone) < 0) return -1;
|
||||
if (tDecodeCStrTo(&decoder, pReq->clusterCfg.locale) < 0) return -1;
|
||||
if (tDecodeCStrTo(&decoder, pReq->clusterCfg.charset) < 0) return -1;
|
||||
if (tDecodeI8(&decoder, &pReq->clusterCfg.enableWhiteList) < 0) return -1;
|
||||
|
||||
// vnode loads
|
||||
int32_t vlen = 0;
|
||||
|
@ -1380,6 +1382,11 @@ int32_t tSerializeSCreateUserReq(void *buf, int32_t bufLen, SCreateUserReq *pReq
|
|||
if (tEncodeI8(&encoder, pReq->enable) < 0) return -1;
|
||||
if (tEncodeCStr(&encoder, pReq->user) < 0) return -1;
|
||||
if (tEncodeCStr(&encoder, pReq->pass) < 0) return -1;
|
||||
if (tEncodeI32(&encoder, pReq->numIpRanges) < 0) return -1;
|
||||
for (int32_t i = 0; i < pReq->numIpRanges; ++i) {
|
||||
if (tEncodeU32(&encoder, pReq->pIpRanges[i].ip) < 0) return -1;
|
||||
if (tEncodeU32(&encoder, pReq->pIpRanges[i].mask) < 0) return -1;
|
||||
}
|
||||
tEndEncode(&encoder);
|
||||
|
||||
int32_t tlen = encoder.pos;
|
||||
|
@ -1398,12 +1405,21 @@ int32_t tDeserializeSCreateUserReq(void *buf, int32_t bufLen, SCreateUserReq *pR
|
|||
if (tDecodeI8(&decoder, &pReq->enable) < 0) return -1;
|
||||
if (tDecodeCStrTo(&decoder, pReq->user) < 0) return -1;
|
||||
if (tDecodeCStrTo(&decoder, pReq->pass) < 0) return -1;
|
||||
if (tDecodeI32(&decoder, &pReq->numIpRanges) < 0) return -1;
|
||||
pReq->pIpRanges = taosMemoryMalloc(pReq->numIpRanges * sizeof(SIpV4Range));
|
||||
if (pReq->pIpRanges == NULL) return -1;
|
||||
for (int32_t i = 0; i < pReq->numIpRanges; ++i) {
|
||||
if (tDecodeU32(&decoder, &(pReq->pIpRanges[i].ip)) < 0) return -1;
|
||||
if (tDecodeU32(&decoder, &(pReq->pIpRanges[i].mask)) < 0) return -1;
|
||||
}
|
||||
tEndDecode(&decoder);
|
||||
|
||||
tDecoderClear(&decoder);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void tFreeSCreateUserReq(SCreateUserReq *pReq) { taosMemoryFree(pReq->pIpRanges); }
|
||||
|
||||
int32_t tSerializeSAlterUserReq(void *buf, int32_t bufLen, SAlterUserReq *pReq) {
|
||||
SEncoder encoder = {0};
|
||||
tEncoderInit(&encoder, buf, bufLen);
|
||||
|
@ -1422,6 +1438,11 @@ int32_t tSerializeSAlterUserReq(void *buf, int32_t bufLen, SAlterUserReq *pReq)
|
|||
if (tEncodeCStr(&encoder, pReq->tabName) < 0) return -1;
|
||||
}
|
||||
if (tEncodeBinary(&encoder, pReq->tagCond, pReq->tagCondLen) < 0) return -1;
|
||||
if (tEncodeI32(&encoder, pReq->numIpRanges) < 0) return -1;
|
||||
for (int32_t i = 0; i < pReq->numIpRanges; ++i) {
|
||||
if (tEncodeU32(&encoder, pReq->pIpRanges[i].ip) < 0) return -1;
|
||||
if (tEncodeU32(&encoder, pReq->pIpRanges[i].mask) < 0) return -1;
|
||||
}
|
||||
tEndEncode(&encoder);
|
||||
|
||||
int32_t tlen = encoder.pos;
|
||||
|
@ -1451,13 +1472,23 @@ int32_t tDeserializeSAlterUserReq(void *buf, int32_t bufLen, SAlterUserReq *pReq
|
|||
if (tDecodeBinaryAlloc(&decoder, (void **)&pReq->tagCond, &tagCondLen) < 0) return -1;
|
||||
pReq->tagCondLen = tagCondLen;
|
||||
}
|
||||
if (tDecodeI32(&decoder, &pReq->numIpRanges) < 0) return -1;
|
||||
pReq->pIpRanges = taosMemoryMalloc(pReq->numIpRanges * sizeof(SIpV4Range));
|
||||
if (pReq->pIpRanges == NULL) return -1;
|
||||
for (int32_t i = 0; i < pReq->numIpRanges; ++i) {
|
||||
if (tDecodeU32(&decoder, &(pReq->pIpRanges[i].ip)) < 0) return -1;
|
||||
if (tDecodeU32(&decoder, &(pReq->pIpRanges[i].mask)) < 0) return -1;
|
||||
}
|
||||
tEndDecode(&decoder);
|
||||
|
||||
tDecoderClear(&decoder);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void tFreeSAlterUserReq(SAlterUserReq *pReq) { taosMemoryFreeClear(pReq->tagCond); }
|
||||
void tFreeSAlterUserReq(SAlterUserReq *pReq) {
|
||||
taosMemoryFreeClear(pReq->tagCond);
|
||||
taosMemoryFree(pReq->pIpRanges);
|
||||
}
|
||||
|
||||
int32_t tSerializeSGetUserAuthReq(void *buf, int32_t bufLen, SGetUserAuthReq *pReq) {
|
||||
SEncoder encoder = {0};
|
||||
|
@ -4730,7 +4761,7 @@ int32_t tDeserializeSAlterVnodeReplicaReq(void *buf, int32_t bufLen, SAlterVnode
|
|||
if (tDecodeSReplica(&decoder, pReplica) < 0) return -1;
|
||||
}
|
||||
}
|
||||
if (!tDecodeIsEnd(&decoder)){
|
||||
if (!tDecodeIsEnd(&decoder)) {
|
||||
if (tDecodeI32(&decoder, &pReq->changeVersion) < 0) return -1;
|
||||
}
|
||||
|
||||
|
@ -5601,17 +5632,17 @@ void tFreeSSubQueryMsg(SSubQueryMsg *pReq) {
|
|||
taosMemoryFreeClear(pReq->msg);
|
||||
}
|
||||
|
||||
int32_t tSerializeSOperatorParam(SEncoder* pEncoder, SOperatorParam* pOpParam) {
|
||||
int32_t tSerializeSOperatorParam(SEncoder *pEncoder, SOperatorParam *pOpParam) {
|
||||
if (tEncodeI32(pEncoder, pOpParam->opType) < 0) return -1;
|
||||
if (tEncodeI32(pEncoder, pOpParam->downstreamIdx) < 0) return -1;
|
||||
switch (pOpParam->opType) {
|
||||
case QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN: {
|
||||
STableScanOperatorParam* pScan = (STableScanOperatorParam*)pOpParam->value;
|
||||
STableScanOperatorParam *pScan = (STableScanOperatorParam *)pOpParam->value;
|
||||
if (tEncodeI8(pEncoder, pScan->tableSeq) < 0) return -1;
|
||||
int32_t uidNum = taosArrayGetSize(pScan->pUidList);
|
||||
if (tEncodeI32(pEncoder, uidNum) < 0) return -1;
|
||||
for (int32_t m = 0; m < uidNum; ++m) {
|
||||
int64_t* pUid = taosArrayGet(pScan->pUidList, m);
|
||||
int64_t *pUid = taosArrayGet(pScan->pUidList, m);
|
||||
if (tEncodeI64(pEncoder, *pUid) < 0) return -1;
|
||||
}
|
||||
break;
|
||||
|
@ -5619,25 +5650,25 @@ int32_t tSerializeSOperatorParam(SEncoder* pEncoder, SOperatorParam* pOpParam) {
|
|||
default:
|
||||
return TSDB_CODE_INVALID_PARA;
|
||||
}
|
||||
|
||||
|
||||
int32_t n = taosArrayGetSize(pOpParam->pChildren);
|
||||
if (tEncodeI32(pEncoder, n) < 0) return -1;
|
||||
for (int32_t i = 0; i < n; ++i) {
|
||||
SOperatorParam* pChild = *(SOperatorParam**)taosArrayGet(pOpParam->pChildren, i);
|
||||
SOperatorParam *pChild = *(SOperatorParam **)taosArrayGet(pOpParam->pChildren, i);
|
||||
if (tSerializeSOperatorParam(pEncoder, pChild) < 0) return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t tDeserializeSOperatorParam(SDecoder *pDecoder, SOperatorParam* pOpParam) {
|
||||
int32_t tDeserializeSOperatorParam(SDecoder *pDecoder, SOperatorParam *pOpParam) {
|
||||
if (tDecodeI32(pDecoder, &pOpParam->opType) < 0) return -1;
|
||||
if (tDecodeI32(pDecoder, &pOpParam->downstreamIdx) < 0) return -1;
|
||||
switch (pOpParam->opType) {
|
||||
case QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN: {
|
||||
STableScanOperatorParam* pScan = taosMemoryMalloc(sizeof(STableScanOperatorParam));
|
||||
STableScanOperatorParam *pScan = taosMemoryMalloc(sizeof(STableScanOperatorParam));
|
||||
if (NULL == pScan) return -1;
|
||||
if (tDecodeI8(pDecoder, (int8_t*)&pScan->tableSeq) < 0) return -1;
|
||||
if (tDecodeI8(pDecoder, (int8_t *)&pScan->tableSeq) < 0) return -1;
|
||||
int32_t uidNum = 0;
|
||||
int64_t uid = 0;
|
||||
if (tDecodeI32(pDecoder, &uidNum) < 0) return -1;
|
||||
|
@ -5664,7 +5695,7 @@ int32_t tDeserializeSOperatorParam(SDecoder *pDecoder, SOperatorParam* pOpParam)
|
|||
pOpParam->pChildren = taosArrayInit(childrenNum, POINTER_BYTES);
|
||||
if (NULL == pOpParam->pChildren) return -1;
|
||||
for (int32_t i = 0; i < childrenNum; ++i) {
|
||||
SOperatorParam* pChild = taosMemoryCalloc(1, sizeof(SOperatorParam));
|
||||
SOperatorParam *pChild = taosMemoryCalloc(1, sizeof(SOperatorParam));
|
||||
if (NULL == pChild) return -1;
|
||||
if (tDeserializeSOperatorParam(pDecoder, pChild) < 0) return -1;
|
||||
taosArrayPush(pOpParam->pChildren, &pChild);
|
||||
|
@ -5676,7 +5707,6 @@ int32_t tDeserializeSOperatorParam(SDecoder *pDecoder, SOperatorParam* pOpParam)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int32_t tSerializeSResFetchReq(void *buf, int32_t bufLen, SResFetchReq *pReq) {
|
||||
int32_t headLen = sizeof(SMsgHead);
|
||||
if (buf != NULL) {
|
||||
|
@ -5737,7 +5767,7 @@ int32_t tDeserializeSResFetchReq(void *buf, int32_t bufLen, SResFetchReq *pReq)
|
|||
if (NULL == pReq->pOpParam) return -1;
|
||||
if (tDeserializeSOperatorParam(&decoder, pReq->pOpParam) < 0) return -1;
|
||||
}
|
||||
|
||||
|
||||
tEndDecode(&decoder);
|
||||
|
||||
tDecoderClear(&decoder);
|
||||
|
@ -5925,7 +5955,7 @@ int32_t tDeserializeSTaskNotifyReq(void *buf, int32_t bufLen, STaskNotifyReq *pR
|
|||
if (tDecodeU64(&decoder, &pReq->taskId) < 0) return -1;
|
||||
if (tDecodeI64(&decoder, &pReq->refId) < 0) return -1;
|
||||
if (tDecodeI32(&decoder, &pReq->execId) < 0) return -1;
|
||||
if (tDecodeI32(&decoder, (int32_t*)&pReq->type) < 0) return -1;
|
||||
if (tDecodeI32(&decoder, (int32_t *)&pReq->type) < 0) return -1;
|
||||
|
||||
tEndDecode(&decoder);
|
||||
|
||||
|
@ -5933,7 +5963,6 @@ int32_t tDeserializeSTaskNotifyReq(void *buf, int32_t bufLen, STaskNotifyReq *pR
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int32_t tSerializeSQueryTableRsp(void *buf, int32_t bufLen, SQueryTableRsp *pRsp) {
|
||||
SEncoder encoder = {0};
|
||||
tEncoderInit(&encoder, buf, bufLen);
|
||||
|
@ -5951,7 +5980,7 @@ int32_t tSerializeSQueryTableRsp(void *buf, int32_t bufLen, SQueryTableRsp *pRsp
|
|||
if (tEncodeI32(&encoder, pVer->tversion) < 0) return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tEndEncode(&encoder);
|
||||
|
||||
int32_t tlen = encoder.pos;
|
||||
|
@ -5979,7 +6008,7 @@ int32_t tDeserializeSQueryTableRsp(void *buf, int32_t bufLen, SQueryTableRsp *pR
|
|||
if (tDecodeI32(&decoder, &tbVer.tversion) < 0) return -1;
|
||||
if (NULL == taosArrayPush(pRsp->tbVerInfo, &tbVer)) return -1;
|
||||
}
|
||||
|
||||
|
||||
tEndDecode(&decoder);
|
||||
|
||||
tDecoderClear(&decoder);
|
||||
|
|
|
@ -91,6 +91,7 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) {
|
|||
req.clusterCfg.statusInterval = tsStatusInterval;
|
||||
req.clusterCfg.checkTime = 0;
|
||||
req.clusterCfg.ttlChangeOnWrite = tsTtlChangeOnWrite;
|
||||
req.clusterCfg.enableWhiteList = tsEnableWhiteList ? 1 : 0;
|
||||
char timestr[32] = "1970-01-01 00:00:00.00";
|
||||
(void)taosParseTime(timestr, &req.clusterCfg.checkTime, (int32_t)strlen(timestr), TSDB_TIME_PRECISION_MILLI, 0);
|
||||
memcpy(req.clusterCfg.timezone, tsTimezoneStr, TD_TIMEZONE_LEN);
|
||||
|
|
|
@ -56,7 +56,7 @@ void *dmSetMgmtHandle(SArray *pArray, tmsg_t msgType, void *nodeMsgFp, bool need
|
|||
|
||||
void dmGetMonitorSystemInfo(SMonSysInfo *pInfo) {
|
||||
taosGetCpuUsage(&pInfo->cpu_system, &pInfo->cpu_engine);
|
||||
taosGetCpuCores(&pInfo->cpu_cores);
|
||||
taosGetCpuCores(&pInfo->cpu_cores, false);
|
||||
taosGetProcMemory(&pInfo->mem_engine);
|
||||
taosGetSysMemory(&pInfo->mem_system);
|
||||
pInfo->mem_total = tsTotalMemoryKB;
|
||||
|
|
|
@ -136,6 +136,7 @@ typedef enum {
|
|||
DND_REASON_LOCALE_NOT_MATCH,
|
||||
DND_REASON_CHARSET_NOT_MATCH,
|
||||
DND_REASON_TTL_CHANGE_ON_WRITE_NOT_MATCH,
|
||||
DND_REASON_ENABLE_WHITELIST_NOT_MATCH,
|
||||
DND_REASON_OTHERS
|
||||
} EDndReason;
|
||||
|
||||
|
|
|
@ -401,7 +401,6 @@ static int32_t mndProcessMqHbReq(SRpcMsg *pMsg) {
|
|||
|
||||
SMqSubscribeObj *pSub = mndAcquireSubscribe(pMnode, pConsumer->cgroup, data->topicName);
|
||||
if(pSub == NULL){
|
||||
ASSERT(0);
|
||||
continue;
|
||||
}
|
||||
taosWLockLatch(&pSub->lock);
|
||||
|
|
|
@ -1017,7 +1017,10 @@ static int32_t mndProcessAlterDbReq(SRpcMsg *pReq) {
|
|||
}
|
||||
|
||||
code = mndSetDbCfgFromAlterDbReq(&dbObj, &alterReq);
|
||||
if (code != 0) goto _OVER;
|
||||
if (code != 0) {
|
||||
if (code == TSDB_CODE_MND_DB_OPTION_UNCHANGED) code = 0;
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
code = mndCheckInChangeDbCfg(pMnode, &dbObj.cfg);
|
||||
if (code != 0) goto _OVER;
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
#define _DEFAULT_SOURCE
|
||||
#include "mndDnode.h"
|
||||
#include "audit.h"
|
||||
#include "mndCluster.h"
|
||||
#include "mndDb.h"
|
||||
#include "mndMnode.h"
|
||||
#include "mndPrivilege.h"
|
||||
|
@ -25,8 +27,6 @@
|
|||
#include "mndUser.h"
|
||||
#include "mndVgroup.h"
|
||||
#include "tmisce.h"
|
||||
#include "mndCluster.h"
|
||||
#include "audit.h"
|
||||
|
||||
#define TSDB_DNODE_VER_NUMBER 2
|
||||
#define TSDB_DNODE_RESERVE_SIZE 64
|
||||
|
@ -421,6 +421,11 @@ static int32_t mndCheckClusterCfgPara(SMnode *pMnode, SDnodeObj *pDnode, const S
|
|||
tsTtlChangeOnWrite);
|
||||
return DND_REASON_TTL_CHANGE_ON_WRITE_NOT_MATCH;
|
||||
}
|
||||
int8_t enable = tsEnableWhiteList ? 1 : 0;
|
||||
if (pCfg->enableWhiteList != enable) {
|
||||
mError("dnode:%d, enable :%d inconsistent with cluster:%d", pDnode->id, pCfg->enableWhiteList, enable);
|
||||
return DND_REASON_ENABLE_WHITELIST_NOT_MATCH;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -926,14 +931,10 @@ _OVER:
|
|||
|
||||
extern int32_t mndProcessRestoreDnodeReqImpl(SRpcMsg *pReq);
|
||||
|
||||
int32_t mndProcessRestoreDnodeReq(SRpcMsg *pReq){
|
||||
return mndProcessRestoreDnodeReqImpl(pReq);
|
||||
}
|
||||
int32_t mndProcessRestoreDnodeReq(SRpcMsg *pReq) { return mndProcessRestoreDnodeReqImpl(pReq); }
|
||||
|
||||
#ifndef TD_ENTERPRISE
|
||||
int32_t mndProcessRestoreDnodeReqImpl(SRpcMsg *pReq){
|
||||
return 0;
|
||||
}
|
||||
int32_t mndProcessRestoreDnodeReqImpl(SRpcMsg *pReq) { return 0; }
|
||||
#endif
|
||||
|
||||
static int32_t mndDropDnode(SMnode *pMnode, SRpcMsg *pReq, SDnodeObj *pDnode, SMnodeObj *pMObj, SQnodeObj *pQObj,
|
||||
|
@ -1004,15 +1005,14 @@ static int32_t mndProcessDropDnodeReq(SRpcMsg *pReq) {
|
|||
goto _OVER;
|
||||
}
|
||||
|
||||
mInfo("dnode:%d, start to drop, ep:%s:%d, force:%s, unsafe:%s",
|
||||
dropReq.dnodeId, dropReq.fqdn, dropReq.port, dropReq.force?"true":"false", dropReq.unsafe?"true":"false");
|
||||
mInfo("dnode:%d, start to drop, ep:%s:%d, force:%s, unsafe:%s", dropReq.dnodeId, dropReq.fqdn, dropReq.port,
|
||||
dropReq.force ? "true" : "false", dropReq.unsafe ? "true" : "false");
|
||||
if (mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_DROP_MNODE) != 0) {
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
bool force = dropReq.force;
|
||||
if(dropReq.unsafe)
|
||||
{
|
||||
if (dropReq.unsafe) {
|
||||
force = true;
|
||||
}
|
||||
|
||||
|
@ -1043,19 +1043,19 @@ static int32_t mndProcessDropDnodeReq(SRpcMsg *pReq) {
|
|||
}
|
||||
|
||||
int32_t numOfVnodes = mndGetVnodesNum(pMnode, pDnode->id);
|
||||
bool isonline = mndIsDnodeOnline(pDnode, taosGetTimestampMs());
|
||||
bool isonline = mndIsDnodeOnline(pDnode, taosGetTimestampMs());
|
||||
|
||||
if (isonline && force) {
|
||||
terrno = TSDB_CODE_DNODE_ONLY_USE_WHEN_OFFLINE;
|
||||
mError("dnode:%d, failed to drop since %s, vnodes:%d mnode:%d qnode:%d snode:%d", pDnode->id, terrstr(),
|
||||
numOfVnodes, pMObj != NULL, pQObj != NULL, pSObj != NULL);
|
||||
numOfVnodes, pMObj != NULL, pQObj != NULL, pSObj != NULL);
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
if (!isonline && !force) {
|
||||
terrno = TSDB_CODE_DNODE_OFFLINE;
|
||||
mError("dnode:%d, failed to drop since %s, vnodes:%d mnode:%d qnode:%d snode:%d", pDnode->id, terrstr(),
|
||||
numOfVnodes, pMObj != NULL, pQObj != NULL, pSObj != NULL);
|
||||
numOfVnodes, pMObj != NULL, pQObj != NULL, pSObj != NULL);
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
|
@ -1065,8 +1065,8 @@ static int32_t mndProcessDropDnodeReq(SRpcMsg *pReq) {
|
|||
char obj1[30] = {0};
|
||||
sprintf(obj1, "%d", dropReq.dnodeId);
|
||||
|
||||
//char obj2[150] = {0};
|
||||
//sprintf(obj2, "%s:%d", dropReq.fqdn, dropReq.port);
|
||||
// char obj2[150] = {0};
|
||||
// sprintf(obj2, "%s:%d", dropReq.fqdn, dropReq.port);
|
||||
|
||||
char detail[100] = {0};
|
||||
sprintf(detail, "force:%d, unsafe:%d", dropReq.force, dropReq.unsafe);
|
||||
|
@ -1164,8 +1164,8 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
|
|||
if (code < 0) return code;
|
||||
|
||||
if (flag < 0) {
|
||||
mError("dnode:%d, failed to config ttlBatchDropNum since value:%d. Valid range: [0, %d]", cfgReq.dnodeId,
|
||||
flag, INT32_MAX);
|
||||
mError("dnode:%d, failed to config ttlBatchDropNum since value:%d. Valid range: [0, %d]", cfgReq.dnodeId, flag,
|
||||
INT32_MAX);
|
||||
terrno = TSDB_CODE_INVALID_CFG;
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -669,7 +669,7 @@ _OVER:
|
|||
|
||||
mndReleaseUser(pMnode, pUser);
|
||||
mndReleaseUser(pMnode, pOperUser);
|
||||
|
||||
tFreeSCreateUserReq(&createReq);
|
||||
return code;
|
||||
}
|
||||
|
||||
|
|
|
@ -288,6 +288,7 @@ typedef struct {
|
|||
int64_t numOfSTables;
|
||||
int64_t numOfCTables;
|
||||
int64_t numOfNTables;
|
||||
int64_t numOfCmprTables;
|
||||
int64_t numOfNTimeSeries;
|
||||
int64_t numOfTimeSeries;
|
||||
int64_t itvTimeSeries;
|
||||
|
|
|
@ -61,5 +61,12 @@ int metaPrepareAsyncCommit(SMeta *pMeta) {
|
|||
// abort the meta txn
|
||||
int metaAbort(SMeta *pMeta) {
|
||||
if (!pMeta->txn) return 0;
|
||||
return tdbAbort(pMeta->pEnv, pMeta->txn);
|
||||
int code = tdbAbort(pMeta->pEnv, pMeta->txn);
|
||||
if (code) {
|
||||
metaError("vgId:%d, failed to abort meta since %s", TD_VID(pMeta->pVnode), tstrerror(terrno));
|
||||
} else {
|
||||
pMeta->txn = NULL;
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
|
|
@ -699,13 +699,16 @@ int64_t metaGetTbNum(SMeta *pMeta) {
|
|||
// N.B. Called by statusReq per second
|
||||
int64_t metaGetTimeSeriesNum(SMeta *pMeta) {
|
||||
// sum of (number of columns of stable - 1) * number of ctables (excluding timestamp column)
|
||||
if (pMeta->pVnode->config.vndStats.numOfTimeSeries <= 0 ||
|
||||
int64_t nTables = metaGetTbNum(pMeta);
|
||||
if (nTables - pMeta->pVnode->config.vndStats.numOfCmprTables > 100 ||
|
||||
pMeta->pVnode->config.vndStats.numOfTimeSeries <= 0 ||
|
||||
++pMeta->pVnode->config.vndStats.itvTimeSeries % (60 * 5) == 0) {
|
||||
int64_t num = 0;
|
||||
vnodeGetTimeSeriesNum(pMeta->pVnode, &num);
|
||||
pMeta->pVnode->config.vndStats.numOfTimeSeries = num;
|
||||
|
||||
pMeta->pVnode->config.vndStats.itvTimeSeries = (TD_VID(pMeta->pVnode) % 100) * 2;
|
||||
pMeta->pVnode->config.vndStats.numOfCmprTables = nTables;
|
||||
}
|
||||
|
||||
return pMeta->pVnode->config.vndStats.numOfTimeSeries + pMeta->pVnode->config.vndStats.numOfNTimeSeries;
|
||||
|
|
|
@ -269,19 +269,21 @@ int32_t tqProcessSeekReq(STQ* pTq, SRpcMsg* pMsg) {
|
|||
}
|
||||
|
||||
tqDebug("tmq seek: consumer:0x%" PRIx64 " vgId:%d, subkey %s", req.consumerId, vgId, req.subKey);
|
||||
taosWLockLatch(&pTq->lock);
|
||||
|
||||
STqHandle* pHandle = taosHashGet(pTq->pHandle, req.subKey, strlen(req.subKey));
|
||||
if (pHandle == NULL) {
|
||||
tqWarn("tmq seek: consumer:0x%" PRIx64 " vgId:%d subkey %s not found", req.consumerId, vgId, req.subKey);
|
||||
code = 0;
|
||||
taosWUnLockLatch(&pTq->lock);
|
||||
goto end;
|
||||
}
|
||||
|
||||
// 2. check consumer-vg assignment status
|
||||
taosRLockLatch(&pTq->lock);
|
||||
if (pHandle->consumerId != req.consumerId) {
|
||||
tqError("ERROR tmq seek: consumer:0x%" PRIx64 " vgId:%d, subkey %s, mismatch for saved handle consumer:0x%" PRIx64,
|
||||
req.consumerId, vgId, req.subKey, pHandle->consumerId);
|
||||
taosRUnLockLatch(&pTq->lock);
|
||||
taosWUnLockLatch(&pTq->lock);
|
||||
code = TSDB_CODE_TMQ_CONSUMER_MISMATCH;
|
||||
goto end;
|
||||
}
|
||||
|
@ -289,7 +291,7 @@ int32_t tqProcessSeekReq(STQ* pTq, SRpcMsg* pMsg) {
|
|||
// if consumer register to push manager, push empty to consumer to change vg status from TMQ_VG_STATUS__WAIT to
|
||||
// TMQ_VG_STATUS__IDLE, otherwise poll data failed after seek.
|
||||
tqUnregisterPushHandle(pTq, pHandle);
|
||||
taosRUnLockLatch(&pTq->lock);
|
||||
taosWUnLockLatch(&pTq->lock);
|
||||
|
||||
end:
|
||||
rsp.code = code;
|
||||
|
@ -496,15 +498,16 @@ int32_t tqProcessVgWalInfoReq(STQ* pTq, SRpcMsg* pMsg) {
|
|||
int32_t vgId = TD_VID(pTq->pVnode);
|
||||
|
||||
// 1. find handle
|
||||
taosRLockLatch(&pTq->lock);
|
||||
STqHandle* pHandle = taosHashGet(pTq->pHandle, req.subKey, strlen(req.subKey));
|
||||
if (pHandle == NULL) {
|
||||
tqError("consumer:0x%" PRIx64 " vgId:%d subkey:%s not found", consumerId, vgId, req.subKey);
|
||||
terrno = TSDB_CODE_INVALID_MSG;
|
||||
taosRUnLockLatch(&pTq->lock);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// 2. check re-balance status
|
||||
taosRLockLatch(&pTq->lock);
|
||||
if (pHandle->consumerId != consumerId) {
|
||||
tqDebug("ERROR consumer:0x%" PRIx64 " vgId:%d, subkey %s, mismatch for saved handle consumer:0x%" PRIx64,
|
||||
consumerId, vgId, req.subKey, pHandle->consumerId);
|
||||
|
@ -580,7 +583,7 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
|
|||
bool exec = tqIsHandleExec(pHandle);
|
||||
|
||||
if(exec){
|
||||
tqInfo("vgId:%d, topic:%s, subscription is executing, wait for 10ms and retry, pHandle:%p", vgId,
|
||||
tqInfo("vgId:%d, topic:%s, subscription is executing, delete wait for 10ms and retry, pHandle:%p", vgId,
|
||||
pHandle->subKey, pHandle);
|
||||
taosWUnLockLatch(&pTq->lock);
|
||||
taosMsleep(10);
|
||||
|
@ -689,19 +692,29 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
|
|||
}
|
||||
ret = tqMetaSaveHandle(pTq, req.subKey, &handle);
|
||||
} else {
|
||||
taosWLockLatch(&pTq->lock);
|
||||
|
||||
if (pHandle->consumerId == req.newConsumerId) { // do nothing
|
||||
tqInfo("vgId:%d no switch consumer:0x%" PRIx64 " remains, because redo wal log", req.vgId, req.newConsumerId);
|
||||
} else {
|
||||
tqInfo("vgId:%d switch consumer from Id:0x%" PRIx64 " to Id:0x%" PRIx64, req.vgId, pHandle->consumerId,
|
||||
req.newConsumerId);
|
||||
atomic_store_64(&pHandle->consumerId, req.newConsumerId);
|
||||
atomic_store_32(&pHandle->epoch, 0);
|
||||
tqUnregisterPushHandle(pTq, pHandle);
|
||||
ret = tqMetaSaveHandle(pTq, req.subKey, pHandle);
|
||||
while(1){
|
||||
taosWLockLatch(&pTq->lock);
|
||||
bool exec = tqIsHandleExec(pHandle);
|
||||
if(exec){
|
||||
tqInfo("vgId:%d, topic:%s, subscription is executing, sub wait for 10ms and retry, pHandle:%p", pTq->pVnode->config.vgId,
|
||||
pHandle->subKey, pHandle);
|
||||
taosWUnLockLatch(&pTq->lock);
|
||||
taosMsleep(10);
|
||||
continue;
|
||||
}
|
||||
if (pHandle->consumerId == req.newConsumerId) { // do nothing
|
||||
tqInfo("vgId:%d no switch consumer:0x%" PRIx64 " remains, because redo wal log", req.vgId, req.newConsumerId);
|
||||
} else {
|
||||
tqInfo("vgId:%d switch consumer from Id:0x%" PRIx64 " to Id:0x%" PRIx64, req.vgId, pHandle->consumerId,
|
||||
req.newConsumerId);
|
||||
atomic_store_64(&pHandle->consumerId, req.newConsumerId);
|
||||
atomic_store_32(&pHandle->epoch, 0);
|
||||
tqUnregisterPushHandle(pTq, pHandle);
|
||||
ret = tqMetaSaveHandle(pTq, req.subKey, pHandle);
|
||||
}
|
||||
taosWUnLockLatch(&pTq->lock);
|
||||
break;
|
||||
}
|
||||
taosWUnLockLatch(&pTq->lock);
|
||||
}
|
||||
|
||||
end:
|
||||
|
@ -1678,6 +1691,7 @@ int32_t tqProcessTaskUpdateReq(STQ* pTq, SRpcMsg* pMsg) {
|
|||
char* msg = POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead));
|
||||
int32_t len = pMsg->contLen - sizeof(SMsgHead);
|
||||
SRpcMsg rsp = {.info = pMsg->info, .code = TSDB_CODE_SUCCESS};
|
||||
bool allStopped = false;
|
||||
|
||||
SStreamTaskNodeUpdateMsg req = {0};
|
||||
|
||||
|
@ -1750,7 +1764,7 @@ int32_t tqProcessTaskUpdateReq(STQ* pTq, SRpcMsg* pMsg) {
|
|||
|
||||
// possibly only handle the stream task.
|
||||
int32_t numOfTasks = streamMetaGetNumOfTasks(pMeta);
|
||||
bool allStopped = (pMeta->closedTask == numOfTasks);
|
||||
allStopped = (pMeta->closedTask == numOfTasks);
|
||||
if (allStopped) {
|
||||
pMeta->closedTask = 0;
|
||||
} else {
|
||||
|
|
|
@ -367,7 +367,7 @@ int32_t extractMsgFromWal(SWalReader* pReader, void** pItem, int64_t maxVer, con
|
|||
bool tqNextBlockInWal(STqReader* pReader, const char* id) {
|
||||
SWalReader* pWalReader = pReader->pWalReader;
|
||||
|
||||
// uint64_t st = taosGetTimestampMs();
|
||||
uint64_t st = taosGetTimestampMs();
|
||||
while (1) {
|
||||
SArray* pBlockList = pReader->submit.aSubmitTbData;
|
||||
if (pBlockList == NULL || pReader->nextBlk >= taosArrayGetSize(pBlockList)) {
|
||||
|
@ -442,9 +442,9 @@ bool tqNextBlockInWal(STqReader* pReader, const char* id) {
|
|||
|
||||
pReader->msg.msgStr = NULL;
|
||||
|
||||
// if(taosGetTimestampMs() - st > 5){
|
||||
// return false;
|
||||
// }
|
||||
if(taosGetTimestampMs() - st > 1000){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -165,7 +165,6 @@ struct SStreamTaskWriter {
|
|||
STQ* pTq;
|
||||
int64_t sver;
|
||||
int64_t ever;
|
||||
TXN* txn;
|
||||
};
|
||||
|
||||
int32_t streamTaskSnapWriterOpen(STQ* pTq, int64_t sver, int64_t ever, SStreamTaskWriter** ppWriter) {
|
||||
|
@ -182,12 +181,6 @@ int32_t streamTaskSnapWriterOpen(STQ* pTq, int64_t sver, int64_t ever, SStreamTa
|
|||
pWriter->sver = sver;
|
||||
pWriter->ever = ever;
|
||||
|
||||
if (tdbBegin(pTq->pStreamMeta->db, &pWriter->txn, tdbDefaultMalloc, tdbDefaultFree, NULL, 0) < 0) {
|
||||
code = -1;
|
||||
taosMemoryFree(pWriter);
|
||||
goto _err;
|
||||
}
|
||||
|
||||
*ppWriter = pWriter;
|
||||
tqDebug("vgId:%d, vnode stream-task snapshot writer opened", TD_VID(pTq->pVnode));
|
||||
return code;
|
||||
|
@ -203,30 +196,33 @@ int32_t streamTaskSnapWriterClose(SStreamTaskWriter* pWriter, int8_t rollback) {
|
|||
int32_t code = 0;
|
||||
STQ* pTq = pWriter->pTq;
|
||||
|
||||
taosWLockLatch(&pTq->pStreamMeta->lock);
|
||||
tqDebug("vgId:%d, vnode stream-task snapshot writer closed", TD_VID(pTq->pVnode));
|
||||
if (rollback) {
|
||||
tdbAbort(pWriter->pTq->pStreamMeta->db, pWriter->txn);
|
||||
tdbAbort(pTq->pStreamMeta->db, pTq->pStreamMeta->txn);
|
||||
} else {
|
||||
code = tdbCommit(pWriter->pTq->pStreamMeta->db, pWriter->txn);
|
||||
code = tdbCommit(pTq->pStreamMeta->db, pTq->pStreamMeta->txn);
|
||||
if (code) goto _err;
|
||||
code = tdbPostCommit(pWriter->pTq->pStreamMeta->db, pWriter->txn);
|
||||
code = tdbPostCommit(pTq->pStreamMeta->db, pTq->pStreamMeta->txn);
|
||||
if (code) goto _err;
|
||||
}
|
||||
|
||||
if (tdbBegin(pTq->pStreamMeta->db, &pTq->pStreamMeta->txn, tdbDefaultMalloc, tdbDefaultFree, NULL, 0) < 0) {
|
||||
code = -1;
|
||||
taosMemoryFree(pWriter);
|
||||
goto _err;
|
||||
}
|
||||
|
||||
taosWUnLockLatch(&pTq->pStreamMeta->lock);
|
||||
|
||||
taosMemoryFree(pWriter);
|
||||
|
||||
// restore from metastore
|
||||
// if (tqMetaRestoreHandle(pTq) < 0) {
|
||||
// goto _err;
|
||||
// }
|
||||
|
||||
return code;
|
||||
|
||||
_err:
|
||||
tqError("vgId:%d, vnode stream-task snapshot writer failed to close since %s", TD_VID(pWriter->pTq->pVnode),
|
||||
tstrerror(code));
|
||||
taosWUnLockLatch(&pTq->pStreamMeta->lock);
|
||||
return code;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t streamTaskSnapWrite(SStreamTaskWriter* pWriter, uint8_t* pData, uint32_t nData) {
|
||||
|
@ -247,11 +243,13 @@ int32_t streamTaskSnapWrite(SStreamTaskWriter* pWriter, uint8_t* pData, uint32_t
|
|||
}
|
||||
tDecoderClear(&decoder);
|
||||
// tdbTbInsert(TTB *pTb, const void *pKey, int keyLen, const void *pVal, int valLen, TXN *pTxn)
|
||||
|
||||
taosWLockLatch(&pTq->pStreamMeta->lock);
|
||||
int64_t key[2] = {task.streamId, task.taskId};
|
||||
|
||||
taosWLockLatch(&pTq->pStreamMeta->lock);
|
||||
if (tdbTbUpsert(pTq->pStreamMeta->pTaskDb, key, sizeof(int64_t) << 1, (uint8_t*)pData + sizeof(SSnapDataHdr),
|
||||
nData - sizeof(SSnapDataHdr), pWriter->txn) < 0) {
|
||||
nData - sizeof(SSnapDataHdr), pTq->pStreamMeta->txn) < 0) {
|
||||
taosWUnLockLatch(&pTq->pStreamMeta->lock);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -213,11 +213,11 @@ static int32_t extractDataAndRspForDbStbSubscribe(STQ* pTq, STqHandle* pHandle,
|
|||
walReaderVerifyOffset(pHandle->pWalReader, offset);
|
||||
int64_t fetchVer = offset->version;
|
||||
|
||||
// uint64_t st = taosGetTimestampMs();
|
||||
uint64_t st = taosGetTimestampMs();
|
||||
int totalRows = 0;
|
||||
while (1) {
|
||||
// int32_t savedEpoch = atomic_load_32(&pHandle->epoch);
|
||||
// ASSERT (savedEpoch <= pRequest->epoch);
|
||||
int32_t savedEpoch = atomic_load_32(&pHandle->epoch);
|
||||
ASSERT(savedEpoch <= pRequest->epoch);
|
||||
|
||||
if (tqFetchLog(pTq, pHandle, &fetchVer, pRequest->reqId) < 0) {
|
||||
tqOffsetResetToLog(&taosxRsp.rspOffset, fetchVer);
|
||||
|
@ -260,8 +260,7 @@ static int32_t extractDataAndRspForDbStbSubscribe(STQ* pTq, STqHandle* pHandle,
|
|||
goto end;
|
||||
}
|
||||
|
||||
// if (totalRows >= 4096 || taosxRsp.createTableNum > 0 || (taosGetTimestampMs() - st > 5)) {
|
||||
if (totalRows >= 4096 || taosxRsp.createTableNum > 0) {
|
||||
if (totalRows >= 4096 || taosxRsp.createTableNum > 0 || (taosGetTimestampMs() - st > 1000)) {
|
||||
tqOffsetResetToLog(&taosxRsp.rspOffset, fetchVer + 1);
|
||||
code = tqSendDataRsp(pHandle, pMsg, pRequest, (SMqDataRsp*)&taosxRsp, taosxRsp.createTableNum > 0 ? TMQ_MSG_TYPE__POLL_DATA_META_RSP : TMQ_MSG_TYPE__POLL_DATA_RSP, vgId);
|
||||
goto end;
|
||||
|
|
|
@ -857,6 +857,9 @@ static int32_t tsdbSnapWriteTombRecord(STsdbSnapWriter* writer, const STombRecor
|
|||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
code = tsdbIterMergerNext(writer->ctx->tombIterMerger);
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
}
|
||||
|
||||
if (record->suid == INT64_MAX) {
|
||||
|
|
|
@ -545,13 +545,10 @@ int32_t vnodeGetCtbNum(SVnode *pVnode, int64_t suid, int64_t *num) {
|
|||
}
|
||||
|
||||
static int32_t vnodeGetStbColumnNum(SVnode *pVnode, tb_uid_t suid, int *num) {
|
||||
STSchema *pTSchema = metaGetTbTSchema(pVnode->pMeta, suid, -1, 1);
|
||||
// metaGetTbTSchemaEx(pVnode->pMeta, suid, suid, -1, &pTSchema);
|
||||
|
||||
if (pTSchema) {
|
||||
*num = pTSchema->numOfCols;
|
||||
|
||||
taosMemoryFree(pTSchema);
|
||||
SSchemaWrapper *pSW = metaGetTableSchema(pVnode->pMeta, suid, -1, 1);
|
||||
if (pSW) {
|
||||
*num = pSW->nCols;
|
||||
tDeleteSchemaWrapper(pSW);
|
||||
} else {
|
||||
*num = 2;
|
||||
}
|
||||
|
|
|
@ -425,20 +425,6 @@ int32_t vnodeSnapWriterClose(SVSnapWriter *pWriter, int8_t rollback, SSnapshot *
|
|||
if (code) goto _exit;
|
||||
}
|
||||
|
||||
if (pWriter->pStreamTaskWriter) {
|
||||
code = streamTaskSnapWriterClose(pWriter->pStreamTaskWriter, rollback);
|
||||
if (code) goto _exit;
|
||||
}
|
||||
|
||||
if (pWriter->pStreamStateWriter) {
|
||||
code = streamStateSnapWriterClose(pWriter->pStreamStateWriter, rollback);
|
||||
if (code) goto _exit;
|
||||
|
||||
code = streamStateRebuildFromSnap(pWriter->pStreamStateWriter, 0);
|
||||
pWriter->pStreamStateWriter = NULL;
|
||||
if (code) goto _exit;
|
||||
}
|
||||
|
||||
if (pWriter->pRsmaSnapWriter) {
|
||||
code = rsmaSnapWriterClose(&pWriter->pRsmaSnapWriter, rollback);
|
||||
if (code) goto _exit;
|
||||
|
|
|
@ -786,6 +786,8 @@ static void doStreamIntervalAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSDat
|
|||
if (startPos < 0) {
|
||||
break;
|
||||
}
|
||||
qDebug("===stream===ignore expired data, window end ts:%" PRId64 ", maxts - wartermak:%" PRId64, nextWin.ekey,
|
||||
pInfo->twAggSup.maxTs - pInfo->twAggSup.waterMark);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1552,6 +1554,7 @@ void destroyStreamSessionAggOperatorInfo(void* param) {
|
|||
tSimpleHashCleanup(pInfo->pStUpdated);
|
||||
tSimpleHashCleanup(pInfo->pStDeleted);
|
||||
pInfo->pUpdated = taosArrayDestroy(pInfo->pUpdated);
|
||||
cleanupGroupResInfo(&pInfo->groupResInfo);
|
||||
|
||||
taosArrayDestroy(pInfo->historyWins);
|
||||
blockDataDestroy(pInfo->pCheckpointRes);
|
||||
|
@ -2197,6 +2200,7 @@ void initGroupResInfoFromArrayList(SGroupResInfo* pGroupResInfo, SArray* pArrayL
|
|||
pGroupResInfo->pRows = pArrayList;
|
||||
pGroupResInfo->index = 0;
|
||||
pGroupResInfo->pBuf = NULL;
|
||||
pGroupResInfo->freeItem = false;
|
||||
}
|
||||
|
||||
void doBuildSessionResult(SOperatorInfo* pOperator, void* pState, SGroupResInfo* pGroupResInfo, SSDataBlock* pBlock) {
|
||||
|
@ -2874,10 +2878,12 @@ void destroyStreamStateOperatorInfo(void* param) {
|
|||
}
|
||||
colDataDestroy(&pInfo->twAggSup.timeWindowData);
|
||||
blockDataDestroy(pInfo->pDelRes);
|
||||
taosArrayDestroy(pInfo->historyWins);
|
||||
tSimpleHashCleanup(pInfo->pSeUpdated);
|
||||
tSimpleHashCleanup(pInfo->pSeDeleted);
|
||||
pInfo->pUpdated = taosArrayDestroy(pInfo->pUpdated);
|
||||
cleanupGroupResInfo(&pInfo->groupResInfo);
|
||||
|
||||
taosArrayDestroy(pInfo->historyWins);
|
||||
blockDataDestroy(pInfo->pCheckpointRes);
|
||||
|
||||
taosMemoryFreeClear(param);
|
||||
|
|
|
@ -121,7 +121,8 @@ static int32_t udfSpawnUdfd(SUdfdData *pData) {
|
|||
snprintf(dnodeIdEnvItem, 32, "%s=%d", "DNODE_ID", pData->dnodeId);
|
||||
|
||||
float numCpuCores = 4;
|
||||
taosGetCpuCores(&numCpuCores);
|
||||
taosGetCpuCores(&numCpuCores, false);
|
||||
numCpuCores = TMAX(numCpuCores, 2);
|
||||
snprintf(thrdPoolSizeEnvItem, 32, "%s=%d", "UV_THREADPOOL_SIZE", (int)numCpuCores * 2);
|
||||
|
||||
char pathTaosdLdLib[512] = {0};
|
||||
|
|
|
@ -924,8 +924,17 @@ void nodesDestroyNode(SNode* pNode) {
|
|||
nodesDestroyNode((SNode*)pStmt->pVal);
|
||||
break;
|
||||
}
|
||||
case QUERY_NODE_CREATE_USER_STMT: // no pointer field
|
||||
case QUERY_NODE_ALTER_USER_STMT: // no pointer field
|
||||
case QUERY_NODE_CREATE_USER_STMT: {
|
||||
SCreateUserStmt* pStmt = (SCreateUserStmt*)pNode;
|
||||
taosMemoryFree(pStmt->pIpRanges);
|
||||
nodesDestroyList(pStmt->pNodeListIpRanges);
|
||||
break;
|
||||
}
|
||||
case QUERY_NODE_ALTER_USER_STMT: {
|
||||
SAlterUserStmt* pStmt = (SAlterUserStmt*)pNode;
|
||||
taosMemoryFree(pStmt->pIpRanges);
|
||||
nodesDestroyList(pStmt->pNodeListIpRanges);
|
||||
}
|
||||
case QUERY_NODE_DROP_USER_STMT: // no pointer field
|
||||
case QUERY_NODE_USE_DATABASE_STMT: // no pointer field
|
||||
case QUERY_NODE_CREATE_DNODE_STMT: // no pointer field
|
||||
|
|
|
@ -192,7 +192,8 @@ SNode* createShowDnodeVariablesStmt(SAstCreateContext* pCxt, SNode* pDnodeId, SN
|
|||
SNode* createShowVnodesStmt(SAstCreateContext* pCxt, SNode* pDnodeId, SNode* pDnodeEndpoint);
|
||||
SNode* createShowTableTagsStmt(SAstCreateContext* pCxt, SNode* pTbName, SNode* pDbName, SNodeList* pTags);
|
||||
SNode* createCreateUserStmt(SAstCreateContext* pCxt, SToken* pUserName, const SToken* pPassword, int8_t sysinfo);
|
||||
SNode* createAlterUserStmt(SAstCreateContext* pCxt, SToken* pUserName, int8_t alterType, const SToken* pVal);
|
||||
SNode* addCreateUserStmtWhiteList(SAstCreateContext* pCxt, SNode* pStmt, SNodeList* pIpRangesNodeList);
|
||||
SNode* createAlterUserStmt(SAstCreateContext* pCxt, SToken* pUserName, int8_t alterType, void* pAlterInfo);
|
||||
SNode* createDropUserStmt(SAstCreateContext* pCxt, SToken* pUserName);
|
||||
SNode* createCreateDnodeStmt(SAstCreateContext* pCxt, const SToken* pFqdn, const SToken* pPort);
|
||||
SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, bool force, bool unsafe);
|
||||
|
|
|
@ -81,11 +81,31 @@ alter_account_option ::= USERS literal.
|
|||
alter_account_option ::= CONNS literal. { }
|
||||
alter_account_option ::= STATE literal. { }
|
||||
|
||||
%type ip_range_list { SNodeList* }
|
||||
%destructor ip_range_list { nodesDestroyList($$); }
|
||||
ip_range_list(A) ::= NK_STRING(B). { A = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &B)); }
|
||||
ip_range_list(A) ::= ip_range_list(B) NK_COMMA NK_STRING(C). { A = addNodeToList(pCxt, B, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &C)); }
|
||||
|
||||
%type white_list { SNodeList* }
|
||||
%destructor white_list { nodesDestroyList($$); }
|
||||
white_list(A) ::= HOST ip_range_list(B). { A = B; }
|
||||
|
||||
%type white_list_opt { SNodeList* }
|
||||
%destructor white_list_opt { nodesDestroyList($$); }
|
||||
white_list_opt(A) ::= . { A = NULL; }
|
||||
white_list_opt(A) ::= white_list(B). { A = B; }
|
||||
|
||||
/************************************************ create/alter/drop user **********************************************/
|
||||
cmd ::= CREATE USER user_name(A) PASS NK_STRING(B) sysinfo_opt(C). { pCxt->pRootNode = createCreateUserStmt(pCxt, &A, &B, C); }
|
||||
cmd ::= CREATE USER user_name(A) PASS NK_STRING(B) sysinfo_opt(C)
|
||||
white_list_opt(D). {
|
||||
pCxt->pRootNode = createCreateUserStmt(pCxt, &A, &B, C);
|
||||
pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, D);
|
||||
}
|
||||
cmd ::= ALTER USER user_name(A) PASS NK_STRING(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_PASSWD, &B); }
|
||||
cmd ::= ALTER USER user_name(A) ENABLE NK_INTEGER(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_ENABLE, &B); }
|
||||
cmd ::= ALTER USER user_name(A) SYSINFO NK_INTEGER(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_SYSINFO, &B); }
|
||||
cmd ::= ALTER USER user_name(A) ADD white_list(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_ADD_WHITE_LIST, B); }
|
||||
cmd ::= ALTER USER user_name(A) DROP white_list(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_DROP_WHITE_LIST, B); }
|
||||
cmd ::= DROP USER user_name(A). { pCxt->pRootNode = createDropUserStmt(pCxt, &A); }
|
||||
|
||||
%type sysinfo_opt { int8_t }
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <uv.h>
|
||||
#include <regex.h>
|
||||
|
||||
#include "parAst.h"
|
||||
|
@ -1653,6 +1653,86 @@ SNode* createShowTableTagsStmt(SAstCreateContext* pCxt, SNode* pTbName, SNode* p
|
|||
return (SNode*)pStmt;
|
||||
}
|
||||
|
||||
static int32_t getIpV4RangeFromWhitelistItem(char* ipRange, SIpV4Range* pIpRange) {
|
||||
int32_t code = TSDB_CODE_SUCCESS;
|
||||
char* ipCopy = taosStrdup(ipRange);
|
||||
char* slash = strchr(ipCopy, '/');
|
||||
if (slash) {
|
||||
*slash = '\0';
|
||||
struct in_addr addr;
|
||||
if (uv_inet_pton(AF_INET, ipCopy, &addr) == 0) {
|
||||
int prefix = atoi(slash + 1);
|
||||
if (prefix < 0 || prefix > 32) {
|
||||
code = TSDB_CODE_PAR_INVALID_IP_RANGE;
|
||||
} else {
|
||||
pIpRange->ip = addr.s_addr;
|
||||
uint32_t mask = (1 << (32 - prefix)) - 1;
|
||||
mask = htonl(~mask);
|
||||
pIpRange->mask = mask;
|
||||
code = TSDB_CODE_SUCCESS;
|
||||
}
|
||||
} else {
|
||||
code = TSDB_CODE_PAR_INVALID_IP_RANGE;
|
||||
}
|
||||
} else {
|
||||
struct in_addr addr;
|
||||
if (uv_inet_pton(AF_INET, ipCopy, &addr) == 0) {
|
||||
pIpRange->ip = addr.s_addr;
|
||||
pIpRange->mask = 0xFFFFFFFF;
|
||||
code = TSDB_CODE_SUCCESS;
|
||||
} else {
|
||||
code = TSDB_CODE_PAR_INVALID_IP_RANGE;
|
||||
}
|
||||
}
|
||||
|
||||
taosMemoryFreeClear(ipCopy);
|
||||
return code;
|
||||
}
|
||||
|
||||
static int32_t fillIpRangesFromWhiteList(SAstCreateContext* pCxt, SNodeList* pIpRangesNodeList, SIpV4Range* pIpRanges) {
|
||||
int32_t i = 0;
|
||||
int32_t code = 0;
|
||||
|
||||
SNode* pNode = NULL;
|
||||
FOREACH(pNode, pIpRangesNodeList) {
|
||||
if (QUERY_NODE_VALUE != nodeType(pNode)) {
|
||||
pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_IP_RANGE);
|
||||
return TSDB_CODE_PAR_INVALID_IP_RANGE;
|
||||
}
|
||||
SValueNode* pValNode = (SValueNode*)(pNode);
|
||||
code = getIpV4RangeFromWhitelistItem(pValNode->literal, pIpRanges + i);
|
||||
++i;
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
pCxt->errCode = generateSyntaxErrMsgExt(&pCxt->msgBuf, code, "Invalid IP range %s", pValNode->literal);
|
||||
return code;
|
||||
}
|
||||
}
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
SNode* addCreateUserStmtWhiteList(SAstCreateContext* pCxt, SNode* pCreateUserStmt, SNodeList* pIpRangesNodeList) {
|
||||
if (NULL == pCreateUserStmt || NULL == pIpRangesNodeList) {
|
||||
return pCreateUserStmt;
|
||||
}
|
||||
|
||||
((SCreateUserStmt*)pCreateUserStmt)->pNodeListIpRanges = pIpRangesNodeList;
|
||||
SCreateUserStmt* pCreateUser = (SCreateUserStmt*)pCreateUserStmt;
|
||||
pCreateUser->numIpRanges = LIST_LENGTH(pIpRangesNodeList);
|
||||
pCreateUser->pIpRanges = taosMemoryMalloc(pCreateUser->numIpRanges * sizeof(SIpV4Range));
|
||||
if (NULL == pCreateUser->pIpRanges) {
|
||||
pCxt->errCode = TSDB_CODE_OUT_OF_MEMORY;
|
||||
nodesDestroyNode(pCreateUserStmt);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int32_t code = fillIpRangesFromWhiteList(pCxt, pIpRangesNodeList, pCreateUser->pIpRanges);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
nodesDestroyNode(pCreateUserStmt);
|
||||
return NULL;
|
||||
}
|
||||
return pCreateUserStmt;
|
||||
}
|
||||
|
||||
SNode* createCreateUserStmt(SAstCreateContext* pCxt, SToken* pUserName, const SToken* pPassword, int8_t sysinfo) {
|
||||
CHECK_PARSER_STATUS(pCxt);
|
||||
char password[TSDB_USET_PASSWORD_LEN + 3] = {0};
|
||||
|
@ -1667,7 +1747,7 @@ SNode* createCreateUserStmt(SAstCreateContext* pCxt, SToken* pUserName, const ST
|
|||
return (SNode*)pStmt;
|
||||
}
|
||||
|
||||
SNode* createAlterUserStmt(SAstCreateContext* pCxt, SToken* pUserName, int8_t alterType, const SToken* pVal) {
|
||||
SNode* createAlterUserStmt(SAstCreateContext* pCxt, SToken* pUserName, int8_t alterType, void* pAlterInfo) {
|
||||
CHECK_PARSER_STATUS(pCxt);
|
||||
if (!checkUserName(pCxt, pUserName)) {
|
||||
return NULL;
|
||||
|
@ -1679,6 +1759,7 @@ SNode* createAlterUserStmt(SAstCreateContext* pCxt, SToken* pUserName, int8_t al
|
|||
switch (alterType) {
|
||||
case TSDB_ALTER_USER_PASSWD: {
|
||||
char password[TSDB_USET_PASSWORD_LEN] = {0};
|
||||
SToken* pVal = pAlterInfo;
|
||||
if (!checkPassword(pCxt, pVal, password)) {
|
||||
nodesDestroyNode((SNode*)pStmt);
|
||||
return NULL;
|
||||
|
@ -1686,12 +1767,35 @@ SNode* createAlterUserStmt(SAstCreateContext* pCxt, SToken* pUserName, int8_t al
|
|||
strcpy(pStmt->password, password);
|
||||
break;
|
||||
}
|
||||
case TSDB_ALTER_USER_ENABLE:
|
||||
case TSDB_ALTER_USER_ENABLE: {
|
||||
SToken* pVal = pAlterInfo;
|
||||
pStmt->enable = taosStr2Int8(pVal->z, NULL, 10);
|
||||
break;
|
||||
case TSDB_ALTER_USER_SYSINFO:
|
||||
}
|
||||
case TSDB_ALTER_USER_SYSINFO: {
|
||||
SToken* pVal = pAlterInfo;
|
||||
pStmt->sysinfo = taosStr2Int8(pVal->z, NULL, 10);
|
||||
break;
|
||||
}
|
||||
case TSDB_ALTER_USER_ADD_WHITE_LIST:
|
||||
case TSDB_ALTER_USER_DROP_WHITE_LIST: {
|
||||
SNodeList* pIpRangesNodeList = pAlterInfo;
|
||||
pStmt->pNodeListIpRanges = pIpRangesNodeList;
|
||||
pStmt->numIpRanges = LIST_LENGTH(pIpRangesNodeList);
|
||||
pStmt->pIpRanges = taosMemoryMalloc(pStmt->numIpRanges * sizeof(SIpV4Range));
|
||||
if (NULL == pStmt->pIpRanges) {
|
||||
pCxt->errCode = TSDB_CODE_OUT_OF_MEMORY;
|
||||
nodesDestroyNode((SNode*)pStmt);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int32_t code = fillIpRangesFromWhiteList(pCxt, pIpRangesNodeList, pStmt->pIpRanges);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
nodesDestroyNode((SNode*)pStmt);
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -683,8 +683,10 @@ int rawBlockBindData(SQuery* query, STableMeta* pTableMeta, void* data, SVCreate
|
|||
pStart += BitmapLen(numOfRows);
|
||||
}
|
||||
char* pData = pStart;
|
||||
|
||||
tColDataAddValueByDataBlock(pCol, pColSchema->type, pColSchema->bytes, numOfRows, offset, pData);
|
||||
ret = tColDataAddValueByDataBlock(pCol, pColSchema->type, pColSchema->bytes, numOfRows, offset, pData);
|
||||
if(ret != 0){
|
||||
goto end;
|
||||
}
|
||||
fields += sizeof(int8_t) + sizeof(int32_t);
|
||||
if (needChangeLength) {
|
||||
pStart += htonl(colLength[j]);
|
||||
|
@ -712,7 +714,10 @@ int rawBlockBindData(SQuery* query, STableMeta* pTableMeta, void* data, SVCreate
|
|||
char* pData = pStart;
|
||||
|
||||
SColData* pCol = taosArrayGet(pTableCxt->pData->aCol, j);
|
||||
tColDataAddValueByDataBlock(pCol, pColSchema->type, pColSchema->bytes, numOfRows, offset, pData);
|
||||
ret = tColDataAddValueByDataBlock(pCol, pColSchema->type, pColSchema->bytes, numOfRows, offset, pData);
|
||||
if(ret != 0){
|
||||
goto end;
|
||||
}
|
||||
fields += sizeof(int8_t) + sizeof(int32_t);
|
||||
if (needChangeLength) {
|
||||
pStart += htonl(colLength[i]);
|
||||
|
@ -729,7 +734,10 @@ int rawBlockBindData(SQuery* query, STableMeta* pTableMeta, void* data, SVCreate
|
|||
for (int c = 0; c < boundInfo->numOfBound; ++c) {
|
||||
if( boundInfo->pColIndex[c] != -1){
|
||||
SColData* pCol = taosArrayGet(pTableCxt->pData->aCol, c);
|
||||
tColDataAddValueByDataBlock(pCol, 0, 0, numOfRows, NULL, NULL);
|
||||
ret = tColDataAddValueByDataBlock(pCol, 0, 0, numOfRows, NULL, NULL);
|
||||
if(ret != 0){
|
||||
goto end;
|
||||
}
|
||||
}else{
|
||||
boundInfo->pColIndex[c] = c; // restore for next block
|
||||
}
|
||||
|
|
|
@ -109,6 +109,7 @@ static SKeyword keywordTable[] = {
|
|||
{"GRANTS", TK_GRANTS},
|
||||
{"GROUP", TK_GROUP},
|
||||
{"HAVING", TK_HAVING},
|
||||
{"HOST", TK_HOST},
|
||||
{"IF", TK_IF},
|
||||
{"IGNORE", TK_IGNORE},
|
||||
{"IMPORT", TK_IMPORT},
|
||||
|
|
|
@ -5744,8 +5744,15 @@ static int32_t translateCreateUser(STranslateContext* pCxt, SCreateUserStmt* pSt
|
|||
createReq.sysInfo = pStmt->sysinfo;
|
||||
createReq.enable = 1;
|
||||
strcpy(createReq.pass, pStmt->password);
|
||||
|
||||
return buildCmdMsg(pCxt, TDMT_MND_CREATE_USER, (FSerializeFunc)tSerializeSCreateUserReq, &createReq);
|
||||
|
||||
createReq.numIpRanges = pStmt->numIpRanges;
|
||||
if (pStmt->numIpRanges > 0) {
|
||||
createReq.pIpRanges = taosMemoryMalloc(createReq.numIpRanges * sizeof(SIpV4Range));
|
||||
memcpy(createReq.pIpRanges, pStmt->pIpRanges, sizeof(SIpV4Range) * createReq.numIpRanges);
|
||||
}
|
||||
int32_t code = buildCmdMsg(pCxt, TDMT_MND_CREATE_USER, (FSerializeFunc)tSerializeSCreateUserReq, &createReq);
|
||||
tFreeSCreateUserReq(&createReq);
|
||||
return code;
|
||||
}
|
||||
|
||||
static int32_t translateAlterUser(STranslateContext* pCxt, SAlterUserStmt* pStmt) {
|
||||
|
@ -5760,7 +5767,14 @@ static int32_t translateAlterUser(STranslateContext* pCxt, SAlterUserStmt* pStmt
|
|||
snprintf(alterReq.objname, sizeof(alterReq.objname), "%s", pCxt->pParseCxt->db);
|
||||
}
|
||||
|
||||
return buildCmdMsg(pCxt, TDMT_MND_ALTER_USER, (FSerializeFunc)tSerializeSAlterUserReq, &alterReq);
|
||||
alterReq.numIpRanges = pStmt->numIpRanges;
|
||||
if (pStmt->numIpRanges > 0) {
|
||||
alterReq.pIpRanges = taosMemoryMalloc(alterReq.numIpRanges * sizeof(SIpV4Range));
|
||||
memcpy(alterReq.pIpRanges, pStmt->pIpRanges, sizeof(SIpV4Range) * alterReq.numIpRanges);
|
||||
}
|
||||
int32_t code = buildCmdMsg(pCxt, TDMT_MND_ALTER_USER, (FSerializeFunc)tSerializeSAlterUserReq, &alterReq);
|
||||
tFreeSAlterUserReq(&alterReq);
|
||||
return code;
|
||||
}
|
||||
|
||||
static int32_t translateDropUser(STranslateContext* pCxt, SDropUserStmt* pStmt) {
|
||||
|
|
|
@ -37,6 +37,8 @@ static char* getSyntaxErrFormat(int32_t errCode) {
|
|||
return "Column ambiguously defined: %s";
|
||||
case TSDB_CODE_PAR_WRONG_VALUE_TYPE:
|
||||
return "Invalid value type: %s";
|
||||
case TSDB_CODE_PAR_INVALID_VARBINARY:
|
||||
return "Invalid varbinary value: %s";
|
||||
case TSDB_CODE_PAR_ILLEGAL_USE_AGG_FUNCTION:
|
||||
return "There mustn't be aggregation";
|
||||
case TSDB_CODE_PAR_WRONG_NUMBER_OF_SELECT:
|
||||
|
@ -182,6 +184,8 @@ static char* getSyntaxErrFormat(int32_t errCode) {
|
|||
return "No valid function in window query";
|
||||
case TSDB_CODE_PAR_INVALID_OPTR_USAGE:
|
||||
return "Invalid usage of expr: %s";
|
||||
case TSDB_CODE_PAR_INVALID_IP_RANGE:
|
||||
return "invalid ip range";
|
||||
case TSDB_CODE_OUT_OF_MEMORY:
|
||||
return "Out of memory";
|
||||
default:
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -543,10 +543,13 @@ int32_t streamMetaUnregisterTask(SStreamMeta* pMeta, int64_t streamId, int32_t t
|
|||
}
|
||||
|
||||
int32_t streamMetaBegin(SStreamMeta* pMeta) {
|
||||
taosWLockLatch(&pMeta->lock);
|
||||
if (tdbBegin(pMeta->db, &pMeta->txn, tdbDefaultMalloc, tdbDefaultFree, NULL,
|
||||
TDB_TXN_WRITE | TDB_TXN_READ_UNCOMMITTED) < 0) {
|
||||
taosWUnLockLatch(&pMeta->lock);
|
||||
return -1;
|
||||
}
|
||||
taosWUnLockLatch(&pMeta->lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -345,7 +345,7 @@ bool streamStateCheck(SStreamState* pState, const SWinKey* key) {
|
|||
return hasRowBuff(pState->pFileState, (void*)key, sizeof(SWinKey));
|
||||
#else
|
||||
SStateKey sKey = {.key = *key, .opNum = pState->number};
|
||||
return tdbTbGet(pState->pTdbState->pStateDb, &sKey, sizeof(SStateKey), pVal, pVLen);
|
||||
return tdbTbGet(pState->pTdbState->pStateDb, &sKey, sizeof(SStateKey), NULL, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
|
||||
#define FLUSH_RATIO 0.5
|
||||
#define FLUSH_NUM 4
|
||||
#define DEFAULT_MAX_STREAM_BUFFER_SIZE (128 * 1024 * 1024);
|
||||
#define DEFAULT_MAX_STREAM_BUFFER_SIZE (128 * 1024 * 1024)
|
||||
#define MIN_NUM_OF_ROW_BUFF 10240
|
||||
|
||||
struct SStreamFileState {
|
||||
SList* usedBuffs;
|
||||
|
@ -67,7 +68,7 @@ SStreamFileState* streamFileStateInit(int64_t memSize, uint32_t keySize, uint32_
|
|||
pFileState->usedBuffs = tdListNew(POINTER_BYTES);
|
||||
pFileState->freeBuffs = tdListNew(POINTER_BYTES);
|
||||
_hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY);
|
||||
int32_t cap = TMIN(10240, pFileState->maxRowCount);
|
||||
int32_t cap = TMIN(MIN_NUM_OF_ROW_BUFF, pFileState->maxRowCount);
|
||||
pFileState->rowBuffMap = tSimpleHashInit(cap, hashFn);
|
||||
if (!pFileState->usedBuffs || !pFileState->freeBuffs || !pFileState->rowBuffMap) {
|
||||
goto _error;
|
||||
|
@ -272,10 +273,12 @@ int32_t getRowBuff(SStreamFileState* pFileState, void* pKey, int32_t keyLen, voi
|
|||
*pVLen = pFileState->rowSize;
|
||||
*pVal = *pos;
|
||||
(*pos)->beUsed = true;
|
||||
(*pos)->beFlushed = false;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
SRowBuffPos* pNewPos = getNewRowPos(pFileState);
|
||||
pNewPos->beUsed = true;
|
||||
pNewPos->beFlushed = false;
|
||||
ASSERT(pNewPos->pRowBuff);
|
||||
memcpy(pNewPos->pKey, pKey, keyLen);
|
||||
|
||||
|
@ -375,6 +378,10 @@ int32_t flushSnapshot(SStreamFileState* pFileState, SStreamSnapshot* pSnapshot,
|
|||
while ((pNode = tdListNext(&iter)) != NULL && code == TSDB_CODE_SUCCESS) {
|
||||
SRowBuffPos* pPos = *(SRowBuffPos**)pNode->data;
|
||||
ASSERT(pPos->pRowBuff && pFileState->rowSize > 0);
|
||||
if (pPos->beFlushed) {
|
||||
continue;
|
||||
}
|
||||
pPos->beFlushed = true;
|
||||
|
||||
if (streamStateGetBatchSize(batch) >= BATCH_LIMIT) {
|
||||
streamStatePutBatch_rocksdb(pFileState->pFileStore, batch);
|
||||
|
@ -513,6 +520,7 @@ int32_t recoverSnapshot(SStreamFileState* pFileState, int64_t ckId) {
|
|||
ASSERT(pVLen == pFileState->rowSize);
|
||||
memcpy(pNewPos->pRowBuff, pVal, pVLen);
|
||||
taosMemoryFreeClear(pVal);
|
||||
pNewPos->beFlushed = true;
|
||||
code = tSimpleHashPut(pFileState->rowBuffMap, pNewPos->pKey, pFileState->keyLen, &pNewPos, POINTER_BYTES);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
destroyRowBuffPos(pNewPos);
|
||||
|
|
|
@ -2562,7 +2562,11 @@ int32_t syncNodeRebuildAndCopyIfExist(SSyncNode* ths, int32_t oldtotalReplicaNum
|
|||
ths->logReplMgrs[i]->matchIndex, ths->logReplMgrs[i]->endIndex);
|
||||
}
|
||||
|
||||
SSyncLogReplMgr oldLogReplMgrs[TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA] = {0};
|
||||
SSyncLogReplMgr* oldLogReplMgrs = NULL;
|
||||
int64_t length = sizeof(SSyncLogReplMgr) * (TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA);
|
||||
oldLogReplMgrs = taosMemoryMalloc(length);
|
||||
if (NULL == oldLogReplMgrs) return -1;
|
||||
memset(oldLogReplMgrs, 0, length);
|
||||
|
||||
for(int i = 0; i < oldtotalReplicaNum; i++){
|
||||
oldLogReplMgrs[i] = *(ths->logReplMgrs[i]);
|
||||
|
@ -2643,6 +2647,8 @@ int32_t syncNodeRebuildAndCopyIfExist(SSyncNode* ths, int32_t oldtotalReplicaNum
|
|||
}
|
||||
}
|
||||
|
||||
taosMemoryFree(oldLogReplMgrs);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -229,7 +229,15 @@ void tdbPCacheInvalidatePage(SPCache *pCache, SPager *pPager, SPgno pgno) {
|
|||
}
|
||||
|
||||
if (pPage) {
|
||||
bool moveToFreeList = false;
|
||||
if (pPage->pLruNext) {
|
||||
tdbPCachePinPage(pCache, pPage);
|
||||
moveToFreeList = true;
|
||||
}
|
||||
tdbPCacheRemovePageFromHash(pCache, pPage);
|
||||
if (moveToFreeList) {
|
||||
tdbPCacheFreePage(pCache, pPage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -296,7 +296,7 @@ int32_t tfsMkdirRecurAt(STfs *pTfs, const char *rname, SDiskID diskId) {
|
|||
// https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/dirname.3.html
|
||||
char *dir = taosStrdup(taosDirName(s));
|
||||
|
||||
if (tfsMkdirRecurAt(pTfs, dir, diskId) < 0) {
|
||||
if (strlen(dir) >= strlen(rname) || tfsMkdirRecurAt(pTfs, dir, diskId) < 0) {
|
||||
taosMemoryFree(s);
|
||||
taosMemoryFree(dir);
|
||||
return -1;
|
||||
|
|
|
@ -43,7 +43,7 @@ target_link_libraries(
|
|||
)
|
||||
if(TD_WINDOWS)
|
||||
target_link_libraries(
|
||||
os PUBLIC ws2_32 iconv msvcregex wcwidth winmm crashdump dbghelp version
|
||||
os PUBLIC ws2_32 iconv msvcregex wcwidth winmm crashdump dbghelp version KtmW32
|
||||
)
|
||||
elseif(TD_DARWIN_64)
|
||||
find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation)
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
#ifdef WINDOWS
|
||||
#include <io.h>
|
||||
#include <WinBase.h>
|
||||
#include <ktmw32.h>
|
||||
#define F_OK 0
|
||||
#define W_OK 2
|
||||
#define R_OK 4
|
||||
|
@ -175,12 +177,32 @@ int32_t taosRemoveFile(const char *path) { return remove(path); }
|
|||
|
||||
int32_t taosRenameFile(const char *oldName, const char *newName) {
|
||||
#ifdef WINDOWS
|
||||
bool code = MoveFileEx(oldName, newName, MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED);
|
||||
if (!code) {
|
||||
printf("failed to rename file %s to %s, reason:%s\n", oldName, newName, strerror(errno));
|
||||
bool finished = false;
|
||||
|
||||
HANDLE transactionHandle = CreateTransaction(NULL, NULL, 0, 0, 0, INFINITE, NULL);
|
||||
if (transactionHandle == INVALID_HANDLE_VALUE) {
|
||||
printf("failed to rename file %s to %s, reason: CreateTransaction failed.\n", oldName, newName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return code ? 0 : -1;
|
||||
BOOL result = MoveFileTransacted(oldName, newName, NULL, NULL, MOVEFILE_REPLACE_EXISTING, transactionHandle);
|
||||
|
||||
if (result) {
|
||||
finished = CommitTransaction(transactionHandle);
|
||||
if (!finished) {
|
||||
DWORD error = GetLastError();
|
||||
printf("failed to rename file %s to %s, reason: CommitTransaction errcode %d.\n", oldName, newName, error);
|
||||
}
|
||||
} else {
|
||||
RollbackTransaction(transactionHandle);
|
||||
DWORD error = GetLastError();
|
||||
finished = false;
|
||||
printf("failed to rename file %s to %s, reason: MoveFileTransacted errcode %d.\n", oldName, newName, error);
|
||||
}
|
||||
|
||||
CloseHandle(transactionHandle);
|
||||
|
||||
return finished ? 0 : -1;
|
||||
#else
|
||||
int32_t code = rename(oldName, newName);
|
||||
if (code < 0) {
|
||||
|
@ -819,14 +841,38 @@ int64_t taosGetLineFile(TdFilePtr pFile, char **__restrict ptrBuf) {
|
|||
return -1;
|
||||
}
|
||||
#ifdef WINDOWS
|
||||
*ptrBuf = taosMemoryMalloc(1024);
|
||||
size_t bufferSize = 512;
|
||||
*ptrBuf = taosMemoryMalloc(bufferSize);
|
||||
if (*ptrBuf == NULL) return -1;
|
||||
if (fgets(*ptrBuf, 1023, pFile->fp) == NULL) {
|
||||
taosMemoryFreeClear(*ptrBuf);
|
||||
return -1;
|
||||
|
||||
size_t bytesRead = 0;
|
||||
size_t totalBytesRead = 0;
|
||||
|
||||
while (1) {
|
||||
char *result = fgets(*ptrBuf + totalBytesRead, bufferSize - totalBytesRead, pFile->fp);
|
||||
if (result == NULL) {
|
||||
taosMemoryFreeClear(*ptrBuf);
|
||||
return -1;
|
||||
}
|
||||
bytesRead = strlen(*ptrBuf + totalBytesRead);
|
||||
totalBytesRead += bytesRead;
|
||||
|
||||
if (totalBytesRead < bufferSize - 1 || (*ptrBuf)[totalBytesRead - 1] == '\n') {
|
||||
break;
|
||||
}
|
||||
|
||||
bufferSize += 512;
|
||||
void* newBuf = taosMemoryRealloc(*ptrBuf, bufferSize);
|
||||
if (newBuf == NULL) {
|
||||
taosMemoryFreeClear(*ptrBuf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
*ptrBuf = newBuf;
|
||||
}
|
||||
(*ptrBuf)[1023] = 0;
|
||||
return strlen(*ptrBuf);
|
||||
|
||||
(*ptrBuf)[totalBytesRead] = '\0';
|
||||
return totalBytesRead;
|
||||
#else
|
||||
size_t len = 0;
|
||||
return getline(ptrBuf, &len, pFile->fp);
|
||||
|
@ -904,10 +950,16 @@ int32_t taosCompressFile(char *srcFileName, char *destFileName) {
|
|||
goto cmp_end;
|
||||
}
|
||||
|
||||
dstFp = gzdopen(pFile->fd, "wb6f");
|
||||
// Both gzclose() and fclose() will close the associated fd, so they need to have different fds.
|
||||
FileFd gzFd = dup(pFile->fd);
|
||||
if (gzFd < 0) {
|
||||
ret = -4;
|
||||
goto cmp_end;
|
||||
}
|
||||
dstFp = gzdopen(gzFd, "wb6f");
|
||||
if (dstFp == NULL) {
|
||||
ret = -3;
|
||||
taosCloseFile(&pFile);
|
||||
close(gzFd);
|
||||
goto cmp_end;
|
||||
}
|
||||
|
||||
|
@ -932,3 +984,12 @@ cmp_end:
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int32_t taosSetFileHandlesLimit() {
|
||||
#ifdef WINDOWS
|
||||
const int max_handles = 8192;
|
||||
int res = _setmaxstdio(max_handles);
|
||||
return res == max_handles ? 0 : -1;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -121,6 +121,8 @@ LONG WINAPI exceptionHandler(LPEXCEPTION_POINTERS exception);
|
|||
static pid_t tsProcId;
|
||||
static char tsSysNetFile[] = "/proc/net/dev";
|
||||
static char tsSysCpuFile[] = "/proc/stat";
|
||||
static char tsCpuPeriodFile[] = "/sys/fs/cgroup/cpu/cpu.cfs_period_us";
|
||||
static char tsCpuQuotaFile[] = "/sys/fs/cgroup/cpu/cpu.cfs_quota_us";
|
||||
static char tsProcCpuFile[25] = {0};
|
||||
static char tsProcMemFile[25] = {0};
|
||||
static char tsProcIOFile[25] = {0};
|
||||
|
@ -234,7 +236,7 @@ bool taosCheckSystemIsLittleEnd() {
|
|||
|
||||
void taosGetSystemInfo() {
|
||||
#ifdef WINDOWS
|
||||
taosGetCpuCores(&tsNumOfCores);
|
||||
taosGetCpuCores(&tsNumOfCores, false);
|
||||
taosGetTotalMemory(&tsTotalMemoryKB);
|
||||
taosGetCpuUsage(NULL, NULL);
|
||||
#elif defined(_TD_DARWIN_64)
|
||||
|
@ -245,7 +247,7 @@ void taosGetSystemInfo() {
|
|||
tsNumOfCores = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
#else
|
||||
taosGetProcIOnfos();
|
||||
taosGetCpuCores(&tsNumOfCores);
|
||||
taosGetCpuCores(&tsNumOfCores, false);
|
||||
taosGetTotalMemory(&tsTotalMemoryKB);
|
||||
taosGetCpuUsage(NULL, NULL);
|
||||
taosGetCpuInstructions(&tsSSE42Enable, &tsAVXEnable, &tsAVX2Enable, &tsFMAEnable);
|
||||
|
@ -493,7 +495,55 @@ int32_t taosGetCpuInfo(char *cpuModel, int32_t maxLen, float *numOfCores) {
|
|||
#endif
|
||||
}
|
||||
|
||||
int32_t taosGetCpuCores(float *numOfCores) {
|
||||
// Returns the container's CPU quota if successful, otherwise returns the physical CPU cores
|
||||
static int32_t taosCntrGetCpuCores(float *numOfCores) {
|
||||
#ifdef WINDOWS
|
||||
return -1;
|
||||
#elif defined(_TD_DARWIN_64)
|
||||
return -1;
|
||||
#else
|
||||
TdFilePtr pFile = NULL;
|
||||
if (!(pFile = taosOpenFile(tsCpuQuotaFile, TD_FILE_READ | TD_FILE_STREAM))) {
|
||||
goto _sys;
|
||||
}
|
||||
char qline[32] = {0};
|
||||
if (taosGetsFile(pFile, sizeof(qline), qline) < 0) {
|
||||
taosCloseFile(&pFile);
|
||||
goto _sys;
|
||||
}
|
||||
taosCloseFile(&pFile);
|
||||
float quota = taosStr2Float(qline, NULL);
|
||||
if (quota < 0) {
|
||||
goto _sys;
|
||||
}
|
||||
|
||||
if (!(pFile = taosOpenFile(tsCpuPeriodFile, TD_FILE_READ | TD_FILE_STREAM))) {
|
||||
goto _sys;
|
||||
}
|
||||
char pline[32] = {0};
|
||||
if (taosGetsFile(pFile, sizeof(pline), pline) < 0) {
|
||||
taosCloseFile(&pFile);
|
||||
goto _sys;
|
||||
}
|
||||
taosCloseFile(&pFile);
|
||||
|
||||
float period = taosStr2Float(pline, NULL);
|
||||
float quotaCores = quota / period;
|
||||
float sysCores = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
if (quotaCores < sysCores && quotaCores > 0) {
|
||||
*numOfCores = quotaCores;
|
||||
} else {
|
||||
*numOfCores = sysCores;
|
||||
}
|
||||
goto _end;
|
||||
_sys:
|
||||
*numOfCores = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
_end:
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int32_t taosGetCpuCores(float *numOfCores, bool physical) {
|
||||
#ifdef WINDOWS
|
||||
SYSTEM_INFO info;
|
||||
GetSystemInfo(&info);
|
||||
|
@ -503,7 +553,11 @@ int32_t taosGetCpuCores(float *numOfCores) {
|
|||
*numOfCores = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
return 0;
|
||||
#else
|
||||
*numOfCores = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
if (physical) {
|
||||
*numOfCores = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
} else {
|
||||
taosCntrGetCpuCores(numOfCores);
|
||||
}
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -537,7 +537,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_ROW_LENGTH, "Row length exceeds
|
|||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_COLUMNS_NUM, "Illegal number of columns")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_TOO_MANY_COLUMNS, "Too many columns")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_FIRST_COLUMN, "First column must be timestamp")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_VAR_COLUMN_LEN, "Invalid binary/nchar column/tag length")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_VAR_COLUMN_LEN, "Invalid varbinary/binary/nchar column/tag length")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_TAGS_NUM, "Invalid number of tag columns")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_PERMISSION_DENIED, "Permission denied")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_STREAM_QUERY, "Invalid stream query")
|
||||
|
@ -556,7 +556,6 @@ TAOS_DEFINE_ERROR(TSDB_CODE_PAR_NOT_ALLOWED_WIN_QUERY, "Window query not su
|
|||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_DROP_COL, "No columns can be dropped")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_COL_JSON, "Only tag can be json type")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_VALUE_TOO_LONG, "Value too long for column/tag")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_VARBINARY, "Invalidate varbinary type")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_DELETE_WHERE, "The DELETE statement must have a definite time window range")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_REDISTRIBUTE_VG, "The REDISTRIBUTE VGROUP statement only support 1 to 3 dnodes")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_FILL_NOT_ALLOWED_FUNC, "Fill not allowed")
|
||||
|
@ -573,6 +572,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_PAR_GET_META_ERROR, "Fail to get table i
|
|||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_NOT_UNIQUE_TABLE_ALIAS, "Not unique table/alias")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_SYSTABLE_NOT_ALLOWED_FUNC, "System table not allowed")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_SYSTABLE_NOT_ALLOWED, "System table not allowed")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_VARBINARY, "Invalidate varbinary value")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_IP_RANGE, "Invalid IPV4 address ranges")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INTERNAL_ERROR, "Parser internal error")
|
||||
|
||||
//planner
|
||||
|
|
|
@ -86,7 +86,7 @@ pip3 install kafka-python
|
|||
python3 kafka_example_consumer.py
|
||||
|
||||
# 21
|
||||
pip3 install taos-ws-py
|
||||
pip3 install taos-ws-py==0.2.6
|
||||
python3 conn_websocket_pandas.py
|
||||
|
||||
# 22
|
||||
|
|
|
@ -95,10 +95,10 @@
|
|||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/slimit.py -Q 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/slimit.py -Q 4
|
||||
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 3-enterprise/restore/restoreDnode.py -N 5 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 3-enterprise/restore/restoreVnode.py -N 5 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 3-enterprise/restore/restoreMnode.py -N 5 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 3-enterprise/restore/restoreQnode.py -N 5 -M 3
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 3-enterprise/restore/restoreDnode.py -N 5 -M 3 -i False
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 3-enterprise/restore/restoreVnode.py -N 5 -M 3 -i False
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 3-enterprise/restore/restoreMnode.py -N 5 -M 3 -i False
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 3-enterprise/restore/restoreQnode.py -N 5 -M 3 -i False
|
||||
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/create_wrong_topic.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/dropDbR3ConflictTransaction.py -N 3
|
||||
|
@ -151,6 +151,7 @@
|
|||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/dataFromTsdbNWal.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/dataFromTsdbNWal-multiCtb.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_taosx.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqSeekAndCommit.py
|
||||
,,n,system-test,python3 ./test.py -f 7-tmq/tmq_offset.py
|
||||
,,n,system-test,python3 ./test.py -f 7-tmq/tmqDataPrecisionUnit.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/raw_block_interface_test.py
|
||||
|
@ -187,6 +188,8 @@
|
|||
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/user_privilege_all.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/fsync.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/multilevel.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/ttl.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/ttlChangeOnWrite.py
|
||||
,,n,system-test,python3 ./test.py -f 0-others/compatibility.py
|
||||
,,n,system-test,python3 ./test.py -f 0-others/tag_index_basic.py
|
||||
,,n,system-test,python3 ./test.py -f 0-others/udfpy_main.py
|
||||
|
@ -825,6 +828,7 @@
|
|||
|
||||
,,y,script,./test.sh -f tsim/user/basic.sim
|
||||
,,y,script,./test.sh -f tsim/user/password.sim
|
||||
,,y,script,./test.sh -f tsim/user/whitelist.sim
|
||||
,,y,script,./test.sh -f tsim/user/privilege_db.sim
|
||||
,,y,script,./test.sh -f tsim/user/privilege_sysinfo.sim
|
||||
,,y,script,./test.sh -f tsim/user/privilege_topic.sim
|
||||
|
|
|
@ -79,7 +79,7 @@ md5sum /home/TDinternal/debug/build/lib/libtaos.so
|
|||
#define taospy 2.7.10
|
||||
pip3 list|grep taospy
|
||||
pip3 uninstall taospy -y
|
||||
pip3 install --default-timeout=120 taospy==2.7.10
|
||||
pip3 install --default-timeout=120 taospy==2.7.12
|
||||
|
||||
#define taos-ws-py 0.2.8
|
||||
pip3 list|grep taos-ws-py
|
||||
|
|
|
@ -219,11 +219,11 @@ def get_auto_mix_cmds(args_list ,valgrind=valgrind_mode):
|
|||
|
||||
if valgrind :
|
||||
|
||||
crash_gen_cmd = 'cd %s && ./crash_gen.sh --valgrind %s -g 0x32c,0x32d,0x3d3,0x18,0x2501,0x369,0x388,0x061a,0x2550,0x0203 '%(crash_gen_path ,arguments)
|
||||
crash_gen_cmd = 'cd %s && ./crash_gen.sh --valgrind %s -g 0x32c,0x32d,0x3d3,0x18,0x2501,0x369,0x388,0x061a,0x2550,0x0203,0x4012 '%(crash_gen_path ,arguments)
|
||||
|
||||
else:
|
||||
|
||||
crash_gen_cmd = 'cd %s && ./crash_gen.sh %s -g 0x32c,0x32d,0x3d3,0x18,0x2501,0x369,0x388,0x061a,0x2550,0x0203'%(crash_gen_path ,arguments)
|
||||
crash_gen_cmd = 'cd %s && ./crash_gen.sh %s -g 0x32c,0x32d,0x3d3,0x18,0x2501,0x369,0x388,0x061a,0x2550,0x0203,0x4012'%(crash_gen_path ,arguments)
|
||||
|
||||
return crash_gen_cmd
|
||||
|
||||
|
|
|
@ -220,11 +220,11 @@ def get_auto_mix_cmds(args_list ,valgrind=valgrind_mode):
|
|||
|
||||
if valgrind :
|
||||
|
||||
crash_gen_cmd = 'cd %s && ./crash_gen.sh --valgrind %s -g 0x32c,0x32d,0x3d3,0x18,0x2501,0x369,0x388,0x061a,0x2550,0x0203 '%(crash_gen_path ,arguments)
|
||||
crash_gen_cmd = 'cd %s && ./crash_gen.sh --valgrind %s -g 0x32c,0x32d,0x3d3,0x18,0x2501,0x369,0x388,0x061a,0x2550,0x0203,0x4012 '%(crash_gen_path ,arguments)
|
||||
|
||||
else:
|
||||
|
||||
crash_gen_cmd = 'cd %s && ./crash_gen.sh %s -g 0x32c,0x32d,0x3d3,0x18,0x2501,0x369,0x388,0x061a,0x2550,0x0203'%(crash_gen_path ,arguments)
|
||||
crash_gen_cmd = 'cd %s && ./crash_gen.sh %s -g 0x32c,0x32d,0x3d3,0x18,0x2501,0x369,0x388,0x061a,0x2550,0x0203,0x4012'%(crash_gen_path ,arguments)
|
||||
|
||||
return crash_gen_cmd
|
||||
|
||||
|
|
|
@ -220,11 +220,11 @@ def get_auto_mix_cmds(args_list ,valgrind=valgrind_mode):
|
|||
|
||||
if valgrind :
|
||||
|
||||
crash_gen_cmd = 'cd %s && ./crash_gen.sh --valgrind -i 3 %s -g 0x32c,0x32d,0x3d3,0x18,0x2501,0x369,0x388,0x061a,0x2550,0x0707,0x0203 '%(crash_gen_path ,arguments)
|
||||
crash_gen_cmd = 'cd %s && ./crash_gen.sh --valgrind -i 3 %s -g 0x32c,0x32d,0x3d3,0x18,0x2501,0x369,0x388,0x061a,0x2550,0x0707,0x0203,0x4012 '%(crash_gen_path ,arguments)
|
||||
|
||||
else:
|
||||
|
||||
crash_gen_cmd = 'cd %s && ./crash_gen.sh -i 3 %s -g 0x32c,0x32d,0x3d3,0x18,0x2501,0x369,0x388,0x061a,0x2550,0x0014,0x0707,0x0203'%(crash_gen_path ,arguments)
|
||||
crash_gen_cmd = 'cd %s && ./crash_gen.sh -i 3 %s -g 0x32c,0x32d,0x3d3,0x18,0x2501,0x369,0x388,0x061a,0x2550,0x0014,0x0707,0x0203,0x4012'%(crash_gen_path ,arguments)
|
||||
|
||||
return crash_gen_cmd
|
||||
|
||||
|
|
|
@ -52,8 +52,8 @@ class ConfigureyCluster:
|
|||
dnode.addExtraCfg("secondEp", f"{hostname}:{startPort_sec}")
|
||||
|
||||
# configure dnoe of independent mnodes
|
||||
if num <= self.mnodeNums and self.mnodeNums != 0 and independentMnode == "True" :
|
||||
tdLog.info("set mnode supportVnodes 0")
|
||||
if num <= self.mnodeNums and self.mnodeNums != 0 and independentMnode == True :
|
||||
tdLog.info(f"set mnode:{num} supportVnodes 0")
|
||||
dnode.addExtraCfg("supportVnodes", 0)
|
||||
# print(dnode)
|
||||
self.dnodes.append(dnode)
|
||||
|
|
|
@ -35,7 +35,7 @@ sql_error alter database $db keep 20.0,20.0,20.0
|
|||
sql_error alter database $db keep 0,0,0
|
||||
sql_error alter database $db keep 3
|
||||
sql_error alter database $db keep -1,-1,-1
|
||||
sql_error alter database $db keep 20,20
|
||||
sql alter database $db keep 20,20
|
||||
sql_error alter database $db keep 9,9,9
|
||||
sql_error alter database $db keep 20,20,19
|
||||
sql_error alter database $db keep 20,19,20
|
||||
|
@ -44,7 +44,7 @@ sql_error alter database $db keep 20,19,18
|
|||
sql_error alter database $db keep 20,20,20,20
|
||||
sql_error alter database $db keep 365001,365001,365001
|
||||
sql_error alter database $db keep 365001
|
||||
sql_error alter database $db keep 20
|
||||
sql alter database $db keep 20
|
||||
sql select * from information_schema.ins_databases
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sql connect
|
||||
|
||||
print ============= step1
|
||||
sql create user u_read pass 'taosdata1' host '127.0.0.1/24','192.168.1.0/24'
|
||||
sql create user u_write pass 'taosdata1' host '127.0.0.1','192.168.1.0'
|
||||
|
||||
sql alter user u_read add host '3.3.3.4/24'
|
||||
sql alter user u_write drop host '4.4.4.5/25'
|
||||
|
||||
sql show users
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print ============= step2
|
||||
sql_error create user read1 pass 'taosdata1' host '127.0.0/24'
|
||||
sql_error create user write1 pass 'taosdata1' host '4.4.4.4/33'
|
||||
|
||||
sql show users
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -0,0 +1,37 @@
|
|||
import time
|
||||
from util.log import *
|
||||
from util.sql import *
|
||||
from util.cases import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
updatecfgDict = {'ttlUnit': 1, "ttlPushInterval": 1, "ttlChangeOnWrite": 0}
|
||||
|
||||
def init(self, conn, logSql, replicaVar=1):
|
||||
self.replicaVar = int(replicaVar)
|
||||
tdLog.debug(f"start to excute {__file__}")
|
||||
tdSql.init(conn.cursor(), True)
|
||||
self.ttl = 5
|
||||
self.dbname = "test"
|
||||
|
||||
def check_ttl_result(self):
|
||||
tdSql.execute(f'create database {self.dbname}')
|
||||
tdSql.execute(f'create table {self.dbname}.t1(ts timestamp, c1 int)')
|
||||
tdSql.execute(f'create table {self.dbname}.t2(ts timestamp, c1 int) ttl {self.ttl}')
|
||||
tdSql.query(f'show {self.dbname}.tables')
|
||||
tdSql.checkRows(2)
|
||||
|
||||
time.sleep(self.ttl + 2)
|
||||
tdSql.query(f'show {self.dbname}.tables')
|
||||
tdSql.checkRows(1)
|
||||
|
||||
def run(self):
|
||||
self.check_ttl_result()
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success(f"{__file__} successfully executed")
|
||||
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
|
@ -0,0 +1,59 @@
|
|||
import time
|
||||
from util.log import *
|
||||
from util.sql import *
|
||||
from util.cases import *
|
||||
from util.dnodes import *
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
updatecfgDict = {'ttlUnit': 1, "ttlPushInterval": 3, "ttlChangeOnWrite": 1, "trimVDbIntervalSec": 360,
|
||||
"ttlFlushThreshold": 100, "ttlBatchDropNum": 10}
|
||||
|
||||
def init(self, conn, logSql, replicaVar=1):
|
||||
self.replicaVar = int(replicaVar)
|
||||
tdLog.debug(f"start to excute {__file__}")
|
||||
tdSql.init(conn.cursor(), True)
|
||||
self.ttl = 5
|
||||
self.tables = 100
|
||||
self.dbname = "test"
|
||||
|
||||
def check_batch_drop_num(self):
|
||||
tdSql.execute(f'create database {self.dbname} vgroups 1')
|
||||
tdSql.execute(f'use {self.dbname}')
|
||||
tdSql.execute(f'create table stb(ts timestamp, c1 int) tags(t1 int)')
|
||||
for i in range(self.tables):
|
||||
tdSql.execute(f'create table t{i} using stb tags({i}) ttl {self.ttl}')
|
||||
|
||||
time.sleep(self.ttl * 2)
|
||||
tdSql.query('show tables')
|
||||
tdSql.checkRows(90)
|
||||
|
||||
def check_ttl_result(self):
|
||||
tdSql.execute(f'drop database if exists {self.dbname}')
|
||||
tdSql.execute(f'create database {self.dbname}')
|
||||
tdSql.execute(f'create table {self.dbname}.t1(ts timestamp, c1 int)')
|
||||
tdSql.execute(f'create table {self.dbname}.t2(ts timestamp, c1 int) ttl {self.ttl}')
|
||||
tdSql.query(f'show {self.dbname}.tables')
|
||||
tdSql.checkRows(2)
|
||||
|
||||
time.sleep(self.ttl)
|
||||
tdSql.execute(f'insert into {self.dbname}.t2 values(now, 1)');
|
||||
|
||||
time.sleep(self.ttl)
|
||||
tdSql.query(f'show {self.dbname}.tables')
|
||||
tdSql.checkRows(2)
|
||||
|
||||
time.sleep(self.ttl * 2)
|
||||
tdSql.query(f'show {self.dbname}.tables')
|
||||
tdSql.checkRows(1)
|
||||
|
||||
def run(self):
|
||||
self.check_batch_drop_num()
|
||||
self.check_ttl_result()
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success(f"{__file__} successfully executed")
|
||||
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
|
@ -18,7 +18,7 @@ class TDTestCase:
|
|||
tdSql.init(conn.cursor(), logSql)
|
||||
self.buffer_boundary = [3, 4097, 8193, 12289, 16384]
|
||||
self.buffer_error = [self.buffer_boundary[0] -
|
||||
1, self.buffer_boundary[-1]+1, 256]
|
||||
1, self.buffer_boundary[-1]+1]
|
||||
# pages_boundary >= 64
|
||||
self.pages_boundary = [64, 128, 512]
|
||||
self.pages_error = [self.pages_boundary[0]-1]
|
||||
|
@ -47,15 +47,40 @@ class TDTestCase:
|
|||
tdSql.execute('create database db')
|
||||
tdSql.query(
|
||||
'select * from information_schema.ins_databases where name = "db"')
|
||||
self.pages_error.append(tdSql.queryResult[0][10])
|
||||
# self.pages_error.append(tdSql.queryResult[0][10])
|
||||
for pages in self.pages_error:
|
||||
tdSql.error(f'alter database db pages {pages}')
|
||||
tdSql.execute('drop database db')
|
||||
|
||||
def alter_same_options(self):
|
||||
tdSql.execute('drop database if exists db')
|
||||
tdSql.execute('create database db')
|
||||
tdSql.query('select * from information_schema.ins_databases where name = "db"')
|
||||
|
||||
db_options_items = ["replica","keep","buffer","pages","minrows","cachemodel","cachesize","wal_level","wal_fsync_period",
|
||||
"wal_retention_period","wal_retention_size","stt_trigger"]
|
||||
db_options_result_idx = [4,7,8,10,11,18,19,20,21,22,23,24]
|
||||
|
||||
self.option_result = []
|
||||
for idx in db_options_result_idx:
|
||||
self.option_result.append(tdSql.queryResult[0][idx])
|
||||
|
||||
index = 0
|
||||
for option in db_options_items:
|
||||
if option == "cachemodel":
|
||||
option_sql = "alter database db %s '%s'" % (option, self.option_result[index] )
|
||||
else:
|
||||
option_sql = "alter database db %s %s" % (option, self.option_result[index] )
|
||||
tdLog.debug(option_sql)
|
||||
tdSql.query(option_sql)
|
||||
index += 1
|
||||
tdSql.execute('drop database db')
|
||||
|
||||
def run(self):
|
||||
|
||||
self.alter_buffer()
|
||||
self.alter_pages()
|
||||
self.alter_same_options()
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
|
|
|
@ -99,7 +99,7 @@ class TDTestCase:
|
|||
tdSql.query(f"select to_unixtimestamp('1970-01-01 08:00:00+08:00', 0);")
|
||||
tdSql.checkEqual(tdSql.queryResult[0][0], 0)
|
||||
tdSql.query(f"select to_unixtimestamp('1970-01-01 00:00:00', 1);")
|
||||
tdSql.checkData(0, 0, '1970-01-01 00:00:00')
|
||||
tdSql.checkData(0, 0, datetime.datetime(1970, 1, 1, 0, 0, 0))
|
||||
tdSql.error(f"select to_unixtimestamp('1970-01-01 08:00:00+08:00', 2);")
|
||||
tdSql.error(f"select to_unixtimestamp('1970-01-01 08:00:00+08:00', 1.5);")
|
||||
tdSql.error(f"select to_unixtimestamp('1970-01-01 08:00:00+08:00', 'abc');")
|
||||
|
|
|
@ -88,15 +88,15 @@ class TDTestCase:
|
|||
# restart all taosd
|
||||
tdDnodes=cluster.dnodes
|
||||
|
||||
tdDnodes[1].stoptaosd()
|
||||
# tdDnodes[1].stoptaosd()
|
||||
tdDnodes[2].stoptaosd()
|
||||
|
||||
tdLog.info("check whether 2 mnode status is offline")
|
||||
clusterComCheck.check3mnode2off()
|
||||
tdLog.info("check whether 1 mnode status is offline")
|
||||
clusterComCheck.check3mnodeoff(3)
|
||||
# tdSql.error("create user user1 pass '123';")
|
||||
|
||||
tdLog.info("start two follower")
|
||||
tdDnodes[1].starttaosd()
|
||||
tdLog.info("start follower")
|
||||
# tdDnodes[1].starttaosd()
|
||||
tdDnodes[2].starttaosd()
|
||||
|
||||
clusterComCheck.checkMnodeStatus(mnodeNums)
|
||||
|
|
|
@ -245,9 +245,12 @@ class ClusterComCheck:
|
|||
tdLog.exit(f"vgroup number of {db_name} is not correct")
|
||||
if self.db_replica == 1 :
|
||||
if tdSql.queryResult[0][4] == 'leader' and tdSql.queryResult[1][4] == 'leader' and tdSql.queryResult[last_number][4] == 'leader':
|
||||
ready_time= (count + 1)
|
||||
tdLog.success(f"all vgroups of {db_name} are leaders in {count + 1} s")
|
||||
return True
|
||||
tdSql.query(f"select `replica` from information_schema.ins_databases where `name`='{db_name}';")
|
||||
print("db replica :",tdSql.queryResult[0][0])
|
||||
if tdSql.queryResult[0][0] == db_replica:
|
||||
ready_time= (count + 1)
|
||||
tdLog.success(f"all vgroups with replica {self.db_replica} of {db_name} are leaders in {count + 1} s")
|
||||
return True
|
||||
count+=1
|
||||
elif self.db_replica == 3 :
|
||||
vgroup_status_first=[tdSql.queryResult[0][4],tdSql.queryResult[0][6],tdSql.queryResult[0][8]]
|
||||
|
@ -255,13 +258,16 @@ class ClusterComCheck:
|
|||
vgroup_status_last=[tdSql.queryResult[last_number][4],tdSql.queryResult[last_number][6],tdSql.queryResult[last_number][8]]
|
||||
if vgroup_status_first.count('leader') == 1 and vgroup_status_first.count('follower') == 2:
|
||||
if vgroup_status_last.count('leader') == 1 and vgroup_status_last.count('follower') == 2:
|
||||
ready_time= (count + 1)
|
||||
tdLog.success(f"elections of {db_name}.vgroups are ready in {ready_time} s")
|
||||
return True
|
||||
tdSql.query(f"select `replica` from information_schema.ins_databases where `name`='{db_name}';")
|
||||
print("db replica :",tdSql.queryResult[0][0])
|
||||
if tdSql.queryResult[0][0] == db_replica:
|
||||
ready_time= (count + 1)
|
||||
tdLog.success(f"elections of {db_name}.vgroups with replica {self.db_replica} are ready in {ready_time} s")
|
||||
return True
|
||||
count+=1
|
||||
else:
|
||||
tdLog.debug(tdSql.queryResult)
|
||||
tdLog.notice(f"elections of {db_name} all vgroups are failed in {count} s ")
|
||||
tdLog.notice(f"elections of {db_name} all vgroups with replica {self.db_replica} are failed in {count} s ")
|
||||
caller = inspect.getframeinfo(inspect.stack()[1][0])
|
||||
args = (caller.filename, caller.lineno)
|
||||
tdLog.exit("%s(%d) failed " % args)
|
||||
|
|
|
@ -177,7 +177,7 @@ class TDTestCase:
|
|||
tdSql.query("select count(*) from %s"%stableName)
|
||||
tdSql.checkData(0,0,rowsPerStb)
|
||||
|
||||
clusterComCheck.check_vgroups_status(vgroup_numbers=paraDict["vgroups"],db_replica=replica1,db_name=paraDict["dbName"],count_number=40)
|
||||
clusterComCheck.check_vgroups_status(vgroup_numbers=paraDict["vgroups"],db_replica=replica1,db_name=paraDict["dbName"],count_number=100)
|
||||
sleep(5)
|
||||
tdLog.info(f"show transactions;alter database db0_0 replica {replica3};")
|
||||
TdSqlEx.execute(f'show transactions;')
|
||||
|
|
|
@ -94,7 +94,7 @@ class TDTestCase:
|
|||
resultList=[]
|
||||
while 1:
|
||||
tdSql.query("select * from %s.consumeresult"%cdbName)
|
||||
#tdLog.info("row: %d, %l64d, %l64d"%(tdSql.getData(0, 1),tdSql.getData(0, 2),tdSql.getData(0, 3))
|
||||
# tdLog.info("row: %d, %l64d, %l64d"%(tdSql.getData(0, 1),tdSql.getData(0, 2),tdSql.getData(0, 3)))
|
||||
if tdSql.getRows() == expectRows:
|
||||
break
|
||||
else:
|
||||
|
@ -336,7 +336,7 @@ class TDTestCase:
|
|||
for i in range(expectRows):
|
||||
totalConsumeRows += resultList[i]
|
||||
|
||||
if totalConsumeRows > expectrowcnt or totalConsumeRows <= 0:
|
||||
if totalConsumeRows > expectrowcnt or totalConsumeRows < 0:
|
||||
tdLog.info("act consume rows: %d, expect consume rows between %d and 0"%(totalConsumeRows, expectrowcnt))
|
||||
tdLog.exit("tmq consume rows error!")
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ class TDTestCase:
|
|||
|
||||
actConsumeTotalRows = resultList[0]
|
||||
|
||||
if not (actConsumeTotalRows > 0 and actConsumeTotalRows < totalRowsInserted):
|
||||
if not (actConsumeTotalRows >= 0 and actConsumeTotalRows <= totalRowsInserted):
|
||||
tdLog.info("act consume rows: %d"%(actConsumeTotalRows))
|
||||
tdLog.info("and second consume rows should be between 0 and %d"%(totalRowsInserted))
|
||||
tdLog.exit("%d tmq consume rows error!"%consumerId)
|
||||
|
|
|
@ -216,7 +216,7 @@ class TDTestCase:
|
|||
|
||||
actConsumeTotalRows = resultList[0]
|
||||
tdLog.info("act consume rows: %d, expect rows range (0, %d)"%(actConsumeTotalRows, totalRowsInserted))
|
||||
if not (actConsumeTotalRows > 0 and actConsumeTotalRows < totalRowsInserted):
|
||||
if not (actConsumeTotalRows >= 0 and actConsumeTotalRows <= totalRowsInserted):
|
||||
tdLog.info("act consume rows: %d"%(actConsumeTotalRows))
|
||||
tdLog.info("and second consume rows should be between 0 and %d"%(totalRowsInserted))
|
||||
tdLog.exit("%d tmq consume rows error!"%consumerId)
|
||||
|
|
|
@ -218,7 +218,7 @@ class TDTestCase:
|
|||
|
||||
tdLog.info("act consume rows: %d"%(actConsumeTotalRows))
|
||||
tdLog.info("and second consume rows should be between 0 and %d"%(totalRowsInserted))
|
||||
if not (actConsumeTotalRows > 0 and actConsumeTotalRows <= totalRowsInserted):
|
||||
if not (actConsumeTotalRows >= 0 and actConsumeTotalRows <= totalRowsInserted):
|
||||
tdLog.exit("%d tmq consume rows error!"%consumerId)
|
||||
|
||||
time.sleep(10)
|
||||
|
|
|
@ -216,7 +216,7 @@ class TDTestCase:
|
|||
|
||||
actConsumeTotalRows = resultList[0]
|
||||
|
||||
if not (actConsumeTotalRows > 0 and actConsumeTotalRows <= totalRowsInserted):
|
||||
if not (actConsumeTotalRows >= 0 and actConsumeTotalRows <= totalRowsInserted):
|
||||
tdLog.info("act consume rows: %d"%(actConsumeTotalRows))
|
||||
tdLog.info("and second consume rows should be between 0 and %d"%(totalRowsInserted))
|
||||
tdLog.exit("%d tmq consume rows error!"%consumerId)
|
||||
|
|
|
@ -217,7 +217,7 @@ class TDTestCase:
|
|||
|
||||
tdLog.info("act consume rows: %d"%(actConsumeTotalRows))
|
||||
tdLog.info("and second consume rows should be between 0 and %d"%(totalRowsInserted))
|
||||
if not ((actConsumeTotalRows > 0) and (actConsumeTotalRows <= totalRowsInserted)):
|
||||
if not ((actConsumeTotalRows >= 0) and (actConsumeTotalRows <= totalRowsInserted)):
|
||||
tdLog.exit("%d tmq consume rows error!"%consumerId)
|
||||
|
||||
time.sleep(10)
|
||||
|
|
|
@ -205,12 +205,21 @@ class TDTestCase:
|
|||
time.sleep(self.walRetentionPeriod + 1)
|
||||
tdLog.info("secondely call to flash database")
|
||||
tdSql.query("flush database %s"%(paraDict['dbName']))
|
||||
|
||||
|
||||
# wait the consumer to complete one poll
|
||||
while (0 == self.retryPoll):
|
||||
time.sleep(1)
|
||||
continue
|
||||
|
||||
|
||||
# write data again when consumer stopped to make sure some data aren't consumed
|
||||
pInsertDataAgainThread = tmqCom.asyncInsertDataByInterlace(paraDict)
|
||||
pInsertDataAgainThread.join()
|
||||
tdLog.info("firstly call to flash database when writing data second time")
|
||||
tdSql.query("flush database %s"%(paraDict['dbName']))
|
||||
time.sleep(self.walRetentionPeriod + 1)
|
||||
tdLog.info("secondely call to flash database when writing data second time")
|
||||
tdSql.query("flush database %s"%(paraDict['dbName']))
|
||||
|
||||
with self.lock:
|
||||
self.retryPoll = 0
|
||||
currentTime = datetime.now()
|
||||
|
@ -218,15 +227,14 @@ class TDTestCase:
|
|||
|
||||
paraDict["startTs"] = 1640966400000 + paraDict["ctbNum"] * paraDict["rowsPerTbl"]
|
||||
pThread3 = tmqCom.asyncInsertDataByInterlace(paraDict)
|
||||
|
||||
|
||||
|
||||
tdLog.debug("wait sub-thread to end insert data")
|
||||
pThread3.join()
|
||||
|
||||
totalInsertRows = paraDict["ctbNum"] * paraDict["rowsPerTbl"] * 2
|
||||
|
||||
totalInsertRows = paraDict["ctbNum"] * paraDict["rowsPerTbl"] * 3
|
||||
tdLog.debug("wait sub-thread to end consume data")
|
||||
pThread2.join()
|
||||
|
||||
|
||||
tdLog.info("act consume total rows: %d, act insert total rows: %d"%(self.actConsumeTotalRows, totalInsertRows))
|
||||
|
||||
if (self.actConsumeTotalRows >= totalInsertRows):
|
||||
|
|
|
@ -21,6 +21,7 @@ class TDTestCase:
|
|||
self.db_name = "tmq_db"
|
||||
self.topic_name = "tmq_topic"
|
||||
self.stable_name = "tmqst"
|
||||
self.prepareData()
|
||||
|
||||
|
||||
def prepareData(self):
|
||||
|
@ -73,8 +74,9 @@ class TDTestCase:
|
|||
return consumer
|
||||
|
||||
def test_seek_and_committed_position_with_autocommit(self):
|
||||
"""Check the position and committed offset of the topic for autocommit scenario
|
||||
"""
|
||||
try:
|
||||
self.prepareData()
|
||||
inputDict = {
|
||||
"topic_name": self.topic_name,
|
||||
"group_id": "1",
|
||||
|
@ -95,18 +97,26 @@ class TDTestCase:
|
|||
|
||||
partitions = consumer.assignment()
|
||||
position_partitions = consumer.position(partitions)
|
||||
tdLog.info("position_partitions: %s"%(position_partitions))
|
||||
for i in range(len(position_partitions)):
|
||||
tdLog.info("position_partitions[%s].offset: %s"%(i, position_partitions[i].offset))
|
||||
committed_partitions = consumer.committed(partitions)
|
||||
tdLog.info("committed_partitions: %s"%(committed_partitions))
|
||||
origin_committed_position = []
|
||||
for i in range(len(committed_partitions)):
|
||||
tdLog.info("committed_partitions[%s].offset: %s"%(i, committed_partitions[i].offset))
|
||||
origin_committed_position.append(committed_partitions[i].offset)
|
||||
assert(len(position_partitions) == len(committed_partitions))
|
||||
for i in range(len(position_partitions)):
|
||||
assert(position_partitions[i].offset == committed_partitions[i].offset)
|
||||
# seek to the beginning of the topic
|
||||
|
||||
# seek to the specified offset of the topic, then check position and committed offset
|
||||
for partition in partitions:
|
||||
partition.offset = 5
|
||||
consumer.seek(partition)
|
||||
position_partitions = consumer.position(partitions)
|
||||
for i in range(len(position_partitions)):
|
||||
assert(position_partitions[i].offset == 5)
|
||||
committed_partitions = consumer.committed(partitions)
|
||||
for i in range(len(committed_partitions)):
|
||||
assert(committed_partitions[i].offset != 5 and committed_partitions[i].offset == origin_committed_position[i])
|
||||
except Exception as ex:
|
||||
raise Exception("Failed to test seek and committed position with autocommit with error: {}".format(str(ex)))
|
||||
finally:
|
||||
|
@ -114,12 +124,81 @@ class TDTestCase:
|
|||
consumer.close()
|
||||
|
||||
def test_commit_by_offset(self):
|
||||
pass
|
||||
|
||||
"""Check the position and committed offset of the topic for commit by offset scenario
|
||||
"""
|
||||
try:
|
||||
inputDict = {
|
||||
"topic_name": self.topic_name,
|
||||
"group_id": "1",
|
||||
"auto_commit": "false",
|
||||
"offset_reset": "earliest"
|
||||
}
|
||||
consumer = self.tmqSubscribe(inputDict)
|
||||
origin_committed_position = []
|
||||
while(True):
|
||||
res = consumer.poll(1)
|
||||
if not res:
|
||||
break
|
||||
err = res.error()
|
||||
if err is not None:
|
||||
raise err
|
||||
partitions = consumer.assignment()
|
||||
consumer.commit(offsets=partitions)
|
||||
val = res.value()
|
||||
for block in val:
|
||||
tdLog.info("block.fetchall() number: %s"%(len(block.fetchall())))
|
||||
position_partitions = consumer.position(partitions)
|
||||
committed_partitions = consumer.committed(partitions)
|
||||
for i in range(len(position_partitions)):
|
||||
assert(position_partitions[i].offset == committed_partitions[i].offset)
|
||||
committed_partitions = consumer.committed(partitions)
|
||||
for i in range(len(committed_partitions)):
|
||||
origin_committed_position.append(committed_partitions[i].offset)
|
||||
tdLog.info("original committed_partitions[%s].offset: %s"%(i, committed_partitions[i].offset))
|
||||
# seek to the specified offset of the topic, then check position and committed offset
|
||||
for partition in partitions:
|
||||
partition.offset = 2
|
||||
consumer.seek(partition)
|
||||
position_partitions = consumer.position(partitions)
|
||||
for i in range(len(position_partitions)):
|
||||
assert(position_partitions[i].offset == 2)
|
||||
committed_partitions = consumer.committed(partitions)
|
||||
for i in range(len(committed_partitions)):
|
||||
tdLog.info("after seek committed_partitions[%s].offset: %s"%(i, committed_partitions[i].offset))
|
||||
assert(committed_partitions[i].offset != 2 and committed_partitions[i].offset == origin_committed_position[i])
|
||||
# continue to consume data from seek offset
|
||||
while(True):
|
||||
res = consumer.poll(1)
|
||||
if not res:
|
||||
break
|
||||
err = res.error()
|
||||
if err is not None:
|
||||
raise err
|
||||
partitions = consumer.assignment()
|
||||
# commit by offset
|
||||
consumer.commit(offsets=partitions)
|
||||
val = res.value()
|
||||
for block in val:
|
||||
tdLog.info("block.fetchall() number: %s"%(len(block.fetchall())))
|
||||
partitions = consumer.assignment()
|
||||
position_partitions = consumer.position(partitions)
|
||||
committed_partitions = consumer.committed(partitions)
|
||||
assert(len(position_partitions) == len(committed_partitions))
|
||||
for i in range(len(position_partitions)):
|
||||
assert(position_partitions[i].offset == committed_partitions[i].offset)
|
||||
except Exception as ex:
|
||||
raise Exception("Failed to test commit by offset with error: {}".format(str(ex)))
|
||||
finally:
|
||||
consumer.unsubscribe()
|
||||
consumer.close()
|
||||
|
||||
def run(self):
|
||||
self.test_seek_and_committed_position_with_autocommit()
|
||||
self.test_commit_by_offset()
|
||||
|
||||
def stop(self):
|
||||
tdSql.execute("drop topic %s" % self.topic_name)
|
||||
tdSql.execute("drop database %s"%(self.db_name))
|
||||
tdSql.close()
|
||||
tdLog.success(f"{__file__} successfully executed")
|
||||
|
||||
|
|
|
@ -11,9 +11,12 @@ class TDTestCase:
|
|||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor(), logSql)
|
||||
self.tdCom = tdCom
|
||||
self.date_time = 1694054350870
|
||||
self.interval = 15
|
||||
|
||||
def pause_resume_test(self, interval, partition="tbname", delete=False, fill_history_value=None, pause=True, resume=True, ignore_untreated=False):
|
||||
tdLog.info(f"*** testing stream pause+resume: interval: {interval}, partition: {partition}, delete: {delete}, fill_history: {fill_history_value}, ignore_untreated: {ignore_untreated} ***")
|
||||
date_time = self.date_time
|
||||
if_exist_value_list = [None, True]
|
||||
if_exist = random.choice(if_exist_value_list)
|
||||
reverse_check = True if ignore_untreated else False
|
||||
|
@ -54,20 +57,20 @@ class TDTestCase:
|
|||
self.tdCom.create_stream(stream_name=f'{self.ctb_name}{self.tdCom.stream_suffix}', des_table=self.tdCom.ctb_stream_des_table, source_sql=f'select _wstart AS wstart, {self.tdCom.stb_source_select_str} from {self.ctb_name} {partition_elm} interval({self.tdCom.dataDict["interval"]}s)', trigger_mode="at_once", subtable_value=ctb_subtable_value, fill_history_value=fill_history_value)
|
||||
self.tdCom.create_stream(stream_name=f'{self.tb_name}{self.tdCom.stream_suffix}', des_table=self.tdCom.tb_stream_des_table, source_sql=f'select _wstart AS wstart, {self.tdCom.tb_source_select_str} from {self.tb_name} {partition_elm} interval({self.tdCom.dataDict["interval"]}s)', trigger_mode="at_once", subtable_value=tb_subtable_value, fill_history_value=fill_history_value)
|
||||
for i in range(range_count):
|
||||
ts_value = str(self.tdCom.date_time+self.tdCom.dataDict["interval"])+f'+{i*10}s'
|
||||
ts_value = str(date_time+self.tdCom.dataDict["interval"])+f'+{i*10}s'
|
||||
ts_cast_delete_value = self.tdCom.time_cast(ts_value)
|
||||
self.tdCom.sinsert_rows(tbname=self.ctb_name, ts_value=ts_value)
|
||||
if self.tdCom.update and i%2 == 0:
|
||||
self.tdCom.sinsert_rows(tbname=self.ctb_name, ts_value=ts_value)
|
||||
if self.delete and i%2 != 0:
|
||||
self.tdCom.sdelete_rows(tbname=self.ctb_name, start_ts=ts_cast_delete_value)
|
||||
self.tdCom.date_time += 1
|
||||
date_time += 1
|
||||
self.tdCom.sinsert_rows(tbname=self.tb_name, ts_value=ts_value)
|
||||
if self.tdCom.update and i%2 == 0:
|
||||
self.tdCom.sinsert_rows(tbname=self.tb_name, ts_value=ts_value)
|
||||
if self.delete and i%2 != 0:
|
||||
self.tdCom.sdelete_rows(tbname=self.tb_name, start_ts=ts_cast_delete_value)
|
||||
self.tdCom.date_time += 1
|
||||
date_time += 1
|
||||
if partition:
|
||||
partition_elm = f'partition by {partition}'
|
||||
else:
|
||||
|
@ -140,8 +143,8 @@ class TDTestCase:
|
|||
for delete in [True, False]:
|
||||
for fill_history_value in [0, 1]:
|
||||
# pause/resume
|
||||
self.pause_resume_test(interval=random.randint(10, 15), partition="tbname", ignore_untreated=False, fill_history_value=fill_history_value, delete=delete)
|
||||
self.pause_resume_test(interval=random.randint(10, 15), partition="tbname", ignore_untreated=True, fill_history_value=fill_history_value, delete=delete)
|
||||
self.pause_resume_test(interval=self.interval, partition="tbname", ignore_untreated=False, fill_history_value=fill_history_value, delete=delete)
|
||||
self.pause_resume_test(interval=self.interval, partition="tbname", ignore_untreated=True, fill_history_value=fill_history_value, delete=delete)
|
||||
# self.pause_resume_test(interval=random.randint(10, 15), partition="tbname", resume=False, fill_history_value=fill_history_value, delete=delete)
|
||||
|
||||
def stop(self):
|
||||
|
@ -151,4 +154,4 @@ class TDTestCase:
|
|||
event = threading.Event()
|
||||
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
||||
|
|
|
@ -696,7 +696,7 @@ static int32_t g_once_commit_flag = 0;
|
|||
static void tmq_commit_cb_print(tmq_t* tmq, int32_t code, void* param) {
|
||||
taosFprintfFile(g_fp, "tmq_commit_cb_print() commit %d\n", code);
|
||||
|
||||
if (0 == g_once_commit_flag) {
|
||||
if (0 == g_once_commit_flag && code == 0) {
|
||||
g_once_commit_flag = 1;
|
||||
notifyMainScript((SThreadInfo*)param, (int32_t)NOTIFY_CMD_START_COMMIT);
|
||||
}
|
||||
|
|
|
@ -85,6 +85,7 @@ void varbinary_sql_test() {
|
|||
|
||||
// test insert
|
||||
pRes = taos_query(taos, "insert into tb2 using stb tags (2, 'tb2_bin1', 093) values (now + 2s, 'nchar1', 892, 0.3)");
|
||||
printf("error:%s", taos_errstr(pRes));
|
||||
ASSERT(taos_errno(pRes) != 0);
|
||||
|
||||
pRes = taos_query(taos, "insert into tb3 using stb tags (3, 'tb3_bin1', 0x7f829) values (now + 3s, 'nchar1', 0x7f829, 0.3)");
|
||||
|
|
Loading…
Reference in New Issue