Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e8e11190
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
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看板
提交
e8e11190
编写于
6月 06, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'feature/3_liaohj' of github.com:taosdata/TDengine into feature/3_liaohj
上级
6c719eef
a59f40dd
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
54 addition
and
46 deletion
+54
-46
source/client/inc/clientInt.h
source/client/inc/clientInt.h
+3
-5
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+0
-1
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+16
-12
source/client/src/clientMain.c
source/client/src/clientMain.c
+1
-2
source/client/src/clientMsgHandler.c
source/client/src/clientMsgHandler.c
+19
-16
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+15
-9
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+0
-1
未找到文件。
source/client/inc/clientInt.h
浏览文件 @
e8e11190
...
...
@@ -45,7 +45,7 @@ extern "C" {
#define ERROR_MSG_BUF_DEFAULT_SIZE 512
#define HEARTBEAT_INTERVAL 1500 // ms
#define SYNC_ON_TOP_OF_ASYNC
1
#define SYNC_ON_TOP_OF_ASYNC
0
enum
{
RES_TYPE__QUERY
=
1
,
...
...
@@ -266,8 +266,8 @@ extern SAppInfo appInfo;
extern
int32_t
clientReqRefPool
;
extern
int32_t
clientConnRefPool
;
extern
int
(
*
handleRequestRspFp
[
TDMT_MAX
])(
void
*
,
const
SDataBuf
*
pMsg
,
int32_t
cod
e
);
int
genericRspCallback
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
);
__async_send_cb_fn_t
getMsgRspHandle
(
int32_t
msgTyp
e
);
SMsgSendInfo
*
buildMsgInfoImpl
(
SRequestObj
*
pReqObj
);
void
*
createTscObj
(
const
char
*
user
,
const
char
*
auth
,
const
char
*
db
,
int32_t
connType
,
SAppInstInfo
*
pAppInfo
);
...
...
@@ -293,8 +293,6 @@ void* openTransporter(const char* user, const char* auth, int32_t numOfThreads);
bool
persistConnForSpecificMsg
(
void
*
parenct
,
tmsg_t
msgType
);
void
processMsgFromServer
(
void
*
parent
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
);
void
initMsgHandleFp
();
TAOS
*
taos_connect_internal
(
const
char
*
ip
,
const
char
*
user
,
const
char
*
pass
,
const
char
*
auth
,
const
char
*
db
,
uint16_t
port
,
int
connType
);
...
...
source/client/src/clientEnv.c
浏览文件 @
e8e11190
...
...
@@ -278,7 +278,6 @@ void taos_init_imp(void) {
return
;
}
initMsgHandleFp
();
initQueryModuleMsgHandle
();
rpcInit
();
...
...
source/client/src/clientImpl.c
浏览文件 @
e8e11190
...
...
@@ -535,19 +535,20 @@ int32_t handleAlterTbExecRes(void* res, SCatalog* pCatalog) {
return
catalogUpdateTableMeta
(
pCatalog
,
(
STableMetaRsp
*
)
res
);
}
int32_t
handle
ExecRes
(
SRequestObj
*
pRequest
)
{
int32_t
handle
QueryExecRsp
(
SRequestObj
*
pRequest
)
{
if
(
NULL
==
pRequest
->
body
.
resInfo
.
execRes
.
res
)
{
return
TSDB_CODE_SUCCESS
;
}
int32_t
code
=
0
;
SCatalog
*
pCatalog
=
NULL
;
code
=
catalogGetHandle
(
pRequest
->
pTscObj
->
pAppInfo
->
clusterId
,
&
pCatalog
);
SAppInstInfo
*
pAppInfo
=
getAppInfo
(
pRequest
);
int32_t
code
=
catalogGetHandle
(
pAppInfo
->
clusterId
,
&
pCatalog
);
if
(
code
)
{
return
code
;
}
SEpSet
epset
=
getEpSet_s
(
&
p
Request
->
pTscObj
->
p
AppInfo
->
mgmtEp
);
SEpSet
epset
=
getEpSet_s
(
&
pAppInfo
->
mgmtEp
);
SQueryExecRes
*
pRes
=
&
pRequest
->
body
.
resInfo
.
execRes
;
switch
(
pRes
->
msgType
)
{
...
...
@@ -565,8 +566,9 @@ int32_t handleExecRes(SRequestObj* pRequest) {
break
;
}
default:
tscError
(
"invalid exec result for request type %d"
,
pRequest
->
type
);
return
TSDB_CODE_APP_ERROR
;
tscError
(
"0x%"
PRIx64
", invalid exec result for request type %d, reqId:0x%"
PRIx64
,
pRequest
->
self
,
pRequest
->
type
,
pRequest
->
requestId
);
code
=
TSDB_CODE_APP_ERROR
;
}
return
code
;
...
...
@@ -578,13 +580,18 @@ void schedulerExecCb(SQueryResult* pResult, void* param, int32_t code) {
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
if
(
code
!=
TSDB_CODE_SUCCESS
&&
NEED_CLIENT_HANDLE_ERROR
(
code
))
{
// todo do nothing in clear value in request
tscDebug
(
"0x%"
PRIx64
" client retry to handle the error, code:%s, reqId:0x%"
PRIx64
,
pRequest
->
self
,
tstrerror
(
code
),
pRequest
->
requestId
);
pRequest
->
prevCode
=
code
;
doAsyncQuery
(
pRequest
,
true
);
return
;
}
if
(
code
==
TSDB_CODE_SUCCESS
)
{
code
=
handleQueryExecRsp
(
pRequest
);
ASSERT
(
pRequest
->
code
==
TSDB_CODE_SUCCESS
);
pRequest
->
code
=
code
;
}
if
(
NEED_CLIENT_RM_TBLMETA_REQ
(
pRequest
->
type
))
{
removeMeta
(
pTscObj
,
pRequest
->
tableList
);
}
...
...
@@ -623,7 +630,7 @@ SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQue
qDestroyQuery
(
pQuery
);
}
handle
ExecRes
(
pRequest
);
handle
QueryExecRsp
(
pRequest
);
if
(
NULL
!=
pRequest
&&
TSDB_CODE_SUCCESS
!=
code
)
{
pRequest
->
code
=
terrno
;
...
...
@@ -688,9 +695,6 @@ void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
schedulerAsyncExecJob
(
pAppInfo
->
pTransporter
,
pNodeList
,
pRequest
->
body
.
pDag
,
&
pRequest
->
body
.
queryJob
,
pRequest
->
sqlstr
,
pRequest
->
metric
.
start
,
schedulerExecCb
,
pRequest
);
// if (NULL != pRes) {
// code = validateSversion(pRequest, pRes);
// }
}
//todo not to be released here
...
...
@@ -884,7 +888,7 @@ static SMsgSendInfo* buildConnectMsg(SRequestObj* pRequest) {
pMsgSendInfo
->
requestObjRefId
=
pRequest
->
self
;
pMsgSendInfo
->
requestId
=
pRequest
->
requestId
;
pMsgSendInfo
->
fp
=
handleRequestRspFp
[
TMSG_INDEX
(
pMsgSendInfo
->
msgType
)]
;
pMsgSendInfo
->
fp
=
getMsgRspHandle
(
pMsgSendInfo
->
msgType
)
;
pMsgSendInfo
->
param
=
pRequest
;
SConnectReq
connectReq
=
{
0
};
...
...
source/client/src/clientMain.c
浏览文件 @
e8e11190
...
...
@@ -634,7 +634,7 @@ void retrieveMetaCallback(SMetaData* pResultMeta, void* param, int32_t code) {
// return to app directly
taosMemoryFree
(
pWrapper
);
tscError
(
"0x%"
PRIx64
" error occurs, code:%s, return to user app, reqId:%"
PRIx64
,
pRequest
->
self
,
tstrerror
(
code
),
tscError
(
"0x%"
PRIx64
" error occurs, code:%s, return to user app, reqId:
0x
%"
PRIx64
,
pRequest
->
self
,
tstrerror
(
code
),
pRequest
->
requestId
);
pRequest
->
code
=
code
;
pRequest
->
body
.
queryFp
(
pRequest
->
body
.
param
,
pRequest
,
code
);
...
...
@@ -748,7 +748,6 @@ void doAsyncQuery(SRequestObj* pRequest, bool updateMetaForce) {
pRequest
->
body
.
queryFp
(
pRequest
->
body
.
param
,
pRequest
,
code
);
}
static
void
fetchCallback
(
void
*
pResult
,
void
*
param
,
int32_t
code
)
{
SRequestObj
*
pRequest
=
(
SRequestObj
*
)
param
;
...
...
source/client/src/clientMsgHandler.c
浏览文件 @
e8e11190
...
...
@@ -21,8 +21,6 @@
#include "tdef.h"
#include "tname.h"
int32_t
(
*
handleRequestRspFp
[
TDMT_MAX
])(
void
*
,
const
SDataBuf
*
pMsg
,
int32_t
code
);
static
void
setErrno
(
SRequestObj
*
pRequest
,
int32_t
code
)
{
pRequest
->
code
=
code
;
terrno
=
code
;
...
...
@@ -107,10 +105,7 @@ SMsgSendInfo* buildMsgInfoImpl(SRequestObj* pRequest) {
assert
(
pRequest
!=
NULL
);
pMsgSendInfo
->
msgInfo
=
pRequest
->
body
.
requestMsg
;
pMsgSendInfo
->
fp
=
(
handleRequestRspFp
[
TMSG_INDEX
(
pRequest
->
type
)]
==
NULL
)
?
genericRspCallback
:
handleRequestRspFp
[
TMSG_INDEX
(
pRequest
->
type
)];
pMsgSendInfo
->
fp
=
getMsgRspHandle
(
pRequest
->
type
);
return
pMsgSendInfo
;
}
...
...
@@ -209,7 +204,7 @@ int32_t processUseDbRsp(void* param, const SDataBuf* pMsg, int32_t code) {
return
0
;
}
int32_t
processCreateTableRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
int32_t
processCreate
S
TableRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
assert
(
pMsg
!=
NULL
&&
param
!=
NULL
);
SRequestObj
*
pRequest
=
param
;
...
...
@@ -285,13 +280,21 @@ int32_t processAlterStbRsp(void* param, const SDataBuf* pMsg, int32_t code) {
return
code
;
}
// todo refactor: this arraylist is too large
void
initMsgHandleFp
()
{
handleRequestRspFp
[
TMSG_INDEX
(
TDMT_MND_CONNECT
)]
=
processConnectRsp
;
handleRequestRspFp
[
TMSG_INDEX
(
TDMT_MND_CREATE_DB
)]
=
processCreateDbRsp
;
handleRequestRspFp
[
TMSG_INDEX
(
TDMT_MND_USE_DB
)]
=
processUseDbRsp
;
handleRequestRspFp
[
TMSG_INDEX
(
TDMT_MND_CREATE_STB
)]
=
processCreateTableRsp
;
handleRequestRspFp
[
TMSG_INDEX
(
TDMT_MND_DROP_DB
)]
=
processDropDbRsp
;
handleRequestRspFp
[
TMSG_INDEX
(
TDMT_MND_ALTER_STB
)]
=
processAlterStbRsp
;
__async_send_cb_fn_t
getMsgRspHandle
(
int32_t
msgType
)
{
switch
(
msgType
)
{
case
TDMT_MND_CONNECT
:
return
processConnectRsp
;
case
TDMT_MND_CREATE_DB
:
return
processCreateDbRsp
;
case
TDMT_MND_USE_DB
:
return
processUseDbRsp
;
case
TDMT_MND_CREATE_STB
:
return
processCreateSTableRsp
;
case
TDMT_MND_DROP_DB
:
return
processDropDbRsp
;
case
TDMT_MND_ALTER_STB
:
return
processAlterStbRsp
;
default:
return
genericRspCallback
;
}
}
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
e8e11190
...
...
@@ -1497,19 +1497,25 @@ char *buildRetension(SArray *pRetension) {
int64_t
v1
=
getValOfDiffPrecision
(
p
->
freqUnit
,
p
->
freq
);
int64_t
v2
=
getValOfDiffPrecision
(
p
->
keepUnit
,
p
->
keep
);
len
+=
sprintf
(
p1
+
len
,
"%"
PRId64
"%c:%"
PRId64
"%c
,
"
,
v1
,
p
->
freqUnit
,
v2
,
p
->
keepUnit
);
len
+=
sprintf
(
p1
+
len
,
"%"
PRId64
"%c:%"
PRId64
"%c"
,
v1
,
p
->
freqUnit
,
v2
,
p
->
keepUnit
);
p
=
taosArrayGet
(
pRetension
,
1
);
if
(
size
>
1
)
{
len
+=
sprintf
(
p1
+
len
,
","
);
p
=
taosArrayGet
(
pRetension
,
1
);
v1
=
getValOfDiffPrecision
(
p
->
freqUnit
,
p
->
freq
);
v2
=
getValOfDiffPrecision
(
p
->
keepUnit
,
p
->
keep
);
len
+=
sprintf
(
p1
+
len
,
"%"
PRId64
"%c:%"
PRId64
"%c,"
,
v1
,
p
->
freqUnit
,
v2
,
p
->
keepUnit
);
v1
=
getValOfDiffPrecision
(
p
->
freqUnit
,
p
->
freq
);
v2
=
getValOfDiffPrecision
(
p
->
keepUnit
,
p
->
keep
);
len
+=
sprintf
(
p1
+
len
,
"%"
PRId64
"%c:%"
PRId64
"%c"
,
v1
,
p
->
freqUnit
,
v2
,
p
->
keepUnit
);
}
p
=
taosArrayGet
(
pRetension
,
2
);
if
(
size
>
2
)
{
len
+=
sprintf
(
p1
+
len
,
","
);
p
=
taosArrayGet
(
pRetension
,
2
);
v1
=
getValOfDiffPrecision
(
p
->
freqUnit
,
p
->
freq
);
v2
=
getValOfDiffPrecision
(
p
->
keepUnit
,
p
->
keep
);
len
+=
sprintf
(
p1
+
len
,
"%"
PRId64
"%c:%"
PRId64
"%c"
,
v1
,
p
->
freqUnit
,
v2
,
p
->
keepUnit
);
v1
=
getValOfDiffPrecision
(
p
->
freqUnit
,
p
->
freq
);
v2
=
getValOfDiffPrecision
(
p
->
keepUnit
,
p
->
keep
);
len
+=
sprintf
(
p1
+
len
,
"%"
PRId64
"%c:%"
PRId64
"%c"
,
v1
,
p
->
freqUnit
,
v2
,
p
->
keepUnit
);
}
varDataSetLen
(
p1
,
len
);
return
p1
;
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
e8e11190
...
...
@@ -2903,7 +2903,6 @@ static int32_t buildRollupAst(STranslateContext* pCxt, SCreateTableStmt* pStmt,
}
}
taosArrayDestroy
(
dbCfg
.
pRetensions
);
return
code
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录