Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
dce19313
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
dce19313
编写于
5月 21, 2022
作者:
haoranc
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of github.com:taosdata/TDengine into test/chr/TD-14699
上级
9947cb56
b391ef9a
变更
64
隐藏空白更改
内联
并排
Showing
64 changed file
with
416 addition
and
397 deletion
+416
-397
example/src/tmq.c
example/src/tmq.c
+1
-0
include/common/tglobal.h
include/common/tglobal.h
+1
-0
include/common/tmsg.h
include/common/tmsg.h
+12
-10
include/dnode/qnode/qnode.h
include/dnode/qnode/qnode.h
+0
-1
include/libs/qcom/query.h
include/libs/qcom/query.h
+2
-0
include/util/taoserror.h
include/util/taoserror.h
+2
-3
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+2
-2
source/client/src/clientHb.c
source/client/src/clientHb.c
+23
-22
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+30
-4
source/client/src/clientMain.c
source/client/src/clientMain.c
+2
-2
source/client/src/clientSml.c
source/client/src/clientSml.c
+12
-18
source/client/src/clientStmt.c
source/client/src/clientStmt.c
+14
-5
source/client/src/tmq.c
source/client/src/tmq.c
+25
-10
source/client/test/smlTest.cpp
source/client/test/smlTest.cpp
+3
-11
source/common/src/tdataformat.c
source/common/src/tdataformat.c
+5
-3
source/common/src/tglobal.c
source/common/src/tglobal.c
+3
-0
source/common/src/tname.c
source/common/src/tname.c
+2
-5
source/dnode/mgmt/mgmt_bnode/src/bmWorker.c
source/dnode/mgmt/mgmt_bnode/src/bmWorker.c
+3
-5
source/dnode/mgmt/mgmt_dnode/src/dmWorker.c
source/dnode/mgmt/mgmt_dnode/src/dmWorker.c
+3
-7
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
+2
-24
source/dnode/mgmt/mgmt_qnode/src/qmWorker.c
source/dnode/mgmt/mgmt_qnode/src/qmWorker.c
+17
-50
source/dnode/mgmt/mgmt_snode/src/smWorker.c
source/dnode/mgmt/mgmt_snode/src/smWorker.c
+3
-5
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
+11
-12
source/dnode/mgmt/node_mgmt/inc/dmMgmt.h
source/dnode/mgmt/node_mgmt/inc/dmMgmt.h
+0
-1
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
+0
-5
source/dnode/mgmt/node_mgmt/src/dmTransport.c
source/dnode/mgmt/node_mgmt/src/dmTransport.c
+2
-1
source/dnode/mnode/impl/src/mndBnode.c
source/dnode/mnode/impl/src/mndBnode.c
+4
-4
source/dnode/mnode/impl/src/mndConsumer.c
source/dnode/mnode/impl/src/mndConsumer.c
+1
-1
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+6
-7
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+4
-4
source/dnode/mnode/impl/src/mndFunc.c
source/dnode/mnode/impl/src/mndFunc.c
+4
-4
source/dnode/mnode/impl/src/mndMnode.c
source/dnode/mnode/impl/src/mndMnode.c
+4
-4
source/dnode/mnode/impl/src/mndOffset.c
source/dnode/mnode/impl/src/mndOffset.c
+1
-1
source/dnode/mnode/impl/src/mndProfile.c
source/dnode/mnode/impl/src/mndProfile.c
+5
-13
source/dnode/mnode/impl/src/mndQnode.c
source/dnode/mnode/impl/src/mndQnode.c
+4
-4
source/dnode/mnode/impl/src/mndQuery.c
source/dnode/mnode/impl/src/mndQuery.c
+23
-25
source/dnode/mnode/impl/src/mndSma.c
source/dnode/mnode/impl/src/mndSma.c
+4
-4
source/dnode/mnode/impl/src/mndSnode.c
source/dnode/mnode/impl/src/mndSnode.c
+4
-4
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+9
-6
source/dnode/mnode/impl/src/mndStream.c
source/dnode/mnode/impl/src/mndStream.c
+2
-2
source/dnode/mnode/impl/src/mndTopic.c
source/dnode/mnode/impl/src/mndTopic.c
+3
-3
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+5
-5
source/dnode/mnode/impl/src/mndUser.c
source/dnode/mnode/impl/src/mndUser.c
+6
-6
source/dnode/mnode/impl/src/mnode.c
source/dnode/mnode/impl/src/mnode.c
+1
-1
source/dnode/qnode/src/qnode.c
source/dnode/qnode/src/qnode.c
+30
-25
source/dnode/vnode/src/meta/metaEntry.c
source/dnode/vnode/src/meta/metaEntry.c
+3
-3
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+10
-7
source/dnode/vnode/src/sma/smaOpen.c
source/dnode/vnode/src/sma/smaOpen.c
+1
-0
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+10
-7
source/dnode/vnode/src/tsdb/tsdbCommit.c
source/dnode/vnode/src/tsdb/tsdbCommit.c
+1
-0
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+0
-3
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+7
-1
source/libs/parser/src/parInsert.c
source/libs/parser/src/parInsert.c
+7
-3
source/libs/parser/src/parTokenizer.c
source/libs/parser/src/parTokenizer.c
+1
-0
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+5
-1
source/libs/stream/src/tstreamUpdate.c
source/libs/stream/src/tstreamUpdate.c
+21
-23
source/util/src/terror.c
source/util/src/terror.c
+0
-1
tests/script/api/batchprepare.c
tests/script/api/batchprepare.c
+12
-8
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+1
-0
tests/script/tsim/stable/metrics.sim
tests/script/tsim/stable/metrics.sim
+11
-9
tests/script/tsim/valgrind/basic.sim
tests/script/tsim/valgrind/basic.sim
+8
-0
tests/system-test/0-others/udfTest.py
tests/system-test/0-others/udfTest.py
+1
-1
tests/tsim/src/simSystem.c
tests/tsim/src/simSystem.c
+2
-0
tools/shell/src/shellEngine.c
tools/shell/src/shellEngine.c
+15
-1
未找到文件。
example/src/tmq.c
浏览文件 @
dce19313
...
...
@@ -171,6 +171,7 @@ tmq_t* build_consumer() {
tmq_conf_set_auto_commit_cb
(
conf
,
tmq_commit_cb_print
,
NULL
);
tmq_t
*
tmq
=
tmq_consumer_new
(
conf
,
NULL
,
0
);
assert
(
tmq
);
tmq_conf_destroy
(
conf
);
return
tmq
;
}
...
...
include/common/tglobal.h
浏览文件 @
dce19313
...
...
@@ -128,6 +128,7 @@ extern bool tsStartUdfd;
// schemaless
extern
char
tsSmlChildTableName
[];
extern
char
tsSmlTagName
[];
extern
bool
tsSmlDataFormat
;
// internal
...
...
include/common/tmsg.h
浏览文件 @
dce19313
...
...
@@ -1987,19 +1987,16 @@ static FORCE_INLINE void tFreeClientHbReq(void* pReq) {
if
(
req
->
info
)
{
tFreeReqKvHash
(
req
->
info
);
taosHashCleanup
(
req
->
info
);
req
->
info
=
NULL
;
}
}
int32_t
tSerializeSClientHbBatchReq
(
void
*
buf
,
int32_t
bufLen
,
const
SClientHbBatchReq
*
pReq
);
int32_t
tDeserializeSClientHbBatchReq
(
void
*
buf
,
int32_t
bufLen
,
SClientHbBatchReq
*
pReq
);
static
FORCE_INLINE
void
tFreeClientHbBatchReq
(
void
*
pReq
,
bool
deep
)
{
static
FORCE_INLINE
void
tFreeClientHbBatchReq
(
void
*
pReq
)
{
SClientHbBatchReq
*
req
=
(
SClientHbBatchReq
*
)
pReq
;
if
(
deep
)
{
taosArrayDestroyEx
(
req
->
reqs
,
tFreeClientHbReq
);
}
else
{
taosArrayDestroy
(
req
->
reqs
);
}
taosArrayDestroyEx
(
req
->
reqs
,
tFreeClientHbReq
);
taosMemoryFree
(
pReq
);
}
...
...
@@ -2023,6 +2020,7 @@ static FORCE_INLINE void tFreeClientHbBatchRsp(void* pRsp) {
int32_t
tSerializeSClientHbBatchRsp
(
void
*
buf
,
int32_t
bufLen
,
const
SClientHbBatchRsp
*
pBatchRsp
);
int32_t
tDeserializeSClientHbBatchRsp
(
void
*
buf
,
int32_t
bufLen
,
SClientHbBatchRsp
*
pBatchRsp
);
void
tFreeSClientHbBatchRsp
(
SClientHbBatchRsp
*
pBatchRsp
);
static
FORCE_INLINE
int32_t
tEncodeSKv
(
SEncoder
*
pEncoder
,
const
SKv
*
pKv
)
{
if
(
tEncodeI32
(
pEncoder
,
pKv
->
key
)
<
0
)
return
-
1
;
...
...
@@ -2523,11 +2521,9 @@ static FORCE_INLINE void* tDecodeSMqDataBlkRsp(const void* buf, SMqDataBlkRsp* p
buf
=
taosDecodeFixedI64
(
buf
,
&
pRsp
->
rspOffset
);
buf
=
taosDecodeFixedI32
(
buf
,
&
pRsp
->
skipLogNum
);
buf
=
taosDecodeFixedI32
(
buf
,
&
pRsp
->
blockNum
);
pRsp
->
blockData
=
taosArrayInit
(
pRsp
->
blockNum
,
sizeof
(
void
*
));
pRsp
->
blockDataLen
=
taosArrayInit
(
pRsp
->
blockNum
,
sizeof
(
int32_t
));
pRsp
->
blockTbName
=
taosArrayInit
(
pRsp
->
blockNum
,
sizeof
(
void
*
));
pRsp
->
blockSchema
=
taosArrayInit
(
pRsp
->
blockNum
,
sizeof
(
void
*
));
if
(
pRsp
->
blockNum
!=
0
)
{
pRsp
->
blockData
=
taosArrayInit
(
pRsp
->
blockNum
,
sizeof
(
void
*
));
pRsp
->
blockDataLen
=
taosArrayInit
(
pRsp
->
blockNum
,
sizeof
(
int32_t
));
buf
=
taosDecodeFixedI8
(
buf
,
&
pRsp
->
withTbName
);
buf
=
taosDecodeFixedI8
(
buf
,
&
pRsp
->
withSchema
);
buf
=
taosDecodeFixedI8
(
buf
,
&
pRsp
->
withTag
);
...
...
@@ -2540,14 +2536,20 @@ static FORCE_INLINE void* tDecodeSMqDataBlkRsp(const void* buf, SMqDataBlkRsp* p
taosArrayPush
(
pRsp
->
blockDataLen
,
&
bLen
);
taosArrayPush
(
pRsp
->
blockData
,
&
data
);
if
(
pRsp
->
withSchema
)
{
pRsp
->
blockSchema
=
taosArrayInit
(
pRsp
->
blockNum
,
sizeof
(
void
*
));
SSchemaWrapper
*
pSW
=
(
SSchemaWrapper
*
)
taosMemoryMalloc
(
sizeof
(
SSchemaWrapper
));
buf
=
taosDecodeSSchemaWrapper
(
buf
,
pSW
);
taosArrayPush
(
pRsp
->
blockSchema
,
&
pSW
);
}
else
{
pRsp
->
blockSchema
=
NULL
;
}
if
(
pRsp
->
withTbName
)
{
pRsp
->
blockTbName
=
taosArrayInit
(
pRsp
->
blockNum
,
sizeof
(
void
*
));
char
*
name
=
NULL
;
buf
=
taosDecodeString
(
buf
,
&
name
);
taosArrayPush
(
pRsp
->
blockTbName
,
&
name
);
}
else
{
pRsp
->
blockTbName
=
NULL
;
}
}
}
...
...
include/dnode/qnode/qnode.h
浏览文件 @
dce19313
...
...
@@ -72,7 +72,6 @@ int32_t qndGetLoad(SQnode *pQnode, SQnodeLoad *pLoad);
* @param pMsg The request message
*/
int32_t
qndProcessQueryMsg
(
SQnode
*
pQnode
,
SRpcMsg
*
pMsg
);
int32_t
qndProcessFetchMsg
(
SQnode
*
pQnode
,
SRpcMsg
*
pMsg
);
#ifdef __cplusplus
}
...
...
include/libs/qcom/query.h
浏览文件 @
dce19313
...
...
@@ -198,6 +198,8 @@ extern int32_t (*queryProcessMsgRsp[TDMT_MAX])(void* output, char* msg, int32_t
#define NEED_CLIENT_HANDLE_ERROR(_code) \
(NEED_CLIENT_RM_TBLMETA_ERROR(_code) || NEED_CLIENT_REFRESH_VG_ERROR(_code) || \
NEED_CLIENT_REFRESH_TBLMETA_ERROR(_code))
#define NEED_CLIENT_RM_TBLMETA_REQ(_type) ((_type) == TDMT_VND_CREATE_TABLE || (_type) == TDMT_VND_CREATE_STB \
|| (_type) == TDMT_VND_DROP_TABLE || (_type) == TDMT_VND_DROP_STB)
#define NEED_SCHEDULER_RETRY_ERROR(_code) \
((_code) == TSDB_CODE_RPC_REDIRECT || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL)
...
...
include/util/taoserror.h
浏览文件 @
dce19313
...
...
@@ -129,9 +129,8 @@ int32_t* taosGetErrno();
// mnode-common
#define TSDB_CODE_MND_APP_ERROR TAOS_DEF_ERROR_CODE(0, 0x0300)
#define TSDB_CODE_MND_NOT_READY TAOS_DEF_ERROR_CODE(0, 0x0301)
#define TSDB_CODE_MND_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x0302)
#define TSDB_CODE_MND_NO_RIGHTS TAOS_DEF_ERROR_CODE(0, 0x0303)
#define TSDB_CODE_MND_INVALID_CONNECTION TAOS_DEF_ERROR_CODE(0, 0x0304)
#define TSDB_CODE_MND_NO_RIGHTS TAOS_DEF_ERROR_CODE(0, 0x0302)
#define TSDB_CODE_MND_INVALID_CONNECTION TAOS_DEF_ERROR_CODE(0, 0x0303)
// mnode-show
#define TSDB_CODE_MND_INVALID_SHOWOBJ TAOS_DEF_ERROR_CODE(0, 0x0310)
...
...
source/client/src/clientEnv.c
浏览文件 @
dce19313
...
...
@@ -60,7 +60,7 @@ static void registerRequest(SRequestObj *pRequest) {
static
void
deregisterRequest
(
SRequestObj
*
pRequest
)
{
assert
(
pRequest
!=
NULL
);
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
SInstanceSummary
*
pActivity
=
&
pTscObj
->
pAppInfo
->
summary
;
int32_t
currentInst
=
atomic_sub_fetch_64
((
int64_t
*
)
&
pActivity
->
currentRequests
,
1
);
...
...
@@ -313,7 +313,7 @@ int taos_options_imp(TSDB_OPTION option, const char *str) {
return
0
;
}
SConfig
*
pCfg
=
taosGetCfg
();
SConfig
*
pCfg
=
taosGetCfg
();
SConfigItem
*
pItem
=
NULL
;
switch
(
option
)
{
...
...
source/client/src/clientHb.c
浏览文件 @
dce19313
...
...
@@ -394,6 +394,10 @@ int32_t hbGetExpiredUserInfo(SClientHbKey *connKey, struct SCatalog *pCatalog, S
tscDebug
(
"hb got %d expired users, valueLen:%d"
,
userNum
,
kv
.
valueLen
);
if
(
NULL
==
req
->
info
)
{
req
->
info
=
taosHashInit
(
64
,
hbKeyHashFunc
,
1
,
HASH_ENTRY_LOCK
);
}
taosHashPut
(
req
->
info
,
&
kv
.
key
,
sizeof
(
kv
.
key
),
&
kv
,
sizeof
(
kv
));
return
TSDB_CODE_SUCCESS
;
...
...
@@ -429,6 +433,10 @@ int32_t hbGetExpiredDBInfo(SClientHbKey *connKey, struct SCatalog *pCatalog, SCl
tscDebug
(
"hb got %d expired db, valueLen:%d"
,
dbNum
,
kv
.
valueLen
);
if
(
NULL
==
req
->
info
)
{
req
->
info
=
taosHashInit
(
64
,
hbKeyHashFunc
,
1
,
HASH_ENTRY_LOCK
);
}
taosHashPut
(
req
->
info
,
&
kv
.
key
,
sizeof
(
kv
.
key
),
&
kv
,
sizeof
(
kv
));
return
TSDB_CODE_SUCCESS
;
...
...
@@ -463,6 +471,10 @@ int32_t hbGetExpiredStbInfo(SClientHbKey *connKey, struct SCatalog *pCatalog, SC
tscDebug
(
"hb got %d expired stb, valueLen:%d"
,
stbNum
,
kv
.
valueLen
);
if
(
NULL
==
req
->
info
)
{
req
->
info
=
taosHashInit
(
64
,
hbKeyHashFunc
,
1
,
HASH_ENTRY_LOCK
);
}
taosHashPut
(
req
->
info
,
&
kv
.
key
,
sizeof
(
kv
.
key
),
&
kv
,
sizeof
(
kv
));
return
TSDB_CODE_SUCCESS
;
...
...
@@ -511,16 +523,6 @@ static FORCE_INLINE void hbMgrInitHandle() {
hbMgrInitMqHbHandle
();
}
void
hbFreeReq
(
void
*
req
)
{
SClientHbReq
*
pReq
=
(
SClientHbReq
*
)
req
;
tFreeReqKvHash
(
pReq
->
info
);
}
void
hbClearClientHbReq
(
SClientHbReq
*
pReq
)
{
pReq
->
query
=
NULL
;
pReq
->
info
=
NULL
;
}
SClientHbBatchReq
*
hbGatherAllInfo
(
SAppHbMgr
*
pAppHbMgr
)
{
SClientHbBatchReq
*
pBatchReq
=
taosMemoryCalloc
(
1
,
sizeof
(
SClientHbBatchReq
));
if
(
pBatchReq
==
NULL
)
{
...
...
@@ -535,6 +537,8 @@ SClientHbBatchReq *hbGatherAllInfo(SAppHbMgr *pAppHbMgr) {
while
(
pIter
!=
NULL
)
{
SClientHbReq
*
pOneReq
=
pIter
;
pOneReq
=
taosArrayPush
(
pBatchReq
->
reqs
,
pOneReq
);
SHbConnInfo
*
info
=
taosHashGet
(
pAppHbMgr
->
connInfo
,
&
pOneReq
->
connKey
,
sizeof
(
SClientHbKey
));
if
(
info
)
{
code
=
(
*
clientHbMgr
.
reqHandle
[
pOneReq
->
connKey
.
connType
])(
&
pOneReq
->
connKey
,
info
->
param
,
pOneReq
);
...
...
@@ -544,7 +548,6 @@ SClientHbBatchReq *hbGatherAllInfo(SAppHbMgr *pAppHbMgr) {
}
}
taosArrayPush
(
pBatchReq
->
reqs
,
pOneReq
);
//hbClearClientHbReq(pOneReq);
pIter
=
taosHashIterate
(
pAppHbMgr
->
activeInfo
,
pIter
);
...
...
@@ -601,8 +604,8 @@ static void *hbThreadFunc(void *param) {
void
*
buf
=
taosMemoryMalloc
(
tlen
);
if
(
buf
==
NULL
)
{
terrno
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
tFreeClientHbBatchReq
(
pReq
,
false
);
hbClearReqInfo
(
pAppHbMgr
);
tFreeClientHbBatchReq
(
pReq
);
//
hbClearReqInfo(pAppHbMgr);
break
;
}
...
...
@@ -611,8 +614,8 @@ static void *hbThreadFunc(void *param) {
if
(
pInfo
==
NULL
)
{
terrno
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
tFreeClientHbBatchReq
(
pReq
,
false
);
hbClearReqInfo
(
pAppHbMgr
);
tFreeClientHbBatchReq
(
pReq
);
//
hbClearReqInfo(pAppHbMgr);
taosMemoryFree
(
buf
);
break
;
}
...
...
@@ -628,8 +631,8 @@ static void *hbThreadFunc(void *param) {
int64_t
transporterId
=
0
;
SEpSet
epSet
=
getEpSet_s
(
&
pAppInstInfo
->
mgmtEp
);
asyncSendMsgToServer
(
pAppInstInfo
->
pTransporter
,
&
epSet
,
&
transporterId
,
pInfo
);
tFreeClientHbBatchReq
(
pReq
,
false
);
hbClearReqInfo
(
pAppHbMgr
);
tFreeClientHbBatchReq
(
pReq
);
//
hbClearReqInfo(pAppHbMgr);
atomic_add_fetch_32
(
&
pAppHbMgr
->
reportCnt
,
1
);
}
...
...
@@ -721,8 +724,7 @@ void appHbMgrCleanup(void) {
void
*
pIter
=
taosHashIterate
(
pTarget
->
activeInfo
,
NULL
);
while
(
pIter
!=
NULL
)
{
SClientHbReq
*
pOneReq
=
pIter
;
hbFreeReq
(
pOneReq
);
taosHashCleanup
(
pOneReq
->
info
);
tFreeClientHbReq
(
pOneReq
);
pIter
=
taosHashIterate
(
pTarget
->
activeInfo
,
pIter
);
}
taosHashCleanup
(
pTarget
->
activeInfo
);
...
...
@@ -782,7 +784,7 @@ int hbRegisterConnImpl(SAppHbMgr *pAppHbMgr, SClientHbKey connKey, SHbConnInfo *
}
SClientHbReq
hbReq
=
{
0
};
hbReq
.
connKey
=
connKey
;
hbReq
.
info
=
taosHashInit
(
64
,
hbKeyHashFunc
,
1
,
HASH_ENTRY_LOCK
);
//
hbReq.info = taosHashInit(64, hbKeyHashFunc, 1, HASH_ENTRY_LOCK);
taosHashPut
(
pAppHbMgr
->
activeInfo
,
&
connKey
,
sizeof
(
SClientHbKey
),
&
hbReq
,
sizeof
(
SClientHbReq
));
...
...
@@ -823,8 +825,7 @@ int hbRegisterConn(SAppHbMgr *pAppHbMgr, int64_t tscRefId, int64_t clusterId, in
void
hbDeregisterConn
(
SAppHbMgr
*
pAppHbMgr
,
SClientHbKey
connKey
)
{
SClientHbReq
*
pReq
=
taosHashGet
(
pAppHbMgr
->
activeInfo
,
&
connKey
,
sizeof
(
SClientHbKey
));
if
(
pReq
)
{
hbFreeReq
(
pReq
);
taosHashCleanup
(
pReq
->
info
);
tFreeClientHbReq
(
pReq
);
taosHashRemove
(
pAppHbMgr
->
activeInfo
,
&
connKey
,
sizeof
(
SClientHbKey
));
}
...
...
source/client/src/clientImpl.c
浏览文件 @
dce19313
...
...
@@ -345,6 +345,10 @@ int32_t validateSversion(SRequestObj* pRequest, void* res) {
for
(
int32_t
i
=
0
;
i
<
pRsp
->
nBlocks
;
++
i
)
{
SSubmitBlkRsp
*
blk
=
pRsp
->
pBlocks
+
i
;
if
(
NULL
==
blk
->
tblFName
||
0
==
blk
->
tblFName
[
0
])
{
continue
;
}
STbSVersion
tbSver
=
{.
tbFName
=
blk
->
tblFName
,
.
sver
=
blk
->
sver
};
taosArrayPush
(
pArray
,
&
tbSver
);
}
...
...
@@ -383,14 +387,14 @@ _return:
}
void
freeRequestRes
(
SRequestObj
*
pRequest
,
void
*
res
)
{
if
(
NULL
==
res
)
{
if
(
NULL
==
pRequest
||
NULL
==
res
)
{
return
;
}
if
(
TDMT_VND_SUBMIT
==
pRequest
->
type
)
{
tFreeSSubmitRsp
((
SSubmitRsp
*
)
res
);
}
else
if
(
TDMT_VND_QUERY
==
pRequest
->
type
)
{
taosArrayDestroy
((
SArray
*
)
res
);
taosArrayDestroy
((
SArray
*
)
res
);
}
}
...
...
@@ -431,12 +435,13 @@ SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, int32_t code
if
(
NULL
!=
pRequest
&&
TSDB_CODE_SUCCESS
!=
code
)
{
pRequest
->
code
=
terrno
;
freeRequestRes
(
pRequest
,
pRes
);
pRes
=
NULL
;
}
if
(
res
)
{
*
res
=
pRes
;
}
else
{
freeRequestRes
(
pRequest
,
pRes
);
pRes
=
NULL
;
}
return
pRequest
;
...
...
@@ -499,6 +504,23 @@ int32_t refreshMeta(STscObj* pTscObj, SRequestObj* pRequest) {
return
code
;
}
int32_t
removeMeta
(
STscObj
*
pTscObj
,
SArray
*
tbList
)
{
SCatalog
*
pCatalog
=
NULL
;
int32_t
tbNum
=
taosArrayGetSize
(
tbList
);
int32_t
code
=
catalogGetHandle
(
pTscObj
->
pAppInfo
->
clusterId
,
&
pCatalog
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
for
(
int32_t
i
=
0
;
i
<
tbNum
;
++
i
)
{
SName
*
pTbName
=
taosArrayGet
(
tbList
,
i
);
catalogRemoveTableMeta
(
pCatalog
,
pTbName
);
}
return
TSDB_CODE_SUCCESS
;
}
SRequestObj
*
execQuery
(
STscObj
*
pTscObj
,
const
char
*
sql
,
int
sqlLen
)
{
SRequestObj
*
pRequest
=
NULL
;
int32_t
retryNum
=
0
;
...
...
@@ -518,6 +540,10 @@ SRequestObj* execQuery(STscObj* pTscObj, const char* sql, int sqlLen) {
}
}
while
(
retryNum
++
<
REQUEST_MAX_TRY_TIMES
);
if
(
NEED_CLIENT_RM_TBLMETA_REQ
(
pRequest
->
type
))
{
removeMeta
(
pTscObj
,
pRequest
->
tableList
);
}
return
pRequest
;
}
...
...
source/client/src/clientMain.c
浏览文件 @
dce19313
...
...
@@ -146,10 +146,10 @@ void taos_free_result(TAOS_RES *res) {
SMqRspObj
*
pRsp
=
(
SMqRspObj
*
)
res
;
if
(
pRsp
->
rsp
.
blockData
)
taosArrayDestroyP
(
pRsp
->
rsp
.
blockData
,
taosMemoryFree
);
if
(
pRsp
->
rsp
.
blockDataLen
)
taosArrayDestroy
(
pRsp
->
rsp
.
blockDataLen
);
if
(
pRsp
->
rsp
.
blockSchema
)
taosArrayDestroy
(
pRsp
->
rsp
.
blockSchema
);
if
(
pRsp
->
rsp
.
blockTbName
)
taosArrayDestroy
(
pRsp
->
rsp
.
blockTbName
);
if
(
pRsp
->
rsp
.
blockTags
)
taosArrayDestroy
(
pRsp
->
rsp
.
blockTags
);
if
(
pRsp
->
rsp
.
blockTagSchema
)
taosArrayDestroy
(
pRsp
->
rsp
.
blockTagSchema
);
if
(
pRsp
->
rsp
.
withTbName
)
taosArrayDestroyP
(
pRsp
->
rsp
.
blockTbName
,
taosMemoryFree
);
if
(
pRsp
->
rsp
.
withSchema
)
taosArrayDestroyP
(
pRsp
->
rsp
.
blockSchema
,
(
FDelete
)
tDeleteSSchemaWrapper
);
pRsp
->
resInfo
.
pRspMsg
=
NULL
;
doFreeReqResultInfo
(
&
pRsp
->
resInfo
);
}
...
...
source/client/src/clientSml.c
浏览文件 @
dce19313
...
...
@@ -63,10 +63,6 @@ for (int i = 1; i < keyLen; ++i) { \
#define TS "_ts"
#define TS_LEN 3
#define TAG "_tag"
#define TAG_LEN 4
#define TAG_VALUE "NULL"
#define TAG_VALUE_LEN 4
#define VALUE "value"
#define VALUE_LEN 5
...
...
@@ -263,7 +259,7 @@ static int32_t smlBuildColumnDescription(SSmlKv* field, char* buf, int32_t bufSi
memcpy
(
tname
,
field
->
key
,
field
->
keyLen
);
if
(
type
==
TSDB_DATA_TYPE_BINARY
||
type
==
TSDB_DATA_TYPE_NCHAR
)
{
int32_t
bytes
=
field
->
length
>
CHAR_SAVE_LENGTH
?
(
2
*
field
->
length
)
:
CHAR_SAVE_LENGTH
;
int
out
=
snprintf
(
buf
,
bufSize
,
"`%s` %s(%d)"
,
int
out
=
snprintf
(
buf
,
bufSize
,
"`%s` %s(%d)"
,
tname
,
tDataTypes
[
field
->
type
].
name
,
bytes
);
*
outBytes
=
out
;
}
else
{
...
...
@@ -400,6 +396,12 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) {
pos
+=
outBytes
;
freeBytes
-=
outBytes
;
*
pos
=
','
;
++
pos
;
--
freeBytes
;
}
if
(
taosArrayGetSize
(
cols
)
==
0
){
outBytes
=
snprintf
(
pos
,
freeBytes
,
"`%s` %s(%d)"
,
tsSmlTagName
,
tDataTypes
[
TSDB_DATA_TYPE_NCHAR
].
name
,
CHAR_SAVE_LENGTH
);
pos
+=
outBytes
;
freeBytes
-=
outBytes
;
*
pos
=
','
;
++
pos
;
--
freeBytes
;
}
pos
--
;
++
freeBytes
;
outBytes
=
snprintf
(
pos
,
freeBytes
,
")"
);
TAOS_RES
*
res
=
taos_query
(
info
->
taos
,
result
);
...
...
@@ -724,9 +726,6 @@ static int64_t smlGetTimeValue(const char *value, int32_t len, int8_t type) {
if
(
value
+
len
!=
endPtr
){
return
-
1
;
}
if
(
tsInt64
==
0
){
return
taosGetTimestampNs
();
}
double
ts
=
tsInt64
;
switch
(
type
)
{
case
TSDB_TIME_PRECISION_HOURS
:
...
...
@@ -792,8 +791,8 @@ static int8_t smlGetTsTypeByPrecision(int8_t precision) {
}
static
int64_t
smlParseInfluxTime
(
SSmlHandle
*
info
,
const
char
*
data
,
int32_t
len
){
if
(
len
==
0
){
return
taosGetTimestamp
(
TSDB_TIME_PRECISION_NANO
);
if
(
len
==
0
||
(
len
==
1
&&
data
[
0
]
==
'0'
)
){
return
taosGetTimestamp
Ns
(
);
}
int8_t
tsType
=
smlGetTsTypeByPrecision
(
info
->
precision
);
...
...
@@ -815,6 +814,9 @@ static int64_t smlParseOpenTsdbTime(SSmlHandle* info, const char* data, int32_t
smlBuildInvalidDataMsg
(
&
info
->
msgBuf
,
"timestamp can not be null"
,
NULL
);
return
-
1
;
}
if
(
len
==
1
&&
data
[
0
]
==
'0'
){
return
taosGetTimestampNs
();
}
int8_t
tsType
=
smlGetTsTypeByLen
(
len
);
if
(
tsType
==
-
1
)
{
smlBuildInvalidDataMsg
(
&
info
->
msgBuf
,
"timestamp precision can only be seconds(10 digits) or milli seconds(13 digits)"
,
data
);
...
...
@@ -1112,14 +1114,6 @@ static int32_t smlParseTelnetString(SSmlHandle *info, const char* sql, SSmlTable
static
int32_t
smlParseCols
(
const
char
*
data
,
int32_t
len
,
SArray
*
cols
,
char
*
childTableName
,
bool
isTag
,
SHashObj
*
dumplicateKey
,
SSmlMsgBuf
*
msg
){
if
(
isTag
&&
len
==
0
){
SSmlKv
*
kv
=
(
SSmlKv
*
)
taosMemoryCalloc
(
sizeof
(
SSmlKv
),
1
);
if
(
!
kv
)
return
TSDB_CODE_OUT_OF_MEMORY
;
kv
->
key
=
TAG
;
kv
->
keyLen
=
TAG_LEN
;
kv
->
value
=
TAG_VALUE
;
kv
->
length
=
TAG_VALUE_LEN
;
kv
->
type
=
TSDB_DATA_TYPE_NCHAR
;
if
(
cols
)
taosArrayPush
(
cols
,
&
kv
);
return
TSDB_CODE_SUCCESS
;
}
...
...
source/client/src/clientStmt.c
浏览文件 @
dce19313
...
...
@@ -47,8 +47,14 @@ int32_t stmtSwitchStatus(STscStmt* pStmt, STMT_STATUS newStatus) {
}
break
;
case
STMT_EXECUTE
:
if
(
STMT_STATUS_NE
(
ADD_BATCH
)
&&
STMT_STATUS_NE
(
FETCH_FIELDS
))
{
code
=
TSDB_CODE_TSC_STMT_API_ERROR
;
if
(
STMT_TYPE_QUERY
==
pStmt
->
sql
.
type
)
{
if
(
STMT_STATUS_NE
(
ADD_BATCH
)
&&
STMT_STATUS_NE
(
FETCH_FIELDS
)
&&
STMT_STATUS_NE
(
BIND
)
&&
STMT_STATUS_NE
(
BIND_COL
))
{
code
=
TSDB_CODE_TSC_STMT_API_ERROR
;
}
}
else
{
if
(
STMT_STATUS_NE
(
ADD_BATCH
)
&&
STMT_STATUS_NE
(
FETCH_FIELDS
))
{
code
=
TSDB_CODE_TSC_STMT_API_ERROR
;
}
}
break
;
default:
...
...
@@ -794,6 +800,7 @@ int stmtExec(TAOS_STMT* stmt) {
if
(
code
)
{
pStmt
->
exec
.
pRequest
->
code
=
code
;
}
else
{
tFreeSSubmitRsp
(
pRsp
);
STMT_ERR_RET
(
stmtResetStmt
(
pStmt
));
STMT_ERR_RET
(
TSDB_CODE_NEED_RETRY
);
}
...
...
@@ -811,11 +818,13 @@ _return:
if
(
TSDB_CODE_SUCCESS
==
code
&&
autoCreateTbl
)
{
if
(
NULL
==
pRsp
)
{
tscError
(
"no submit resp got for auto create table"
);
STMT_ERR_RET
(
TSDB_CODE_TSC_APP_ERROR
);
code
=
TSDB_CODE_TSC_APP_ERROR
;
}
else
{
code
=
stmtUpdateTableUid
(
pStmt
,
pRsp
);
}
STMT_ERR_RET
(
stmtUpdateTableUid
(
pStmt
,
pRsp
));
}
tFreeSSubmitRsp
(
pRsp
);
++
pStmt
->
sql
.
runTimes
;
...
...
source/client/src/tmq.c
浏览文件 @
dce19313
...
...
@@ -202,7 +202,12 @@ tmq_conf_t* tmq_conf_new() {
}
void
tmq_conf_destroy
(
tmq_conf_t
*
conf
)
{
if
(
conf
)
taosMemoryFree
(
conf
);
if
(
conf
)
{
if
(
conf
->
ip
)
taosMemoryFree
(
conf
->
ip
);
if
(
conf
->
user
)
taosMemoryFree
(
conf
->
user
);
if
(
conf
->
pass
)
taosMemoryFree
(
conf
->
pass
);
taosMemoryFree
(
conf
);
}
}
tmq_conf_res_t
tmq_conf_set
(
tmq_conf_t
*
conf
,
const
char
*
key
,
const
char
*
value
)
{
...
...
@@ -497,6 +502,7 @@ int32_t tmqHandleAllDelayedTask(tmq_t* tmq) {
}
else
{
ASSERT
(
0
);
}
taosFreeQitem
(
pTaskType
);
}
taosFreeQall
(
qall
);
return
0
;
...
...
@@ -954,8 +960,12 @@ int32_t tmqPollCb(void* param, const SDataBuf* pMsg, int32_t code) {
SMqClientVg
*
pVg
=
pParam
->
pVg
;
SMqClientTopic
*
pTopic
=
pParam
->
pTopic
;
tmq_t
*
tmq
=
pParam
->
tmq
;
int32_t
vgId
=
pParam
->
vgId
;
int32_t
epoch
=
pParam
->
epoch
;
taosMemoryFree
(
pParam
);
if
(
code
!=
0
)
{
tscWarn
(
"msg discard from vg %d, epoch %d, code:%x"
,
pParam
->
vgId
,
pParam
->
epoch
,
code
);
tscWarn
(
"msg discard from vg %d, epoch %d, code:%x"
,
vgId
,
epoch
,
code
);
if
(
pMsg
->
pData
)
taosMemoryFree
(
pMsg
->
pData
);
goto
CREATE_MSG_FAIL
;
}
...
...
@@ -963,19 +973,21 @@ int32_t tmqPollCb(void* param, const SDataBuf* pMsg, int32_t code) {
int32_t
tmqEpoch
=
atomic_load_32
(
&
tmq
->
epoch
);
if
(
msgEpoch
<
tmqEpoch
)
{
// do not write into queue since updating epoch reset
tscWarn
(
"msg discard from vg %d since from earlier epoch, rsp epoch %d, current epoch %d"
,
pParam
->
vgId
,
msgEpoch
,
tscWarn
(
"msg discard from vg %d since from earlier epoch, rsp epoch %d, current epoch %d"
,
vgId
,
msgEpoch
,
tmqEpoch
);
tsem_post
(
&
tmq
->
rspSem
);
taosMemoryFree
(
pMsg
->
pData
);
return
0
;
}
if
(
msgEpoch
!=
tmqEpoch
)
{
tscWarn
(
"mismatch rsp from vg %d, epoch %d, current epoch %d"
,
pParam
->
vgId
,
msgEpoch
,
tmqEpoch
);
tscWarn
(
"mismatch rsp from vg %d, epoch %d, current epoch %d"
,
vgId
,
msgEpoch
,
tmqEpoch
);
}
SMqPollRspWrapper
*
pRspWrapper
=
taosAllocateQitem
(
sizeof
(
SMqPollRspWrapper
),
DEF_QITEM
);
if
(
pRspWrapper
==
NULL
)
{
tscWarn
(
"msg discard from vg %d, epoch %d since out of memory"
,
pParam
->
vgId
,
pParam
->
epoch
);
taosMemoryFree
(
pMsg
->
pData
);
tscWarn
(
"msg discard from vg %d, epoch %d since out of memory"
,
vgId
,
epoch
);
goto
CREATE_MSG_FAIL
;
}
...
...
@@ -986,6 +998,7 @@ int32_t tmqPollCb(void* param, const SDataBuf* pMsg, int32_t code) {
memcpy
(
&
pRspWrapper
->
msg
,
pMsg
->
pData
,
sizeof
(
SMqRspHead
));
tDecodeSMqDataBlkRsp
(
POINTER_SHIFT
(
pMsg
->
pData
,
sizeof
(
SMqRspHead
)),
&
pRspWrapper
->
msg
);
taosMemoryFree
(
pMsg
->
pData
);
tscDebug
(
"consumer %ld recv poll: vg %d, req offset %ld, rsp offset %ld"
,
tmq
->
consumerId
,
pVg
->
vgId
,
pRspWrapper
->
msg
.
reqOffset
,
pRspWrapper
->
msg
.
rspOffset
);
...
...
@@ -995,7 +1008,7 @@ int32_t tmqPollCb(void* param, const SDataBuf* pMsg, int32_t code) {
return
0
;
CREATE_MSG_FAIL:
if
(
pParam
->
epoch
==
tmq
->
epoch
)
{
if
(
epoch
==
tmq
->
epoch
)
{
atomic_store_32
(
&
pVg
->
vgStatus
,
TMQ_VG_STATUS__IDLE
);
}
tsem_post
(
&
tmq
->
rspSem
);
...
...
@@ -1088,6 +1101,7 @@ bool tmqUpdateEp(tmq_t* tmq, int32_t epoch, SMqAskEpRsp* pRsp) {
int32_t
tmqAskEpCb
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
SMqAskEpCbParam
*
pParam
=
(
SMqAskEpCbParam
*
)
param
;
tmq_t
*
tmq
=
pParam
->
tmq
;
int8_t
async
=
pParam
->
async
;
pParam
->
code
=
code
;
if
(
code
!=
0
)
{
tscError
(
"consumer %ld get topic endpoint error, not ready, wait:%d"
,
tmq
->
consumerId
,
pParam
->
async
);
...
...
@@ -1104,7 +1118,7 @@ int32_t tmqAskEpCb(void* param, const SDataBuf* pMsg, int32_t code) {
goto
END
;
}
if
(
!
pParam
->
async
)
{
if
(
!
async
)
{
SMqAskEpRsp
rsp
;
tDecodeSMqAskEpRsp
(
POINTER_SHIFT
(
pMsg
->
pData
,
sizeof
(
SMqRspHead
)),
&
rsp
);
/*printf("rsp epoch %ld sz %ld\n", rsp.epoch, rsp.topics->size);*/
...
...
@@ -1125,13 +1139,14 @@ int32_t tmqAskEpCb(void* param, const SDataBuf* pMsg, int32_t code) {
taosWriteQitem
(
tmq
->
mqueue
,
pWrapper
);
tsem_post
(
&
tmq
->
rspSem
);
taosMemoryFree
(
pParam
);
}
END:
/*atomic_store_8(&tmq->epStatus, 0);*/
if
(
!
pParam
->
async
)
{
if
(
!
async
)
{
tsem_post
(
&
pParam
->
rspSem
);
}
else
{
taosMemoryFree
(
pParam
);
}
return
code
;
}
...
...
@@ -1279,7 +1294,6 @@ SMqRspObj* tmqBuildRspFromWrapper(SMqPollRspWrapper* pWrapper) {
setResSchemaInfo
(
&
pRspObj
->
resInfo
,
pWrapper
->
topicHandle
->
schema
.
pSchema
,
pWrapper
->
topicHandle
->
schema
.
nCols
);
}
taosFreeQitem
(
pWrapper
);
return
pRspObj
;
}
...
...
@@ -1401,6 +1415,7 @@ SMqRspObj* tmqHandleAllRsp(tmq_t* tmq, int64_t waitTime, bool pollIfReset) {
}
// build rsp
SMqRspObj
*
pRsp
=
tmqBuildRspFromWrapper
(
pollRspWrapper
);
taosFreeQitem
(
pollRspWrapper
);
return
pRsp
;
}
else
{
/*printf("epoch mismatch\n");*/
...
...
source/client/test/smlTest.cpp
浏览文件 @
dce19313
...
...
@@ -269,16 +269,7 @@ TEST(testCase, smlParseCols_tag_Test) {
ret
=
smlParseCols
(
data
,
len
,
cols
,
NULL
,
true
,
dumplicateKey
,
&
msgBuf
);
ASSERT_EQ
(
ret
,
TSDB_CODE_SUCCESS
);
size
=
taosArrayGetSize
(
cols
);
ASSERT_EQ
(
size
,
1
);
// nchar
kv
=
(
SSmlKv
*
)
taosArrayGetP
(
cols
,
0
);
ASSERT_EQ
(
strncasecmp
(
kv
->
key
,
TAG
,
TAG_LEN
),
0
);
ASSERT_EQ
(
kv
->
keyLen
,
TAG_LEN
);
ASSERT_EQ
(
kv
->
type
,
TSDB_DATA_TYPE_NCHAR
);
ASSERT_EQ
(
kv
->
length
,
TAG_LEN
);
ASSERT_EQ
(
strncasecmp
(
kv
->
value
,
TAG_VALUE
,
TAG_VALUE_LEN
),
0
);
taosMemoryFree
(
kv
);
ASSERT_EQ
(
size
,
0
);
taosArrayDestroy
(
cols
);
taosHashCleanup
(
dumplicateKey
);
...
...
@@ -1207,7 +1198,8 @@ TEST(testCase, sml_TD15662_Test) {
ASSERT_NE
(
info
,
nullptr
);
const
char
*
sql
[]
=
{
"hetrey,id=sub_table_0123456,t0=f,t1=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=11.12345f32,t6=22.123456789f64,t7=
\"
binaryTagValue
\"
,t8=L
\"
ncharTagValue
\"
c0=f,c1=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22.123456789f64,c7=
\"
binaryColValue
\"
,c8=L
\"
ncharColValue
\"
,c9=7u64"
,
"hetrey c0=f,c1=127i8 1626006833639"
,
"hetrey,t1=r c0=f,c1=127i8 1626006833640"
,
};
int
ret
=
smlProcess
(
info
,
(
char
**
)
sql
,
sizeof
(
sql
)
/
sizeof
(
sql
[
0
]));
ASSERT_EQ
(
ret
,
0
);
...
...
source/common/src/tdataformat.c
浏览文件 @
dce19313
...
...
@@ -1077,7 +1077,7 @@ void tdResetKVRowBuilder(SKVRowBuilder *pBuilder) {
SKVRow
tdGetKVRowFromBuilder
(
SKVRowBuilder
*
pBuilder
)
{
int
tlen
=
sizeof
(
SColIdx
)
*
pBuilder
->
nCols
+
pBuilder
->
size
;
if
(
tlen
==
0
)
return
NULL
;
// if (tlen == 0) return NULL; // nCols == 0 means no tags
tlen
+=
TD_KV_ROW_HEAD_SIZE
;
...
...
@@ -1087,8 +1087,10 @@ SKVRow tdGetKVRowFromBuilder(SKVRowBuilder *pBuilder) {
kvRowSetNCols
(
row
,
pBuilder
->
nCols
);
kvRowSetLen
(
row
,
tlen
);
memcpy
(
kvRowColIdx
(
row
),
pBuilder
->
pColIdx
,
sizeof
(
SColIdx
)
*
pBuilder
->
nCols
);
memcpy
(
kvRowValues
(
row
),
pBuilder
->
buf
,
pBuilder
->
size
);
if
(
pBuilder
->
nCols
>
0
){
memcpy
(
kvRowColIdx
(
row
),
pBuilder
->
pColIdx
,
sizeof
(
SColIdx
)
*
pBuilder
->
nCols
);
memcpy
(
kvRowValues
(
row
),
pBuilder
->
buf
,
pBuilder
->
size
);
}
return
row
;
}
...
...
source/common/src/tglobal.c
浏览文件 @
dce19313
...
...
@@ -78,6 +78,7 @@ char tsTelemServer[TSDB_FQDN_LEN] = "telemetry.taosdata.com";
uint16_t
tsTelemPort
=
80
;
// schemaless
char
tsSmlTagName
[
TSDB_COL_NAME_LEN
]
=
"_tag_null"
;
char
tsSmlChildTableName
[
TSDB_TABLE_NAME_LEN
]
=
""
;
//user defined child table name can be specified in tag value.
//If set to empty system will generate table name using MD5 hash.
bool
tsSmlDataFormat
=
true
;
// true means that the name and order of cols in each line are the same(only for influx protocol)
...
...
@@ -326,6 +327,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
if
(
cfgAddBool
(
pCfg
,
"keepColumnName"
,
tsKeepOriginalColumnName
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"queryPolicy"
,
tsQueryPolicy
,
1
,
3
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddString
(
pCfg
,
"smlChildTableName"
,
""
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddString
(
pCfg
,
"smlTagNullName"
,
tsSmlTagName
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"smlDataFormat"
,
tsSmlDataFormat
,
1
)
!=
0
)
return
-
1
;
tsNumOfTaskQueueThreads
=
tsNumOfCores
/
4
;
...
...
@@ -522,6 +524,7 @@ static int32_t taosSetClientCfg(SConfig *pCfg) {
}
tstrncpy
(
tsSmlChildTableName
,
cfgGetItem
(
pCfg
,
"smlChildTableName"
)
->
str
,
TSDB_TABLE_NAME_LEN
);
tstrncpy
(
tsSmlTagName
,
cfgGetItem
(
pCfg
,
"smlTagNullName"
)
->
str
,
TSDB_COL_NAME_LEN
);
tsSmlDataFormat
=
cfgGetItem
(
pCfg
,
"smlDataFormat"
)
->
bval
;
tsShellActivityTimer
=
cfgGetItem
(
pCfg
,
"shellActivityTimer"
)
->
i32
;
...
...
source/common/src/tname.c
浏览文件 @
dce19313
...
...
@@ -308,13 +308,10 @@ static int compareKv(const void* p1, const void* p2) {
* use stable name and tags to grearate child table name
*/
void
buildChildTableName
(
RandTableName
*
rName
)
{
int32_t
size
=
taosArrayGetSize
(
rName
->
tags
);
ASSERT
(
size
>
0
);
taosArraySort
(
rName
->
tags
,
compareKv
);
SStringBuilder
sb
=
{
0
};
taosStringBuilderAppendStringLen
(
&
sb
,
rName
->
sTableName
,
rName
->
sTableNameLen
);
for
(
int
j
=
0
;
j
<
size
;
++
j
)
{
taosArraySort
(
rName
->
tags
,
compareKv
);
for
(
int
j
=
0
;
j
<
taosArrayGetSize
(
rName
->
tags
);
++
j
)
{
SSmlKv
*
tagKv
=
taosArrayGetP
(
rName
->
tags
,
j
);
taosStringBuilderAppendStringLen
(
&
sb
,
tagKv
->
key
,
tagKv
->
keyLen
);
if
(
IS_VAR_DATA_TYPE
(
tagKv
->
type
)){
...
...
source/dnode/mgmt/mgmt_bnode/src/bmWorker.c
浏览文件 @
dce19313
...
...
@@ -47,10 +47,8 @@ static inline void bmSendRsp(SRpcMsg *pMsg, int32_t code) {
static
void
bmProcessMonitorQueue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SBnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
int32_t
code
=
-
1
;
dTrace
(
"msg:%p, get from bnode-monitor queue"
,
pMsg
);
SRpcMsg
*
pRpc
=
pMsg
;
int32_t
code
=
-
1
;
if
(
pMsg
->
msgType
==
TDMT_MON_BM_INFO
)
{
code
=
bmProcessGetMonBmInfoReq
(
pMgmt
,
pMsg
);
...
...
@@ -58,13 +56,13 @@ static void bmProcessMonitorQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
}
if
(
pRpc
->
msgType
&
1U
)
{
if
(
IsReq
(
pMsg
)
)
{
if
(
code
!=
0
&&
terrno
!=
0
)
code
=
terrno
;
bmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"msg:%p, is freed, code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
p
Rpc
->
pCont
);
rpcFreeCont
(
p
Msg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
source/dnode/mgmt/mgmt_dnode/src/dmWorker.c
浏览文件 @
dce19313
...
...
@@ -19,7 +19,6 @@
static
void
*
dmStatusThreadFp
(
void
*
param
)
{
SDnodeMgmt
*
pMgmt
=
param
;
int64_t
lastTime
=
taosGetTimestampMs
();
setThreadName
(
"dnode-status"
);
while
(
1
)
{
...
...
@@ -40,7 +39,6 @@ static void *dmStatusThreadFp(void *param) {
static
void
*
dmMonitorThreadFp
(
void
*
param
)
{
SDnodeMgmt
*
pMgmt
=
param
;
int64_t
lastTime
=
taosGetTimestampMs
();
setThreadName
(
"dnode-monitor"
);
while
(
1
)
{
...
...
@@ -103,11 +101,9 @@ void dmStopMonitorThread(SDnodeMgmt *pMgmt) {
static
void
dmProcessMgmtQueue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SDnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
int32_t
code
=
-
1
;
tmsg_t
msgType
=
pMsg
->
msgType
;
bool
isRequest
=
msgType
&
1u
;
dTrace
(
"msg:%p, will be processed in dnode-mgmt queue, type:%s"
,
pMsg
,
TMSG_INFO
(
msgType
));
dTrace
(
"msg:%p, will be processed in dnode queue, type:%s"
,
pMsg
,
TMSG_INFO
(
pMsg
->
msgType
));
switch
(
msgType
)
{
switch
(
pMsg
->
msgType
)
{
case
TDMT_DND_CONFIG_DNODE
:
code
=
dmProcessConfigReq
(
pMgmt
,
pMsg
);
break
;
...
...
@@ -149,7 +145,7 @@ static void dmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
break
;
}
if
(
isRequest
)
{
if
(
IsReq
(
pMsg
)
)
{
if
(
code
!=
0
&&
terrno
!=
0
)
code
=
terrno
;
SRpcMsg
rsp
=
{
.
code
=
code
,
...
...
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
浏览文件 @
dce19313
...
...
@@ -46,7 +46,7 @@ static void mmProcessQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
code
=
mndProcessMsg
(
pMsg
);
}
if
(
IsReq
(
pMsg
)
&&
pMsg
->
info
.
handle
!=
NULL
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
IsReq
(
pMsg
)
&&
pMsg
->
info
.
handle
!=
NULL
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
terrno
!=
0
)
code
=
terrno
;
mmSendRsp
(
pMsg
,
code
);
}
...
...
@@ -56,28 +56,6 @@ static void mmProcessQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
taosFreeQitem
(
pMsg
);
}
static
void
mmProcessQueryQueue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SMnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
int32_t
code
=
-
1
;
tmsg_t
msgType
=
pMsg
->
msgType
;
bool
isRequest
=
msgType
&
1U
;
dTrace
(
"msg:%p, get from mnode-query queue"
,
pMsg
);
pMsg
->
info
.
node
=
pMgmt
->
pMnode
;
code
=
mndProcessMsg
(
pMsg
);
if
(
isRequest
)
{
if
(
pMsg
->
info
.
handle
!=
NULL
&&
code
!=
0
)
{
if
(
code
!=
0
&&
terrno
!=
0
)
code
=
terrno
;
mmSendRsp
(
pMsg
,
code
);
}
}
dTrace
(
"msg:%p, is freed, code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
static
int32_t
mmPutNodeMsgToWorker
(
SSingleWorker
*
pWorker
,
SRpcMsg
*
pMsg
)
{
dTrace
(
"msg:%p, put into worker %s, type:%s"
,
pMsg
,
pWorker
->
name
,
TMSG_INFO
(
pMsg
->
msgType
));
taosWriteQitem
(
pWorker
->
queue
,
pMsg
);
...
...
@@ -135,7 +113,7 @@ int32_t mmStartWorker(SMnodeMgmt *pMgmt) {
.
min
=
tsNumOfMnodeQueryThreads
,
.
max
=
tsNumOfMnodeQueryThreads
,
.
name
=
"mnode-query"
,
.
fp
=
(
FItem
)
mmProcessQue
ryQue
ue
,
.
fp
=
(
FItem
)
mmProcessQueue
,
.
param
=
pMgmt
,
};
if
(
tSingleWorkerInit
(
&
pMgmt
->
queryWorker
,
&
qCfg
)
!=
0
)
{
...
...
source/dnode/mgmt/mgmt_qnode/src/qmWorker.c
浏览文件 @
dce19313
...
...
@@ -19,70 +19,39 @@
static
inline
void
qmSendRsp
(
SRpcMsg
*
pMsg
,
int32_t
code
)
{
SRpcMsg
rsp
=
{
.
code
=
code
,
.
info
=
pMsg
->
info
,
.
pCont
=
pMsg
->
info
.
rsp
,
.
contLen
=
pMsg
->
info
.
rspLen
,
.
info
=
pMsg
->
info
,
};
tmsgSendRsp
(
&
rsp
);
}
static
void
qmProcess
Monitor
Queue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
static
void
qmProcessQueue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SQnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
int32_t
code
=
-
1
;
dTrace
(
"msg:%p, get from qnode queue"
,
pMsg
);
dTrace
(
"msg:%p, get from qnode-monitor queue"
,
pMsg
);
SRpcMsg
*
pRpc
=
pMsg
;
int32_t
code
=
-
1
;
if
(
pMsg
->
msgType
==
TDMT_MON_QM_INFO
)
{
code
=
qmProcessGetMonitorInfoReq
(
pMgmt
,
pMsg
);
}
else
{
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
switch
(
pMsg
->
msgType
)
{
case
TDMT_MON_QM_INFO
:
code
=
qmProcessGetMonitorInfoReq
(
pMgmt
,
pMsg
);
break
;
default:
code
=
qndProcessQueryMsg
(
pMgmt
->
pQnode
,
pMsg
);
break
;
}
if
(
pRpc
->
msgType
&
1U
)
{
if
(
IsReq
(
pMsg
)
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
terrno
!=
0
)
code
=
terrno
;
qmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"msg:%p, is freed, code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pRpc
->
pCont
);
taosFreeQitem
(
pMsg
);
}
static
void
qmProcessQueryQueue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SQnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
dTrace
(
"msg:%p, get from qnode-query queue"
,
pMsg
);
SRpcMsg
*
pRpc
=
pMsg
;
int32_t
code
=
qndProcessQueryMsg
(
pMgmt
->
pQnode
,
pRpc
);
if
(
pRpc
->
msgType
&
1U
&&
code
!=
0
)
{
qmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"msg:%p, is freed, code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
static
void
qmProcessFetchQueue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SQnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
dTrace
(
"msg:%p, get from qnode-fetch queue"
,
pMsg
);
SRpcMsg
*
pRpc
=
pMsg
;
int32_t
code
=
qndProcessFetchMsg
(
pMgmt
->
pQnode
,
pRpc
);
if
(
pRpc
->
msgType
&
1U
&&
code
!=
0
)
{
qmSendRsp
(
pMsg
,
code
);
}
dTrace
(
"msg:%p, is freed, code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
static
int32_t
qmPutNodeMsgToWorker
(
SSingleWorker
*
pWorker
,
SRpcMsg
*
pMsg
)
{
dTrace
(
"msg:%p, put into worker %s
"
,
pMsg
,
pWorker
->
name
);
dTrace
(
"msg:%p, put into worker %s
, type:%s"
,
pMsg
,
pWorker
->
name
,
TMSG_INFO
(
pMsg
->
msgType
)
);
taosWriteQitem
(
pWorker
->
queue
,
pMsg
);
return
0
;
}
...
...
@@ -101,9 +70,7 @@ int32_t qmPutNodeMsgToMonitorQueue(SQnodeMgmt *pMgmt, SRpcMsg *pMsg) {
static
int32_t
qmPutRpcMsgToWorker
(
SQnodeMgmt
*
pMgmt
,
SSingleWorker
*
pWorker
,
SRpcMsg
*
pRpc
)
{
SRpcMsg
*
pMsg
=
taosAllocateQitem
(
sizeof
(
SRpcMsg
),
RPC_QITEM
);
if
(
pMsg
==
NULL
)
{
return
-
1
;
}
if
(
pMsg
==
NULL
)
return
-
1
;
dTrace
(
"msg:%p, create and put into worker:%s, type:%s"
,
pMsg
,
pWorker
->
name
,
TMSG_INFO
(
pRpc
->
msgType
));
memcpy
(
pMsg
,
pRpc
,
sizeof
(
SRpcMsg
));
...
...
@@ -141,7 +108,7 @@ int32_t qmStartWorker(SQnodeMgmt *pMgmt) {
.
min
=
tsNumOfVnodeQueryThreads
,
.
max
=
tsNumOfVnodeQueryThreads
,
.
name
=
"qnode-query"
,
.
fp
=
(
FItem
)
qmProcessQue
ryQue
ue
,
.
fp
=
(
FItem
)
qmProcessQueue
,
.
param
=
pMgmt
,
};
...
...
@@ -154,7 +121,7 @@ int32_t qmStartWorker(SQnodeMgmt *pMgmt) {
.
min
=
tsNumOfQnodeFetchThreads
,
.
max
=
tsNumOfQnodeFetchThreads
,
.
name
=
"qnode-fetch"
,
.
fp
=
(
FItem
)
qmProcess
Fetch
Queue
,
.
fp
=
(
FItem
)
qmProcessQueue
,
.
param
=
pMgmt
,
};
...
...
@@ -167,7 +134,7 @@ int32_t qmStartWorker(SQnodeMgmt *pMgmt) {
.
min
=
1
,
.
max
=
1
,
.
name
=
"qnode-monitor"
,
.
fp
=
(
FItem
)
qmProcess
Monitor
Queue
,
.
fp
=
(
FItem
)
qmProcessQueue
,
.
param
=
pMgmt
,
};
if
(
tSingleWorkerInit
(
&
pMgmt
->
monitorWorker
,
&
mCfg
)
!=
0
)
{
...
...
source/dnode/mgmt/mgmt_snode/src/smWorker.c
浏览文件 @
dce19313
...
...
@@ -28,10 +28,8 @@ static inline void smSendRsp(SRpcMsg *pMsg, int32_t code) {
static
void
smProcessMonitorQueue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SSnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
int32_t
code
=
-
1
;
dTrace
(
"msg:%p, get from snode-monitor queue"
,
pMsg
);
SRpcMsg
*
pRpc
=
pMsg
;
int32_t
code
=
-
1
;
if
(
pMsg
->
msgType
==
TDMT_MON_SM_INFO
)
{
code
=
smProcessGetMonitorInfoReq
(
pMgmt
,
pMsg
);
...
...
@@ -39,13 +37,13 @@ static void smProcessMonitorQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
}
if
(
pRpc
->
msgType
&
1U
)
{
if
(
IsReq
(
pMsg
)
)
{
if
(
code
!=
0
&&
terrno
!=
0
)
code
=
terrno
;
smSendRsp
(
pMsg
,
code
);
}
dTrace
(
"msg:%p, is freed, code:0x%x"
,
pMsg
,
code
);
rpcFreeCont
(
p
Rpc
->
pCont
);
rpcFreeCont
(
p
Msg
->
pCont
);
taosFreeQitem
(
pMsg
);
}
...
...
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
浏览文件 @
dce19313
...
...
@@ -29,7 +29,7 @@ static inline void vmSendRsp(SRpcMsg *pMsg, int32_t code) {
tmsgSendRsp
(
&
rsp
);
}
static
void
vmProcess
MgmtMonitor
Queue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
static
void
vmProcessQueue
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SVnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
int32_t
code
=
-
1
;
dTrace
(
"msg:%p, get from vnode queue, type:%s"
,
pMsg
,
TMSG_INFO
(
pMsg
->
msgType
));
...
...
@@ -92,7 +92,7 @@ static void vmProcessFetchQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
static
void
vmProcessWriteQueue
(
SQueueInfo
*
pInfo
,
STaosQall
*
qall
,
int32_t
numOfMsgs
)
{
SVnodeObj
*
pVnode
=
pInfo
->
ahandle
;
SArray
*
pArray
=
taosArrayInit
(
numOfMsgs
,
sizeof
(
SRpcMsg
*
));
SArray
*
pArray
=
taosArrayInit
(
numOfMsgs
,
sizeof
(
SRpcMsg
*
));
if
(
pArray
==
NULL
)
{
dError
(
"failed to process %d msgs in write-queue since %s"
,
numOfMsgs
,
terrstr
());
return
;
...
...
@@ -222,8 +222,7 @@ static void vmProcessMergeQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numO
}
static
int32_t
vmPutNodeMsgToQueue
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
,
EQueueType
qtype
)
{
SRpcMsg
*
pRpc
=
pMsg
;
SMsgHead
*
pHead
=
pRpc
->
pCont
;
SMsgHead
*
pHead
=
pMsg
->
pCont
;
int32_t
code
=
0
;
pHead
->
contLen
=
ntohl
(
pHead
->
contLen
);
...
...
@@ -237,23 +236,23 @@ static int32_t vmPutNodeMsgToQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg, EQueueType
switch
(
qtype
)
{
case
QUERY_QUEUE
:
dTrace
(
"msg:%p, put into vnode-query worker, type:%s"
,
pMsg
,
TMSG_INFO
(
p
Rpc
->
msgType
));
dTrace
(
"msg:%p, put into vnode-query worker, type:%s"
,
pMsg
,
TMSG_INFO
(
p
Msg
->
msgType
));
taosWriteQitem
(
pVnode
->
pQueryQ
,
pMsg
);
break
;
case
FETCH_QUEUE
:
dTrace
(
"msg:%p, put into vnode-fetch worker, type:%s"
,
pMsg
,
TMSG_INFO
(
p
Rpc
->
msgType
));
dTrace
(
"msg:%p, put into vnode-fetch worker, type:%s"
,
pMsg
,
TMSG_INFO
(
p
Msg
->
msgType
));
taosWriteQitem
(
pVnode
->
pFetchQ
,
pMsg
);
break
;
case
WRITE_QUEUE
:
dTrace
(
"msg:%p, put into vnode-write worker, type:%s"
,
pMsg
,
TMSG_INFO
(
p
Rpc
->
msgType
));
dTrace
(
"msg:%p, put into vnode-write worker, type:%s"
,
pMsg
,
TMSG_INFO
(
p
Msg
->
msgType
));
taosWriteQitem
(
pVnode
->
pWriteQ
,
pMsg
);
break
;
case
SYNC_QUEUE
:
dTrace
(
"msg:%p, put into vnode-sync worker, type:%s"
,
pMsg
,
TMSG_INFO
(
p
Rpc
->
msgType
));
dTrace
(
"msg:%p, put into vnode-sync worker, type:%s"
,
pMsg
,
TMSG_INFO
(
p
Msg
->
msgType
));
taosWriteQitem
(
pVnode
->
pSyncQ
,
pMsg
);
break
;
case
MERGE_QUEUE
:
dTrace
(
"msg:%p, put into vnode-merge worker, type:%s"
,
pMsg
,
TMSG_INFO
(
p
Rpc
->
msgType
));
dTrace
(
"msg:%p, put into vnode-merge worker, type:%s"
,
pMsg
,
TMSG_INFO
(
p
Msg
->
msgType
));
taosWriteQitem
(
pVnode
->
pMergeQ
,
pMsg
);
break
;
default:
...
...
@@ -301,7 +300,7 @@ int32_t vmPutNodeMsgToMonitorQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
}
static
int32_t
vmPutRpcMsgToQueue
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
pRpc
,
EQueueType
qtype
)
{
SMsgHead
*
pHead
=
pRpc
->
pCont
;
SMsgHead
*
pHead
=
pRpc
->
pCont
;
SVnodeObj
*
pVnode
=
vmAcquireVnode
(
pMgmt
,
pHead
->
vgId
);
if
(
pVnode
==
NULL
)
return
-
1
;
...
...
@@ -469,7 +468,7 @@ int32_t vmStartWorker(SVnodeMgmt *pMgmt) {
.
min
=
1
,
.
max
=
1
,
.
name
=
"vnode-mgmt"
,
.
fp
=
(
FItem
)
vmProcess
MgmtMonitor
Queue
,
.
fp
=
(
FItem
)
vmProcessQueue
,
.
param
=
pMgmt
,
};
if
(
tSingleWorkerInit
(
&
pMgmt
->
mgmtWorker
,
&
cfg
)
!=
0
)
{
...
...
@@ -481,7 +480,7 @@ int32_t vmStartWorker(SVnodeMgmt *pMgmt) {
.
min
=
1
,
.
max
=
1
,
.
name
=
"vnode-monitor"
,
.
fp
=
(
FItem
)
vmProcess
MgmtMonitor
Queue
,
.
fp
=
(
FItem
)
vmProcessQueue
,
.
param
=
pMgmt
,
};
if
(
tSingleWorkerInit
(
&
pMgmt
->
monitorWorker
,
&
mCfg
)
!=
0
)
{
...
...
source/dnode/mgmt/node_mgmt/inc/dmMgmt.h
浏览文件 @
dce19313
...
...
@@ -137,7 +137,6 @@ SMgmtInputOpt dmBuildMgmtInputOpt(SMgmtWrapper *pWrapper);
void
dmSetStatus
(
SDnode
*
pDnode
,
EDndRunStatus
stype
);
void
dmProcessServerStartupStatus
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
);
void
dmProcessNetTestReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
);
void
dmProcessFetchRsp
(
SRpcMsg
*
pMsg
);
// dmNodes.c
int32_t
dmOpenNode
(
SMgmtWrapper
*
pWrapper
);
...
...
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
浏览文件 @
dce19313
...
...
@@ -314,8 +314,3 @@ void dmProcessServerStartupStatus(SDnode *pDnode, SRpcMsg *pMsg) {
rpcSendResponse
(
&
rsp
);
rpcFreeCont
(
pMsg
->
pCont
);
}
void
dmProcessFetchRsp
(
SRpcMsg
*
pMsg
)
{
qWorkerProcessFetchRsp
(
NULL
,
NULL
,
pMsg
);
// rpcFreeCont(pMsg->pCont);
}
\ No newline at end of file
source/dnode/mgmt/node_mgmt/src/dmTransport.c
浏览文件 @
dce19313
...
...
@@ -15,6 +15,7 @@
#define _DEFAULT_SOURCE
#include "dmMgmt.h"
#include "qworker.h"
static
void
dmSendRedirectRsp
(
SRpcMsg
*
pMsg
,
const
SEpSet
*
pNewEpSet
);
static
void
dmSendRsp
(
SRpcMsg
*
pMsg
);
...
...
@@ -61,7 +62,7 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
dmProcessNetTestReq
(
pDnode
,
pRpc
);
return
;
}
else
if
(
pRpc
->
msgType
==
TDMT_MND_SYSTABLE_RETRIEVE_RSP
||
pRpc
->
msgType
==
TDMT_VND_FETCH_RSP
)
{
dmProcessFetchRsp
(
pRpc
);
qWorkerProcessFetchRsp
(
NULL
,
NULL
,
pRpc
);
return
;
}
else
{
}
...
...
source/dnode/mnode/impl/src/mndBnode.c
浏览文件 @
dce19313
...
...
@@ -304,10 +304,10 @@ static int32_t mndProcessCreateBnodeReq(SRpcMsg *pReq) {
}
code
=
mndCreateBnode
(
pMnode
,
pReq
,
pDnode
,
&
createReq
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"bnode:%d, failed to create since %s"
,
createReq
.
dnodeId
,
terrstr
());
}
...
...
@@ -414,10 +414,10 @@ static int32_t mndProcessDropBnodeReq(SRpcMsg *pReq) {
}
code
=
mndDropBnode
(
pMnode
,
pReq
,
pObj
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"bnode:%d, failed to drop since %s"
,
dropReq
.
dnodeId
,
terrstr
());
}
...
...
source/dnode/mnode/impl/src/mndConsumer.c
浏览文件 @
dce19313
...
...
@@ -511,7 +511,7 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
SUBSCRIBE_OVER
;
}
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
SUBSCRIBE_OVER:
mndTransDrop
(
pTrans
);
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
dce19313
...
...
@@ -525,7 +525,6 @@ static int32_t mndCreateDb(SMnode *pMnode, SRpcMsg *pReq, SCreateDbReq *pCreate,
dbObj
.
cfg
.
numOfRetensions
=
pCreate
->
numOfRetensions
;
dbObj
.
cfg
.
pRetensions
=
pCreate
->
pRetensions
;
pCreate
->
pRetensions
=
NULL
;
mndSetDefaultDbCfg
(
&
dbObj
.
cfg
);
...
...
@@ -605,10 +604,10 @@ static int32_t mndProcessCreateDbReq(SRpcMsg *pReq) {
}
code
=
mndCreateDb
(
pMnode
,
pReq
,
&
createReq
,
pUser
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"db:%s, failed to create since %s"
,
createReq
.
db
,
terrstr
());
}
...
...
@@ -839,10 +838,10 @@ static int32_t mndProcessAlterDbReq(SRpcMsg *pReq) {
dbObj
.
cfgVersion
++
;
dbObj
.
updateTime
=
taosGetTimestampMs
();
code
=
mndAlterDb
(
pMnode
,
pReq
,
pDb
,
&
dbObj
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"db:%s, failed to alter since %s"
,
alterReq
.
db
,
terrstr
());
}
...
...
@@ -1110,10 +1109,10 @@ static int32_t mndProcessDropDbReq(SRpcMsg *pReq) {
}
code
=
mndDropDb
(
pMnode
,
pReq
,
pDb
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"db:%s, failed to drop since %s"
,
dropReq
.
db
,
terrstr
());
}
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
dce19313
...
...
@@ -504,10 +504,10 @@ static int32_t mndProcessCreateDnodeReq(SRpcMsg *pReq) {
}
code
=
mndCreateDnode
(
pMnode
,
pReq
,
&
createReq
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
CREATE_DNODE_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"dnode:%s:%d, failed to create since %s"
,
createReq
.
fqdn
,
createReq
.
port
,
terrstr
());
}
...
...
@@ -585,10 +585,10 @@ static int32_t mndProcessDropDnodeReq(SRpcMsg *pReq) {
}
code
=
mndDropDnode
(
pMnode
,
pReq
,
pDnode
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
DROP_DNODE_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"dnode:%d, failed to drop since %s"
,
dropReq
.
dnodeId
,
terrstr
());
}
...
...
source/dnode/mnode/impl/src/mndFunc.c
浏览文件 @
dce19313
...
...
@@ -330,10 +330,10 @@ static int32_t mndProcessCreateFuncReq(SRpcMsg *pReq) {
}
code
=
mndCreateFunc
(
pMnode
,
pReq
,
&
createReq
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"func:%s, failed to create since %s"
,
createReq
.
name
,
terrstr
());
}
...
...
@@ -386,10 +386,10 @@ static int32_t mndProcessDropFuncReq(SRpcMsg *pReq) {
}
code
=
mndDropFunc
(
pMnode
,
pReq
,
pFunc
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"func:%s, failed to drop since %s"
,
dropReq
.
name
,
terrstr
());
}
...
...
source/dnode/mnode/impl/src/mndMnode.c
浏览文件 @
dce19313
...
...
@@ -402,10 +402,10 @@ static int32_t mndProcessCreateMnodeReq(SRpcMsg *pReq) {
}
code
=
mndCreateMnode
(
pMnode
,
pReq
,
pDnode
,
&
createReq
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"mnode:%d, failed to create since %s"
,
createReq
.
dnodeId
,
terrstr
());
}
...
...
@@ -574,10 +574,10 @@ static int32_t mndProcessDropMnodeReq(SRpcMsg *pReq) {
}
code
=
mndDropMnode
(
pMnode
,
pReq
,
pObj
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"mnode:%d, failed to drop since %s"
,
dropReq
.
dnodeId
,
terrstr
());
}
...
...
source/dnode/mnode/impl/src/mndOffset.c
浏览文件 @
dce19313
...
...
@@ -205,7 +205,7 @@ static int32_t mndProcessCommitOffsetReq(SRpcMsg *pMsg) {
}
mndTransDrop
(
pTrans
);
return
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
return
TSDB_CODE_ACTION_IN_PROGRESS
;
}
static
int32_t
mndOffsetActionInsert
(
SSdb
*
pSdb
,
SMqOffsetObj
*
pOffset
)
{
...
...
source/dnode/mnode/impl/src/mndProfile.c
浏览文件 @
dce19313
...
...
@@ -128,7 +128,8 @@ static SConnObj *mndCreateConn(SMnode *pMnode, const char *user, int8_t connType
}
static
void
mndFreeConn
(
SConnObj
*
pConn
)
{
taosMemoryFreeClear
(
pConn
->
pQueries
);
taosArrayDestroyEx
(
pConn
->
pQueries
,
tFreeClientHbQueryDesc
);
mTrace
(
"conn:%u, is destroyed, data:%p"
,
pConn
->
id
,
pConn
);
}
...
...
@@ -396,6 +397,7 @@ static int32_t mndProcessQueryHeartBeat(SMnode *pMnode, SRpcMsg *pMsg, SClientHb
if
(
NULL
==
hbRsp
.
info
)
{
mError
(
"taosArrayInit %d rsp kv failed"
,
kvNum
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
tFreeClientHbRsp
(
&
hbRsp
);
return
-
1
;
}
...
...
@@ -453,6 +455,7 @@ static int32_t mndProcessHeartBeatReq(SRpcMsg *pReq) {
SClientHbBatchReq
batchReq
=
{
0
};
if
(
tDeserializeSClientHbBatchReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
batchReq
)
!=
0
)
{
taosArrayDestroyEx
(
batchReq
.
reqs
,
tFreeClientHbReq
);
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
}
...
...
@@ -479,18 +482,7 @@ static int32_t mndProcessHeartBeatReq(SRpcMsg *pReq) {
void
*
buf
=
rpcMallocCont
(
tlen
);
tSerializeSClientHbBatchRsp
(
buf
,
tlen
,
&
batchRsp
);
int32_t
rspNum
=
(
int32_t
)
taosArrayGetSize
(
batchRsp
.
rsps
);
for
(
int32_t
i
=
0
;
i
<
rspNum
;
++
i
)
{
SClientHbRsp
*
rsp
=
taosArrayGet
(
batchRsp
.
rsps
,
i
);
int32_t
kvNum
=
(
rsp
->
info
)
?
taosArrayGetSize
(
rsp
->
info
)
:
0
;
for
(
int32_t
n
=
0
;
n
<
kvNum
;
++
n
)
{
SKv
*
kv
=
taosArrayGet
(
rsp
->
info
,
n
);
taosMemoryFreeClear
(
kv
->
value
);
}
taosArrayDestroy
(
rsp
->
info
);
}
taosArrayDestroy
(
batchRsp
.
rsps
);
tFreeClientHbBatchRsp
(
&
batchRsp
);
pReq
->
info
.
rspLen
=
tlen
;
pReq
->
info
.
rsp
=
buf
;
...
...
source/dnode/mnode/impl/src/mndQnode.c
浏览文件 @
dce19313
...
...
@@ -306,10 +306,10 @@ static int32_t mndProcessCreateQnodeReq(SRpcMsg *pReq) {
}
code
=
mndCreateQnode
(
pMnode
,
pReq
,
pDnode
,
&
createReq
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"qnode:%d, failed to create since %s"
,
createReq
.
dnodeId
,
terrstr
());
}
...
...
@@ -416,10 +416,10 @@ static int32_t mndProcessDropQnodeReq(SRpcMsg *pReq) {
}
code
=
mndDropQnode
(
pMnode
,
pReq
,
pObj
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"qnode:%d, failed to drop since %s"
,
dropReq
.
dnodeId
,
terrstr
());
}
...
...
source/dnode/mnode/impl/src/mndQuery.c
浏览文件 @
dce19313
...
...
@@ -18,37 +18,35 @@
#include "mndMnode.h"
#include "qworker.h"
int32_t
mndProcessQueryMsg
(
SRpcMsg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
info
.
node
;
int32_t
mndProcessQueryMsg
(
SRpcMsg
*
pMsg
)
{
int32_t
code
=
-
1
;
SMnode
*
pMnode
=
pMsg
->
info
.
node
;
SReadHandle
handle
=
{.
mnd
=
pMnode
,
.
pMsgCb
=
&
pMnode
->
msgCb
};
mTrace
(
"msg:%p, in query queue is processing"
,
p
Req
);
switch
(
p
Req
->
msgType
)
{
mTrace
(
"msg:%p, in query queue is processing"
,
p
Msg
);
switch
(
p
Msg
->
msgType
)
{
case
TDMT_VND_QUERY
:
return
qWorkerProcessQueryMsg
(
&
handle
,
pMnode
->
pQuery
,
pReq
);
code
=
qWorkerProcessQueryMsg
(
&
handle
,
pMnode
->
pQuery
,
pMsg
);
break
;
case
TDMT_VND_QUERY_CONTINUE
:
return
qWorkerProcessCQueryMsg
(
&
handle
,
pMnode
->
pQuery
,
pReq
);
default:
mError
(
"unknown msg type:%d in query queue"
,
pReq
->
msgType
);
return
TSDB_CODE_VND_APP_ERROR
;
}
}
int32_t
mndProcessFetchMsg
(
SRpcMsg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
info
.
node
;
mTrace
(
"msg:%p, in fetch queue is processing"
,
pMsg
);
switch
(
pMsg
->
msgType
)
{
code
=
qWorkerProcessCQueryMsg
(
&
handle
,
pMnode
->
pQuery
,
pMsg
);
break
;
case
TDMT_VND_FETCH
:
return
qWorkerProcessFetchMsg
(
pMnode
,
pMnode
->
pQuery
,
pMsg
);
code
=
qWorkerProcessFetchMsg
(
pMnode
,
pMnode
->
pQuery
,
pMsg
);
break
;
case
TDMT_VND_DROP_TASK
:
return
qWorkerProcessDropMsg
(
pMnode
,
pMnode
->
pQuery
,
pMsg
);
code
=
qWorkerProcessDropMsg
(
pMnode
,
pMnode
->
pQuery
,
pMsg
);
break
;
case
TDMT_VND_QUERY_HEARTBEAT
:
return
qWorkerProcessHbMsg
(
pMnode
,
pMnode
->
pQuery
,
pMsg
);
code
=
qWorkerProcessHbMsg
(
pMnode
,
pMnode
->
pQuery
,
pMsg
);
break
;
default:
mError
(
"unknown msg type:%d in fetch queue"
,
pMsg
->
msgType
)
;
return
TSDB_CODE_VND_APP_ERROR
;
terrno
=
TSDB_CODE_VND_APP_ERROR
;
mError
(
"unknown msg type:%d in query queue"
,
pMsg
->
msgType
)
;
}
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
return
code
;
}
int32_t
mndInitQuery
(
SMnode
*
pMnode
)
{
...
...
@@ -59,9 +57,9 @@ int32_t mndInitQuery(SMnode *pMnode) {
mndSetMsgHandle
(
pMnode
,
TDMT_VND_QUERY
,
mndProcessQueryMsg
);
mndSetMsgHandle
(
pMnode
,
TDMT_VND_QUERY_CONTINUE
,
mndProcessQueryMsg
);
mndSetMsgHandle
(
pMnode
,
TDMT_VND_FETCH
,
mndProcess
Fetch
Msg
);
mndSetMsgHandle
(
pMnode
,
TDMT_VND_DROP_TASK
,
mndProcess
Fetch
Msg
);
mndSetMsgHandle
(
pMnode
,
TDMT_VND_QUERY_HEARTBEAT
,
mndProcess
Fetch
Msg
);
mndSetMsgHandle
(
pMnode
,
TDMT_VND_FETCH
,
mndProcess
Query
Msg
);
mndSetMsgHandle
(
pMnode
,
TDMT_VND_DROP_TASK
,
mndProcess
Query
Msg
);
mndSetMsgHandle
(
pMnode
,
TDMT_VND_QUERY_HEARTBEAT
,
mndProcess
Query
Msg
);
return
0
;
}
...
...
source/dnode/mnode/impl/src/mndSma.c
浏览文件 @
dce19313
...
...
@@ -562,10 +562,10 @@ static int32_t mndProcessMCreateSmaReq(SRpcMsg *pReq) {
}
code
=
mndCreateSma
(
pMnode
,
pReq
,
&
createReq
,
pDb
,
pStb
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"sma:%s, failed to create since %s"
,
createReq
.
name
,
terrstr
(
terrno
));
}
...
...
@@ -706,10 +706,10 @@ static int32_t mndProcessMDropSmaReq(SRpcMsg *pReq) {
}
code
=
mndDropSma
(
pMnode
,
pReq
,
pDb
,
pSma
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"sma:%s, failed to drop since %s"
,
dropReq
.
name
,
terrstr
());
}
...
...
source/dnode/mnode/impl/src/mndSnode.c
浏览文件 @
dce19313
...
...
@@ -312,10 +312,10 @@ static int32_t mndProcessCreateSnodeReq(SRpcMsg *pReq) {
}
code
=
mndCreateSnode
(
pMnode
,
pReq
,
pDnode
,
&
createReq
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"snode:%d, failed to create since %s"
,
createReq
.
dnodeId
,
terrstr
());
return
-
1
;
}
...
...
@@ -424,10 +424,10 @@ static int32_t mndProcessDropSnodeReq(SRpcMsg *pReq) {
}
code
=
mndDropSnode
(
pMnode
,
pReq
,
pObj
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"snode:%d, failed to drop since %s"
,
dropReq
.
dnodeId
,
terrstr
());
}
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
dce19313
...
...
@@ -827,10 +827,10 @@ static int32_t mndProcessMCreateStbReq(SRpcMsg *pReq) {
}
code
=
mndCreateStb
(
pMnode
,
pReq
,
&
createReq
,
pDb
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"stb:%s, failed to create since %s"
,
createReq
.
name
,
terrstr
());
}
...
...
@@ -1334,10 +1334,10 @@ static int32_t mndProcessMAlterStbReq(SRpcMsg *pReq) {
}
code
=
mndAlterStb
(
pMnode
,
pReq
,
&
alterReq
,
pDb
,
pStb
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"stb:%s, failed to alter since %s"
,
alterReq
.
name
,
terrstr
());
}
...
...
@@ -1475,10 +1475,10 @@ static int32_t mndProcessMDropStbReq(SRpcMsg *pReq) {
}
code
=
mndDropStb
(
pMnode
,
pReq
,
pDb
,
pStb
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"stb:%s, failed to drop since %s"
,
dropReq
.
name
,
terrstr
());
}
...
...
@@ -1642,6 +1642,8 @@ int32_t mndValidateStbInfo(SMnode *pMnode, SSTableMetaVersion *pStbVersions, int
if
(
pStbVersion
->
sversion
!=
metaRsp
.
sversion
)
{
taosArrayPush
(
batchMetaRsp
.
pArray
,
&
metaRsp
);
}
else
{
tFreeSTableMetaRsp
(
&
metaRsp
);
}
}
...
...
@@ -1660,6 +1662,7 @@ int32_t mndValidateStbInfo(SMnode *pMnode, SSTableMetaVersion *pStbVersions, int
}
tSerializeSTableMetaBatchRsp
(
pRsp
,
rspLen
,
&
batchMetaRsp
);
tFreeSTableMetaBatchRsp
(
&
batchMetaRsp
);
*
ppRsp
=
pRsp
;
*
pRspLen
=
rspLen
;
return
0
;
...
...
source/dnode/mnode/impl/src/mndStream.c
浏览文件 @
dce19313
...
...
@@ -472,10 +472,10 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) {
}
code
=
mndCreateStream
(
pMnode
,
pReq
,
&
createStreamReq
,
pDb
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
CREATE_STREAM_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"stream:%s, failed to create since %s"
,
createStreamReq
.
name
,
terrstr
());
}
...
...
source/dnode/mnode/impl/src/mndTopic.c
浏览文件 @
dce19313
...
...
@@ -457,10 +457,10 @@ static int32_t mndProcessCreateTopicReq(SRpcMsg *pReq) {
}
code
=
mndCreateTopic
(
pMnode
,
pReq
,
&
createTopicReq
,
pDb
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
CREATE_TOPIC_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"topic:%s, failed to create since %s"
,
createTopicReq
.
name
,
terrstr
());
}
...
...
@@ -547,7 +547,7 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) {
return
-
1
;
}
return
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
return
TSDB_CODE_ACTION_IN_PROGRESS
;
}
static
int32_t
mndProcessDropTopicInRsp
(
SRpcMsg
*
pRsp
)
{
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
dce19313
...
...
@@ -1035,13 +1035,13 @@ static int32_t mndTransExecuteActions(SMnode *pMnode, STrans *pTrans, SArray *pA
}
}
else
{
mDebug
(
"trans:%d, %d of %d actions executed"
,
pTrans
->
id
,
numOfReceived
,
numOfActions
);
return
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
return
TSDB_CODE_ACTION_IN_PROGRESS
;
}
}
static
int32_t
mndTransExecuteRedoActions
(
SMnode
*
pMnode
,
STrans
*
pTrans
)
{
int32_t
code
=
mndTransExecuteActions
(
pMnode
,
pTrans
,
pTrans
->
redoActions
);
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"failed to execute redoActions since:%s, code:0x%x"
,
terrstr
(),
terrno
);
}
return
code
;
...
...
@@ -1049,7 +1049,7 @@ static int32_t mndTransExecuteRedoActions(SMnode *pMnode, STrans *pTrans) {
static
int32_t
mndTransExecuteUndoActions
(
SMnode
*
pMnode
,
STrans
*
pTrans
)
{
int32_t
code
=
mndTransExecuteActions
(
pMnode
,
pTrans
,
pTrans
->
undoActions
);
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"failed to execute undoActions since %s"
,
terrstr
());
}
return
code
;
...
...
@@ -1088,7 +1088,7 @@ static bool mndTransPerformRedoActionStage(SMnode *pMnode, STrans *pTrans) {
pTrans
->
stage
=
TRN_STAGE_COMMIT
;
mDebug
(
"trans:%d, stage from redoAction to commit"
,
pTrans
->
id
);
continueExec
=
true
;
}
else
if
(
code
==
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
}
else
if
(
code
==
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mDebug
(
"trans:%d, stage keep on redoAction since %s"
,
pTrans
->
id
,
tstrerror
(
code
));
continueExec
=
false
;
}
else
{
...
...
@@ -1176,7 +1176,7 @@ static bool mndTransPerformUndoActionStage(SMnode *pMnode, STrans *pTrans) {
pTrans
->
stage
=
TRN_STAGE_UNDO_LOG
;
mDebug
(
"trans:%d, stage from undoAction to undoLog"
,
pTrans
->
id
);
continueExec
=
true
;
}
else
if
(
code
==
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
}
else
if
(
code
==
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mDebug
(
"trans:%d, stage keep on undoAction since %s"
,
pTrans
->
id
,
tstrerror
(
code
));
continueExec
=
false
;
}
else
{
...
...
source/dnode/mnode/impl/src/mndUser.c
浏览文件 @
dce19313
...
...
@@ -331,10 +331,10 @@ static int32_t mndProcessCreateUserReq(SRpcMsg *pReq) {
}
code
=
mndCreateUser
(
pMnode
,
pOperUser
->
acct
,
&
createReq
,
pReq
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"user:%s, failed to create since %s"
,
createReq
.
user
,
terrstr
());
}
...
...
@@ -536,10 +536,10 @@ static int32_t mndProcessAlterUserReq(SRpcMsg *pReq) {
}
code
=
mndAlterUser
(
pMnode
,
pUser
,
&
newUser
,
pReq
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"user:%s, failed to alter since %s"
,
alterReq
.
user
,
terrstr
());
}
...
...
@@ -613,10 +613,10 @@ static int32_t mndProcessDropUserReq(SRpcMsg *pReq) {
}
code
=
mndDropUser
(
pMnode
,
pReq
,
pUser
);
if
(
code
==
0
)
code
=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"user:%s, failed to drop since %s"
,
dropReq
.
user
,
terrstr
());
}
...
...
source/dnode/mnode/impl/src/mnode.c
浏览文件 @
dce19313
...
...
@@ -367,7 +367,7 @@ int32_t mndProcessMsg(SRpcMsg *pMsg) {
}
int32_t
code
=
(
*
fp
)(
pMsg
);
if
(
code
==
TSDB_CODE_
MND_
ACTION_IN_PROGRESS
)
{
if
(
code
==
TSDB_CODE_ACTION_IN_PROGRESS
)
{
terrno
=
code
;
mTrace
(
"msg:%p, in progress, app:%p"
,
pMsg
,
ahandle
);
}
else
if
(
code
!=
0
)
{
...
...
source/dnode/qnode/src/qnode.c
浏览文件 @
dce19313
...
...
@@ -43,44 +43,49 @@ void qndClose(SQnode *pQnode) {
int32_t
qndGetLoad
(
SQnode
*
pQnode
,
SQnodeLoad
*
pLoad
)
{
return
0
;
}
int32_t
qndProcessQueryMsg
(
SQnode
*
pQnode
,
SRpcMsg
*
pMsg
)
{
qTrace
(
"message in qnode query queue is processing"
)
;
int32_t
code
=
-
1
;
SReadHandle
handle
=
{.
pMsgCb
=
&
pQnode
->
msgCb
};
qTrace
(
"message in qnode queue is processing"
);
switch
(
pMsg
->
msgType
)
{
case
TDMT_VND_QUERY
:
{
return
qWorkerProcessQueryMsg
(
&
handle
,
pQnode
->
pQuery
,
pMsg
);
}
case
TDMT_VND_QUERY
:
code
=
qWorkerProcessQueryMsg
(
&
handle
,
pQnode
->
pQuery
,
pMsg
);
break
;
case
TDMT_VND_QUERY_CONTINUE
:
return
qWorkerProcessCQueryMsg
(
&
handle
,
pQnode
->
pQuery
,
pMsg
);
default:
qError
(
"unknown msg type:%d in query queue"
,
pMsg
->
msgType
);
return
TSDB_CODE_VND_APP_ERROR
;
}
}
int32_t
qndProcessFetchMsg
(
SQnode
*
pQnode
,
SRpcMsg
*
pMsg
)
{
qTrace
(
"message in fetch queue is processing"
);
switch
(
pMsg
->
msgType
)
{
code
=
qWorkerProcessCQueryMsg
(
&
handle
,
pQnode
->
pQuery
,
pMsg
);
break
;
case
TDMT_VND_FETCH
:
return
qWorkerProcessFetchMsg
(
pQnode
,
pQnode
->
pQuery
,
pMsg
);
code
=
qWorkerProcessFetchMsg
(
pQnode
,
pQnode
->
pQuery
,
pMsg
);
break
;
case
TDMT_VND_FETCH_RSP
:
return
qWorkerProcessFetchRsp
(
pQnode
,
pQnode
->
pQuery
,
pMsg
);
code
=
qWorkerProcessFetchRsp
(
pQnode
,
pQnode
->
pQuery
,
pMsg
);
break
;
case
TDMT_VND_RES_READY
:
return
qWorkerProcessReadyMsg
(
pQnode
,
pQnode
->
pQuery
,
pMsg
);
code
=
qWorkerProcessReadyMsg
(
pQnode
,
pQnode
->
pQuery
,
pMsg
);
break
;
case
TDMT_VND_TASKS_STATUS
:
return
qWorkerProcessStatusMsg
(
pQnode
,
pQnode
->
pQuery
,
pMsg
);
code
=
qWorkerProcessStatusMsg
(
pQnode
,
pQnode
->
pQuery
,
pMsg
);
break
;
case
TDMT_VND_CANCEL_TASK
:
return
qWorkerProcessCancelMsg
(
pQnode
,
pQnode
->
pQuery
,
pMsg
);
code
=
qWorkerProcessCancelMsg
(
pQnode
,
pQnode
->
pQuery
,
pMsg
);
break
;
case
TDMT_VND_DROP_TASK
:
return
qWorkerProcessDropMsg
(
pQnode
,
pQnode
->
pQuery
,
pMsg
);
code
=
qWorkerProcessDropMsg
(
pQnode
,
pQnode
->
pQuery
,
pMsg
);
break
;
case
TDMT_VND_TABLE_META
:
// return vnodeGetTableMeta(pQnode, pMsg);
// code = vnodeGetTableMeta(pQnode, pMsg);
// break;
case
TDMT_VND_CONSUME
:
// return tqProcessConsumeReq(pQnode->pTq, pMsg);
// code = tqProcessConsumeReq(pQnode->pTq, pMsg);
// break;
case
TDMT_VND_QUERY_HEARTBEAT
:
return
qWorkerProcessHbMsg
(
pQnode
,
pQnode
->
pQuery
,
pMsg
);
code
=
qWorkerProcessHbMsg
(
pQnode
,
pQnode
->
pQuery
,
pMsg
);
break
;
default:
qError
(
"unknown msg type:%d in
fetch
queue"
,
pMsg
->
msgType
);
return
TSDB_CODE_VND_APP_ERROR
;
qError
(
"unknown msg type:%d in
qnode
queue"
,
pMsg
->
msgType
);
terrno
=
TSDB_CODE_VND_APP_ERROR
;
}
if
(
code
==
0
)
return
TSDB_CODE_ACTION_IN_PROGRESS
;
return
code
;
}
source/dnode/vnode/src/meta/metaEntry.c
浏览文件 @
dce19313
...
...
@@ -56,8 +56,8 @@ int metaDecodeEntry(SDecoder *pCoder, SMetaEntry *pME) {
if
(
tDecodeCStr
(
pCoder
,
&
pME
->
name
)
<
0
)
return
-
1
;
if
(
pME
->
type
==
TSDB_SUPER_TABLE
)
{
if
(
tDecodeSSchemaWrapper
(
pCoder
,
&
pME
->
stbEntry
.
schema
)
<
0
)
return
-
1
;
if
(
tDecodeSSchemaWrapper
(
pCoder
,
&
pME
->
stbEntry
.
schemaTag
)
<
0
)
return
-
1
;
if
(
tDecodeSSchemaWrapper
Ex
(
pCoder
,
&
pME
->
stbEntry
.
schema
)
<
0
)
return
-
1
;
if
(
tDecodeSSchemaWrapper
Ex
(
pCoder
,
&
pME
->
stbEntry
.
schemaTag
)
<
0
)
return
-
1
;
}
else
if
(
pME
->
type
==
TSDB_CHILD_TABLE
)
{
if
(
tDecodeI64
(
pCoder
,
&
pME
->
ctbEntry
.
ctime
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pCoder
,
&
pME
->
ctbEntry
.
ttlDays
)
<
0
)
return
-
1
;
...
...
@@ -67,7 +67,7 @@ int metaDecodeEntry(SDecoder *pCoder, SMetaEntry *pME) {
if
(
tDecodeI64
(
pCoder
,
&
pME
->
ntbEntry
.
ctime
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pCoder
,
&
pME
->
ntbEntry
.
ttlDays
)
<
0
)
return
-
1
;
if
(
tDecodeI32v
(
pCoder
,
&
pME
->
ntbEntry
.
ncid
)
<
0
)
return
-
1
;
if
(
tDecodeSSchemaWrapper
(
pCoder
,
&
pME
->
ntbEntry
.
schema
)
<
0
)
return
-
1
;
if
(
tDecodeSSchemaWrapper
Ex
(
pCoder
,
&
pME
->
ntbEntry
.
schema
)
<
0
)
return
-
1
;
}
else
if
(
pME
->
type
==
TSDB_TSMA_TABLE
)
{
pME
->
smaEntry
.
tsma
=
tDecoderMalloc
(
pCoder
,
sizeof
(
STSma
));
if
(
!
pME
->
smaEntry
.
tsma
)
{
...
...
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
dce19313
...
...
@@ -562,7 +562,8 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
// search table.db
TBC
*
pTbDbc
=
NULL
;
SDecoder
dc
=
{
0
};
SDecoder
dc1
=
{
0
};
SDecoder
dc2
=
{
0
};
/* get ctbEntry */
tdbTbcOpen
(
pMeta
->
pTbDb
,
&
pTbDbc
,
&
pMeta
->
txn
);
...
...
@@ -572,18 +573,16 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
ctbEntry
.
pBuf
=
taosMemoryMalloc
(
nData
);
memcpy
(
ctbEntry
.
pBuf
,
pData
,
nData
);
tDecoderInit
(
&
dc
,
ctbEntry
.
pBuf
,
nData
);
metaDecodeEntry
(
&
dc
,
&
ctbEntry
);
tDecoderClear
(
&
dc
);
tDecoderInit
(
&
dc1
,
ctbEntry
.
pBuf
,
nData
);
metaDecodeEntry
(
&
dc1
,
&
ctbEntry
);
/* get stbEntry*/
tdbTbGet
(
pMeta
->
pUidIdx
,
&
ctbEntry
.
ctbEntry
.
suid
,
sizeof
(
tb_uid_t
),
&
pVal
,
&
nVal
);
tdbTbGet
(
pMeta
->
pTbDb
,
&
((
STbDbKey
){.
uid
=
ctbEntry
.
ctbEntry
.
suid
,
.
version
=
*
(
int64_t
*
)
pVal
}),
sizeof
(
STbDbKey
),
(
void
**
)
&
stbEntry
.
pBuf
,
&
nVal
);
tdbFree
(
pVal
);
tDecoderInit
(
&
dc
,
stbEntry
.
pBuf
,
nVal
);
metaDecodeEntry
(
&
dc
,
&
stbEntry
);
tDecoderClear
(
&
dc
);
tDecoderInit
(
&
dc2
,
stbEntry
.
pBuf
,
nVal
);
metaDecodeEntry
(
&
dc2
,
&
stbEntry
);
SSchemaWrapper
*
pTagSchema
=
&
stbEntry
.
stbEntry
.
schemaTag
;
SSchema
*
pColumn
=
NULL
;
...
...
@@ -638,6 +637,8 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
// save to uid.idx
tdbTbUpsert
(
pMeta
->
pUidIdx
,
&
ctbEntry
.
uid
,
sizeof
(
tb_uid_t
),
&
version
,
sizeof
(
version
),
&
pMeta
->
txn
);
tDecoderClear
(
&
dc1
);
tDecoderClear
(
&
dc2
);
if
(
ctbEntry
.
pBuf
)
taosMemoryFree
(
ctbEntry
.
pBuf
);
if
(
stbEntry
.
pBuf
)
tdbFree
(
stbEntry
.
pBuf
);
tdbTbcClose
(
pTbDbc
);
...
...
@@ -645,6 +646,8 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
return
0
;
_err:
tDecoderClear
(
&
dc1
);
tDecoderClear
(
&
dc2
);
if
(
ctbEntry
.
pBuf
)
taosMemoryFree
(
ctbEntry
.
pBuf
);
if
(
stbEntry
.
pBuf
)
tdbFree
(
stbEntry
.
pBuf
);
tdbTbcClose
(
pTbDbc
);
...
...
source/dnode/vnode/src/sma/smaOpen.c
浏览文件 @
dce19313
...
...
@@ -132,6 +132,7 @@ int32_t smaClose(SSma *pSma) {
if
SMA_RSMA_TSDB0
(
pSma
)
tsdbClose
(
&
SMA_RSMA_TSDB0
(
pSma
));
if
SMA_RSMA_TSDB1
(
pSma
)
tsdbClose
(
&
SMA_RSMA_TSDB1
(
pSma
));
if
SMA_RSMA_TSDB2
(
pSma
)
tsdbClose
(
&
SMA_RSMA_TSDB2
(
pSma
));
taosMemoryFree
(
pSma
);
}
return
0
;
}
\ No newline at end of file
source/dnode/vnode/src/tq/tq.c
浏览文件 @
dce19313
...
...
@@ -57,6 +57,9 @@ STQ* tqOpen(const char* path, SVnode* pVnode, SWal* pWal) {
void
tqClose
(
STQ
*
pTq
)
{
if
(
pTq
)
{
taosMemoryFreeClear
(
pTq
->
path
);
taosHashCleanup
(
pTq
->
execs
);
taosHashCleanup
(
pTq
->
pStreamTasks
);
taosHashCleanup
(
pTq
->
pushMgr
);
taosMemoryFree
(
pTq
);
}
// TODO
...
...
@@ -409,9 +412,9 @@ int32_t tqDeserializeConsumer(STQ* pTq, const STqSerializedHead* pHead, STqConsu
pTopic
->
buffer
.
output
[
j
].
status
=
0
;
STqReadHandle
*
pReadHandle
=
tqInitSubmitMsgScanner
(
pTq
->
pVnode
->
pMeta
);
SReadHandle
handle
=
{
.
reader
=
pReadHandle
,
.
meta
=
pTq
->
pVnode
->
pMeta
,
.
pMsgCb
=
&
pTq
->
pVnode
->
msgCb
,
.
reader
=
pReadHandle
,
.
meta
=
pTq
->
pVnode
->
pMeta
,
.
pMsgCb
=
&
pTq
->
pVnode
->
msgCb
,
};
pTopic
->
buffer
.
output
[
j
].
pReadHandle
=
pReadHandle
;
pTopic
->
buffer
.
output
[
j
].
task
=
qCreateStreamExecTaskInfo
(
pTopic
->
qmsg
,
&
handle
);
...
...
@@ -1000,10 +1003,10 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int32_t parallel) {
for
(
int32_t
i
=
0
;
i
<
parallel
;
i
++
)
{
STqReadHandle
*
pStreamReader
=
tqInitSubmitMsgScanner
(
pTq
->
pVnode
->
pMeta
);
SReadHandle
handle
=
{
.
reader
=
pStreamReader
,
.
meta
=
pTq
->
pVnode
->
pMeta
,
.
pMsgCb
=
&
pTq
->
pVnode
->
msgCb
,
.
vnode
=
pTq
->
pVnode
,
.
reader
=
pStreamReader
,
.
meta
=
pTq
->
pVnode
->
pMeta
,
.
pMsgCb
=
&
pTq
->
pVnode
->
msgCb
,
.
vnode
=
pTq
->
pVnode
,
};
pTask
->
exec
.
runners
[
i
].
inputHandle
=
pStreamReader
;
pTask
->
exec
.
runners
[
i
].
executor
=
qCreateStreamExecTaskInfo
(
pTask
->
exec
.
qmsg
,
&
handle
);
...
...
source/dnode/vnode/src/tsdb/tsdbCommit.c
浏览文件 @
dce19313
...
...
@@ -477,6 +477,7 @@ static int tsdbCreateCommitIters(SCommitH *pCommith) {
pCommitIter
->
pTable
->
pSchema
=
pTSchema
;
// metaGetTbTSchema(REPO_META(pRepo), pTbData->uid, 0);
}
}
tSkipListDestroyIter
(
pSlIter
);
return
0
;
}
...
...
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
dce19313
...
...
@@ -147,9 +147,6 @@ _err:
int
vnodeProcessQueryMsg
(
SVnode
*
pVnode
,
SRpcMsg
*
pMsg
)
{
vTrace
(
"message in vnode query queue is processing"
);
#if 0
SReadHandle handle = {.reader = pVnode->pTsdb, .meta = pVnode->pMeta, .config = &pVnode->config, .vnode = pVnode, .pMsgCb = &pVnode->msgCb};
#endif
SReadHandle
handle
=
{.
meta
=
pVnode
->
pMeta
,
.
config
=
&
pVnode
->
config
,
.
vnode
=
pVnode
,
.
pMsgCb
=
&
pVnode
->
msgCb
};
switch
(
pMsg
->
msgType
)
{
case
TDMT_VND_QUERY
:
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
dce19313
...
...
@@ -2784,6 +2784,8 @@ int32_t catalogRemoveTableMeta(SCatalog *pCtg, const SName *pTableName) {
CTG_ERR_JRET
(
ctgPushRmTblMsgInQueue
(
pCtg
,
dbFName
,
dbId
,
pTableName
->
tname
,
true
));
}
ctgDebug
(
"table meta %s.%s removed"
,
dbFName
,
pTableName
->
tname
);
_return:
taosMemoryFreeClear
(
tblMeta
);
...
...
@@ -2958,7 +2960,11 @@ int32_t catalogChkTbMetaVersion(SCatalog *pCtg, void *pTrans, const SEpSet *pMgm
int32_t
sver
=
0
;
int32_t
tbNum
=
taosArrayGetSize
(
pTables
);
for
(
int32_t
i
=
0
;
i
<
tbNum
;
++
i
)
{
STbSVersion
*
pTb
=
(
STbSVersion
*
)
taosArrayGet
(
pTables
,
i
);
STbSVersion
*
pTb
=
(
STbSVersion
*
)
taosArrayGet
(
pTables
,
i
);
if
(
NULL
==
pTb
->
tbFName
||
0
==
pTb
->
tbFName
[
0
])
{
continue
;
}
tNameFromString
(
&
name
,
pTb
->
tbFName
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
if
(
CTG_IS_SYS_DBNAME
(
name
.
dbname
))
{
...
...
source/libs/parser/src/parInsert.c
浏览文件 @
dce19313
...
...
@@ -827,7 +827,7 @@ static int32_t parseTagsClause(SInsertParseContext* pCxt, SSchema* pSchema, uint
SKVRow
row
=
tdGetKVRowFromBuilder
(
&
pCxt
->
tagsBuilder
);
if
(
NULL
==
row
)
{
return
buildInvalidOperationMsg
(
&
pCxt
->
msg
,
"
tag value expected
"
);
return
buildInvalidOperationMsg
(
&
pCxt
->
msg
,
"
out of memory
"
);
}
tdSortKVRowByColIdx
(
row
);
...
...
@@ -1085,6 +1085,10 @@ static int32_t parseInsertBody(SInsertParseContext* pCxt) {
// no data in the sql string anymore.
if
(
sToken
.
n
==
0
)
{
if
(
sToken
.
type
&&
pCxt
->
pSql
[
0
])
{
return
buildSyntaxErrMsg
(
&
pCxt
->
msg
,
"invalid charactor in SQL"
,
sToken
.
z
);
}
if
(
0
==
pCxt
->
totalNum
&&
(
!
TSDB_QUERY_HAS_TYPE
(
pCxt
->
pOutput
->
insertType
,
TSDB_QUERY_TYPE_STMT_INSERT
)))
{
return
buildInvalidOperationMsg
(
&
pCxt
->
msg
,
"no data in sql"
);
}
...
...
@@ -1347,7 +1351,7 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, char* tN
SKVRow
row
=
tdGetKVRowFromBuilder
(
&
tagBuilder
);
if
(
NULL
==
row
)
{
tdDestroyKVRowBuilder
(
&
tagBuilder
);
return
buildInvalidOperationMsg
(
&
pBuf
,
"
tag value expected
"
);
return
buildInvalidOperationMsg
(
&
pBuf
,
"
out of memory
"
);
}
tdSortKVRowByColIdx
(
row
);
...
...
@@ -1696,7 +1700,7 @@ static int32_t smlBuildTagRow(SArray* cols, SKVRowBuilder* tagsBuilder, SParsedD
*
row
=
tdGetKVRowFromBuilder
(
tagsBuilder
);
if
(
*
row
==
NULL
)
{
return
TSDB_CODE_
SML_INVALID_DATA
;
return
TSDB_CODE_
OUT_OF_MEMORY
;
}
tdSortKVRowByColIdx
(
*
row
);
return
TSDB_CODE_SUCCESS
;
...
...
source/libs/parser/src/parTokenizer.c
浏览文件 @
dce19313
...
...
@@ -704,6 +704,7 @@ SToken tStrGetToken(const char* str, int32_t* i, bool isPrevOptr) {
if
(
t0
.
type
==
TK_NK_SEMI
)
{
t0
.
n
=
0
;
t0
.
type
=
0
;
return
t0
;
}
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
dce19313
...
...
@@ -725,7 +725,11 @@ void qwSaveTbVersionInfo(qTaskInfo_t pTaskInfo, SQWTaskCtx *ctx) {
qGetQueriedTableSchemaVersion
(
pTaskInfo
,
dbFName
,
tbName
,
&
ctx
->
tbInfo
.
sversion
,
&
ctx
->
tbInfo
.
tversion
);
sprintf
(
ctx
->
tbInfo
.
tbFName
,
"%s.%s"
,
dbFName
,
tbName
);
if
(
dbFName
[
0
]
&&
tbName
[
0
])
{
sprintf
(
ctx
->
tbInfo
.
tbFName
,
"%s.%s"
,
dbFName
,
tbName
);
}
else
{
ctx
->
tbInfo
.
tbFName
[
0
]
=
0
;
}
}
int32_t
qwHandlePrePhaseEvents
(
QW_FPARAMS_DEF
,
int8_t
phase
,
SQWPhaseInput
*
input
,
SQWPhaseOutput
*
output
)
{
...
...
source/libs/stream/src/tstreamUpdate.c
浏览文件 @
dce19313
...
...
@@ -17,21 +17,20 @@
#include "ttime.h"
#define DEFAULT_FALSE_POSITIVE 0.01
#define DEFAULT_BUCKET_SIZE 1024
#define ROWS_PER_MILLISECOND 1
#define MAX_NUM_SCALABLE_BF 120
#define MIN_NUM_SCALABLE_BF 10
#define DEFAULT_PREADD_BUCKET 1
#define MAX_INTERVAL MILLISECOND_PER_MINUTE
#define MIN_INTERVAL (MILLISECOND_PER_SECOND * 10)
#define DEFAULT_BUCKET_SIZE
1024
#define ROWS_PER_MILLISECOND
1
#define MAX_NUM_SCALABLE_BF
120
#define MIN_NUM_SCALABLE_BF
10
#define DEFAULT_PREADD_BUCKET
1
#define MAX_INTERVAL
MILLISECOND_PER_MINUTE
#define MIN_INTERVAL
(MILLISECOND_PER_SECOND * 10)
static
void
windowSBfAdd
(
SUpdateInfo
*
pInfo
,
uint64_t
count
)
{
if
(
pInfo
->
numSBFs
<
count
)
{
if
(
pInfo
->
numSBFs
<
count
)
{
count
=
pInfo
->
numSBFs
;
}
for
(
uint64_t
i
=
0
;
i
<
count
;
++
i
)
{
SScalableBf
*
tsSBF
=
tScalableBfInit
(
pInfo
->
interval
*
ROWS_PER_MILLISECOND
,
DEFAULT_FALSE_POSITIVE
);
SScalableBf
*
tsSBF
=
tScalableBfInit
(
pInfo
->
interval
*
ROWS_PER_MILLISECOND
,
DEFAULT_FALSE_POSITIVE
);
taosArrayPush
(
pInfo
->
pTsSBFs
,
&
tsSBF
);
}
}
...
...
@@ -76,7 +75,7 @@ static int64_t adjustWatermark(int64_t interval, int32_t watermark) {
return
watermark
;
}
SUpdateInfo
*
updateInfoInitP
(
SInterval
*
pInterval
,
int64_t
watermark
)
{
SUpdateInfo
*
updateInfoInitP
(
SInterval
*
pInterval
,
int64_t
watermark
)
{
return
updateInfoInit
(
pInterval
->
interval
,
pInterval
->
precision
,
watermark
);
}
...
...
@@ -93,7 +92,7 @@ SUpdateInfo *updateInfoInit(int64_t interval, int32_t precision, int64_t waterma
uint64_t
bfSize
=
(
uint64_t
)(
pInfo
->
watermark
/
pInfo
->
interval
);
pInfo
->
pTsSBFs
=
taosArrayInit
(
bfSize
,
sizeof
(
SScalableBf
));
pInfo
->
pTsSBFs
=
taosArrayInit
(
bfSize
,
sizeof
(
void
*
));
if
(
pInfo
->
pTsSBFs
==
NULL
)
{
updateInfoDestroy
(
pInfo
);
return
NULL
;
...
...
@@ -108,14 +107,14 @@ SUpdateInfo *updateInfoInit(int64_t interval, int32_t precision, int64_t waterma
}
TSKEY
dumy
=
0
;
for
(
uint64_t
i
=
0
;
i
<
DEFAULT_BUCKET_SIZE
;
++
i
)
{
for
(
uint64_t
i
=
0
;
i
<
DEFAULT_BUCKET_SIZE
;
++
i
)
{
taosArrayPush
(
pInfo
->
pTsBuckets
,
&
dumy
);
}
pInfo
->
numBuckets
=
DEFAULT_BUCKET_SIZE
;
return
pInfo
;
}
static
SScalableBf
*
getSBf
(
SUpdateInfo
*
pInfo
,
TSKEY
ts
)
{
static
SScalableBf
*
getSBf
(
SUpdateInfo
*
pInfo
,
TSKEY
ts
)
{
if
(
ts
<=
0
)
{
return
NULL
;
}
...
...
@@ -131,24 +130,23 @@ static SScalableBf* getSBf(SUpdateInfo *pInfo, TSKEY ts) {
}
SScalableBf
*
res
=
taosArrayGetP
(
pInfo
->
pTsSBFs
,
index
);
if
(
res
==
NULL
)
{
res
=
tScalableBfInit
(
pInfo
->
interval
*
ROWS_PER_MILLISECOND
,
DEFAULT_FALSE_POSITIVE
);
res
=
tScalableBfInit
(
pInfo
->
interval
*
ROWS_PER_MILLISECOND
,
DEFAULT_FALSE_POSITIVE
);
taosArrayPush
(
pInfo
->
pTsSBFs
,
&
res
);
}
return
res
;
}
bool
updateInfoIsUpdated
(
SUpdateInfo
*
pInfo
,
tb_uid_t
tableId
,
TSKEY
ts
)
{
int32_t
res
=
TSDB_CODE_FAILED
;
uint64_t
index
=
((
uint64_t
)
tableId
)
%
pInfo
->
numBuckets
;
SScalableBf
*
pSBf
=
getSBf
(
pInfo
,
ts
);
int32_t
res
=
TSDB_CODE_FAILED
;
uint64_t
index
=
((
uint64_t
)
tableId
)
%
pInfo
->
numBuckets
;
SScalableBf
*
pSBf
=
getSBf
(
pInfo
,
ts
);
// pSBf may be a null pointer
if
(
pSBf
)
{
res
=
tScalableBfPut
(
pSBf
,
&
ts
,
sizeof
(
TSKEY
));
}
TSKEY
maxTs
=
*
(
TSKEY
*
)
taosArrayGet
(
pInfo
->
pTsBuckets
,
index
);
if
(
maxTs
<
ts
)
{
if
(
maxTs
<
ts
)
{
taosArraySet
(
pInfo
->
pTsBuckets
,
index
,
&
ts
);
return
false
;
}
...
...
@@ -159,7 +157,7 @@ bool updateInfoIsUpdated(SUpdateInfo *pInfo, tb_uid_t tableId, TSKEY ts) {
return
false
;
}
//check from tsdb api
//
check from tsdb api
return
true
;
}
...
...
@@ -174,7 +172,7 @@ void updateInfoDestroy(SUpdateInfo *pInfo) {
SScalableBf
*
pSBF
=
taosArrayGetP
(
pInfo
->
pTsSBFs
,
i
);
tScalableBfDestroy
(
pSBF
);
}
taosArrayDestroy
(
pInfo
->
pTsSBFs
);
taosMemoryFree
(
pInfo
);
}
\ No newline at end of file
}
source/util/src/terror.c
浏览文件 @
dce19313
...
...
@@ -134,7 +134,6 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TSC_STMT_CLAUSE_ERROR, "not supported stmt cl
// mnode-common
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_APP_ERROR
,
"Mnode internal error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NOT_READY
,
"Mnode not ready"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_ACTION_IN_PROGRESS
,
"Message is progressing"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NO_RIGHTS
,
"Insufficient privilege for operation"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_CONNECTION
,
"Invalid message connection"
)
...
...
tests/script/api/batchprepare.c
浏览文件 @
dce19313
...
...
@@ -1825,10 +1825,12 @@ int queryColumnTest(TAOS_STMT *stmt, TAOS *taos) {
if
(
bpBindParam
(
stmt
,
data
.
pBind
+
n
*
gCurCase
->
bindColNum
))
{
exit
(
1
);
}
if
(
taos_stmt_add_batch
(
stmt
))
{
printf
(
"!!!taos_stmt_add_batch error:%s
\n
"
,
taos_stmt_errstr
(
stmt
));
exit
(
1
);
if
(
rand
()
%
2
==
0
)
{
if
(
taos_stmt_add_batch
(
stmt
))
{
printf
(
"!!!taos_stmt_add_batch error:%s
\n
"
,
taos_stmt_errstr
(
stmt
));
exit
(
1
);
}
}
if
(
taos_stmt_execute
(
stmt
)
!=
0
)
{
...
...
@@ -1871,10 +1873,12 @@ int queryMiscTest(TAOS_STMT *stmt, TAOS *taos) {
if
(
bpBindParam
(
stmt
,
data
.
pBind
+
n
*
gCurCase
->
bindColNum
))
{
exit
(
1
);
}
if
(
taos_stmt_add_batch
(
stmt
))
{
printf
(
"!!!taos_stmt_add_batch error:%s
\n
"
,
taos_stmt_errstr
(
stmt
));
exit
(
1
);
if
(
rand
()
%
2
==
0
)
{
if
(
taos_stmt_add_batch
(
stmt
))
{
printf
(
"!!!taos_stmt_add_batch error:%s
\n
"
,
taos_stmt_errstr
(
stmt
));
exit
(
1
);
}
}
if
(
taos_stmt_execute
(
stmt
)
!=
0
)
{
...
...
tests/script/jenkins/basic.txt
浏览文件 @
dce19313
...
...
@@ -28,6 +28,7 @@
./test.sh -f tsim/insert/basic1.sim
./test.sh -f tsim/insert/backquote.sim
./test.sh -f tsim/insert/null.sim
./test.sh -f tsim/insert/update0.sim
# ---- parser
./test.sh -f tsim/parser/groupby-basic.sim
...
...
tests/script/tsim/stable/metrics.sim
浏览文件 @
dce19313
...
...
@@ -28,15 +28,17 @@ if $rows != 1 then
return -1
endi
print =============== step2
sql drop table $mt
sql show stables
if $rows != 0 then
return -1
endi
#TODO OPEN THIS WHEN STABLE DELETE WORKS
#print =============== step2
#sql drop table $mt
#sql show stables
#if $rows != 0 then
# return -1
#endi
print =============== step3
sql create table $mt (ts timestamp, speed int) TAGS(sp int)
#print =============== step3
#sql create table $mt (ts timestamp, speed int) TAGS(sp int)
#TODO OPEN THIS WHEN STABLE DELETE WORKS
sql show stables
if $rows != 1 then
...
...
@@ -134,4 +136,4 @@ if $rows != 2 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
tests/script/tsim/valgrind/basic.sim
0 → 100644
浏览文件 @
dce19313
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create database d0 vgroups 1;
system sh/exec.sh -n dnode1 -s stop -x SIGINT
tests/system-test/0-others/udfTest.py
浏览文件 @
dce19313
...
...
@@ -14,7 +14,7 @@ class TDTestCase:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
())
tdSql
.
init
(
conn
.
cursor
()
,
logSql
)
def
getBuildPath
(
self
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
...
...
tests/tsim/src/simSystem.c
浏览文件 @
dce19313
...
...
@@ -98,6 +98,8 @@ SScript *simProcessCallOver(SScript *script) {
return
NULL
;
}
if
(
simScriptPos
==
-
1
)
return
NULL
;
return
simScriptList
[
simScriptPos
];
}
else
{
simDebug
(
"script:%s, is stopped"
,
script
->
fileName
);
...
...
tools/shell/src/shellEngine.c
浏览文件 @
dce19313
...
...
@@ -742,6 +742,7 @@ void shellReadHistory() {
int32_t
read_size
=
0
;
while
((
read_size
=
taosGetLineFile
(
pFile
,
&
line
))
!=
-
1
)
{
line
[
read_size
-
1
]
=
'\0'
;
taosMemoryFree
(
pHistory
->
hist
[
pHistory
->
hend
]);
pHistory
->
hist
[
pHistory
->
hend
]
=
strdup
(
line
);
pHistory
->
hend
=
(
pHistory
->
hend
+
1
)
%
SHELL_MAX_HISTORY_SIZE
;
...
...
@@ -763,7 +764,8 @@ void shellWriteHistory() {
for
(
int32_t
i
=
pHistory
->
hstart
;
i
!=
pHistory
->
hend
;)
{
if
(
pHistory
->
hist
[
i
]
!=
NULL
)
{
taosFprintfFile
(
pFile
,
"%s
\n
"
,
pHistory
->
hist
[
i
]);
taosMemoryFreeClear
(
pHistory
->
hist
[
i
]);
taosMemoryFree
(
pHistory
->
hist
[
i
]);
pHistory
->
hist
[
i
]
=
NULL
;
}
i
=
(
i
+
1
)
%
SHELL_MAX_HISTORY_SIZE
;
}
...
...
@@ -771,6 +773,16 @@ void shellWriteHistory() {
taosCloseFile
(
&
pFile
);
}
void
shellCleanupHistory
()
{
SShellHistory
*
pHistory
=
&
shell
.
history
;
for
(
int32_t
i
=
0
;
i
<
SHELL_MAX_HISTORY_SIZE
;
++
i
)
{
if
(
pHistory
->
hist
[
i
]
!=
NULL
)
{
taosMemoryFree
(
pHistory
->
hist
[
i
]);
pHistory
->
hist
[
i
]
=
NULL
;
}
}
}
void
shellPrintError
(
TAOS_RES
*
tres
,
int64_t
st
)
{
int64_t
et
=
taosGetTimestampUs
();
fprintf
(
stderr
,
"
\n
DB error: %s (%.6fs)
\n
"
,
taos_errstr
(
tres
),
(
et
-
st
)
/
1E6
);
...
...
@@ -971,6 +983,7 @@ int32_t shellExecute() {
taos_close
(
shell
.
conn
);
shellWriteHistory
();
shellCleanupHistory
();
return
0
;
}
...
...
@@ -996,5 +1009,6 @@ int32_t shellExecute() {
taosThreadClear
(
&
shell
.
pid
);
}
shellCleanupHistory
();
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录