Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
66dd7d7e
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
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看板
提交
66dd7d7e
编写于
8月 10, 2022
作者:
J
jiacy-jcy
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' into 3.0test/jcy
上级
8152a769
d5e3fb73
变更
19
展开全部
显示空白变更内容
内联
并排
Showing
19 changed file
with
224 addition
and
288 deletion
+224
-288
cmake/cmake.install
cmake/cmake.install
+1
-0
cmake/cmake.platform
cmake/cmake.platform
+2
-2
docs/zh/10-deployment/03-k8s.md
docs/zh/10-deployment/03-k8s.md
+131
-178
docs/zh/25-application/_03-immigrate.md
docs/zh/25-application/_03-immigrate.md
+0
-0
include/libs/transport/trpc.h
include/libs/transport/trpc.h
+2
-3
include/os/osSystem.h
include/os/osSystem.h
+1
-0
include/util/tdef.h
include/util/tdef.h
+1
-1
packaging/release.bat
packaging/release.bat
+4
-4
source/libs/sync/src/syncReplication.c
source/libs/sync/src/syncReplication.c
+2
-1
source/libs/transport/inc/transComm.h
source/libs/transport/inc/transComm.h
+3
-13
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+26
-12
source/libs/transport/src/transComm.c
source/libs/transport/src/transComm.c
+12
-54
source/libs/transport/src/transSvr.c
source/libs/transport/src/transSvr.c
+1
-2
source/libs/transport/test/svrBench.c
source/libs/transport/test/svrBench.c
+8
-9
source/os/src/osSemaphore.c
source/os/src/osSemaphore.c
+4
-3
source/os/src/osSysinfo.c
source/os/src/osSysinfo.c
+11
-1
source/os/src/osSystem.c
source/os/src/osSystem.c
+10
-0
source/util/src/tref.c
source/util/src/tref.c
+3
-3
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+2
-2
未找到文件。
cmake/cmake.install
浏览文件 @
66dd7d7e
...
@@ -22,6 +22,7 @@ ELSEIF (TD_WINDOWS)
...
@@ -22,6 +22,7 @@ ELSEIF (TD_WINDOWS)
INSTALL
(
FILES
$
{
EXECUTABLE_OUTPUT_PATH
}
/
taos
.
exe
DESTINATION
.
)
INSTALL
(
FILES
$
{
EXECUTABLE_OUTPUT_PATH
}
/
taos
.
exe
DESTINATION
.
)
INSTALL
(
FILES
$
{
EXECUTABLE_OUTPUT_PATH
}
/
taosd
.
exe
DESTINATION
.
)
INSTALL
(
FILES
$
{
EXECUTABLE_OUTPUT_PATH
}
/
taosd
.
exe
DESTINATION
.
)
INSTALL
(
FILES
$
{
EXECUTABLE_OUTPUT_PATH
}
/
udfd
.
exe
DESTINATION
.
)
INSTALL
(
FILES
$
{
EXECUTABLE_OUTPUT_PATH
}
/
udfd
.
exe
DESTINATION
.
)
INSTALL
(
FILES
$
{
EXECUTABLE_OUTPUT_PATH
}
/
taosBenchmark
.
exe
DESTINATION
.
)
IF
(
TD_MVN_INSTALLED
)
IF
(
TD_MVN_INSTALLED
)
INSTALL
(
FILES
$
{
LIBRARY_OUTPUT_PATH
}
/
taos
-
jdbcdriver
-
2.0.38
-
dist
.
jar
DESTINATION
connector
/
jdbc
)
INSTALL
(
FILES
$
{
LIBRARY_OUTPUT_PATH
}
/
taos
-
jdbcdriver
-
2.0.38
-
dist
.
jar
DESTINATION
connector
/
jdbc
)
...
...
cmake/cmake.platform
浏览文件 @
66dd7d7e
...
@@ -97,13 +97,13 @@ IF ("${CPUTYPE}" STREQUAL "")
...
@@ -97,13 +97,13 @@ IF ("${CPUTYPE}" STREQUAL "")
ELSE ()
ELSE ()
# if generate ARM version:
# if generate ARM version:
# cmake -DCPUTYPE=aarch32 .. or cmake -DCPUTYPE=aarch64
# cmake -DCPUTYPE=aarch32 .. or cmake -DCPUTYPE=aarch64
IF (${CPUTYPE} MATCHES "aarch32"
or
${CPUTYPE} MATCHES "arm32")
IF (${CPUTYPE} MATCHES "aarch32"
OR
${CPUTYPE} MATCHES "arm32")
SET(PLATFORM_ARCH_STR "arm")
SET(PLATFORM_ARCH_STR "arm")
MESSAGE(STATUS "input cpuType: aarch32")
MESSAGE(STATUS "input cpuType: aarch32")
ADD_DEFINITIONS("-D_TD_ARM_")
ADD_DEFINITIONS("-D_TD_ARM_")
ADD_DEFINITIONS("-D_TD_ARM_32")
ADD_DEFINITIONS("-D_TD_ARM_32")
SET(TD_ARM_32 TRUE)
SET(TD_ARM_32 TRUE)
ELSEIF (${CPUTYPE} MATCHES "aarch64"
or
${CPUTYPE} MATCHES "arm64")
ELSEIF (${CPUTYPE} MATCHES "aarch64"
OR
${CPUTYPE} MATCHES "arm64")
SET(PLATFORM_ARCH_STR "arm64")
SET(PLATFORM_ARCH_STR "arm64")
MESSAGE(STATUS "input cpuType: aarch64")
MESSAGE(STATUS "input cpuType: aarch64")
ADD_DEFINITIONS("-D_TD_ARM_")
ADD_DEFINITIONS("-D_TD_ARM_")
...
...
docs/zh/10-deployment/03-k8s.md
浏览文件 @
66dd7d7e
此差异已折叠。
点击以展开。
docs/zh/25-application/03-immigrate.md
→
docs/zh/25-application/
_
03-immigrate.md
浏览文件 @
66dd7d7e
文件已移动
include/libs/transport/trpc.h
浏览文件 @
66dd7d7e
...
@@ -47,8 +47,6 @@ typedef struct SRpcHandleInfo {
...
@@ -47,8 +47,6 @@ typedef struct SRpcHandleInfo {
int8_t
persistHandle
;
// persist handle or not
int8_t
persistHandle
;
// persist handle or not
int8_t
hasEpSet
;
int8_t
hasEpSet
;
STraceId
traceId
;
// app info
// app info
void
*
ahandle
;
// app handle set by client
void
*
ahandle
;
// app handle set by client
void
*
wrapper
;
// wrapper handle
void
*
wrapper
;
// wrapper handle
...
@@ -58,7 +56,8 @@ typedef struct SRpcHandleInfo {
...
@@ -58,7 +56,8 @@ typedef struct SRpcHandleInfo {
void
*
rsp
;
void
*
rsp
;
int32_t
rspLen
;
int32_t
rspLen
;
// conn info
STraceId
traceId
;
SRpcConnInfo
conn
;
SRpcConnInfo
conn
;
}
SRpcHandleInfo
;
}
SRpcHandleInfo
;
...
...
include/os/osSystem.h
浏览文件 @
66dd7d7e
...
@@ -32,6 +32,7 @@ extern "C" {
...
@@ -32,6 +32,7 @@ extern "C" {
typedef
struct
TdCmd
*
TdCmdPtr
;
typedef
struct
TdCmd
*
TdCmdPtr
;
TdCmdPtr
taosOpenCmd
(
const
char
*
cmd
);
TdCmdPtr
taosOpenCmd
(
const
char
*
cmd
);
int64_t
taosGetsCmd
(
TdCmdPtr
pCmd
,
int32_t
maxSize
,
char
*
__restrict
buf
);
int64_t
taosGetLineCmd
(
TdCmdPtr
pCmd
,
char
**
__restrict
ptrBuf
);
int64_t
taosGetLineCmd
(
TdCmdPtr
pCmd
,
char
**
__restrict
ptrBuf
);
int32_t
taosEOFCmd
(
TdCmdPtr
pCmd
);
int32_t
taosEOFCmd
(
TdCmdPtr
pCmd
);
int64_t
taosCloseCmd
(
TdCmdPtr
*
ppCmd
);
int64_t
taosCloseCmd
(
TdCmdPtr
*
ppCmd
);
...
...
include/util/tdef.h
浏览文件 @
66dd7d7e
...
@@ -396,7 +396,7 @@ typedef enum ELogicConditionType {
...
@@ -396,7 +396,7 @@ typedef enum ELogicConditionType {
#ifdef WINDOWS
#ifdef WINDOWS
#define TSDB_MAX_RPC_THREADS 4 // windows pipe only support 4 connections.
#define TSDB_MAX_RPC_THREADS 4 // windows pipe only support 4 connections.
#else
#else
#define TSDB_MAX_RPC_THREADS
5
#define TSDB_MAX_RPC_THREADS
10
#endif
#endif
#define TSDB_QUERY_TYPE_NON_TYPE 0x00u // none type
#define TSDB_QUERY_TYPE_NON_TYPE 0x00u // none type
...
...
packaging/release.bat
浏览文件 @
66dd7d7e
...
@@ -11,13 +11,13 @@ if !%2==! GOTO USAGE
...
@@ -11,13 +11,13 @@ if !%2==! GOTO USAGE
if
"
%
1"
==
"cluster"
(
if
"
%
1"
==
"cluster"
(
set
work_dir
=
%internal_dir%
set
work_dir
=
%internal_dir%
set
packagServerName_x64
=
TDengine
-enterprise-server
-
%
2
-beta-Windows-x
64
set
packagServerName_x64
=
TDengine
-enterprise-server
-
%
2
-beta-Windows-x
64
set
packagServerName_x86
=
TDengine
-enterprise-server
-
%
2
-beta-Windows-x
86
@REM
set packagServerName_x86=TDengine-enterprise-server-%2-beta-Windows-x86
set
packagClientName_x64
=
TDengine
-enterprise-client
-
%
2
-beta-Windows-x
64
set
packagClientName_x64
=
TDengine
-enterprise-client
-
%
2
-beta-Windows-x
64
set
packagClientName_x86
=
TDengine
-enterprise-client
-
%
2
-beta-Windows-x
86
set
packagClientName_x86
=
TDengine
-enterprise-client
-
%
2
-beta-Windows-x
86
)
else
(
)
else
(
set
work_dir
=
%community_dir%
set
work_dir
=
%community_dir%
set
packagServerName_x64
=
TDengine
-server
-
%
2
-Windows-x
64
set
packagServerName_x64
=
TDengine
-server
-
%
2
-Windows-x
64
set
packagServerName_x86
=
TDengine
-server
-
%
2
-Windows-x
86
@REM
set packagServerName_x86=TDengine-server-%2-Windows-x86
set
packagClientName_x64
=
TDengine
-client
-
%
2
-Windows-x
64
set
packagClientName_x64
=
TDengine
-client
-
%
2
-Windows-x
64
set
packagClientName_x86
=
TDengine
-client
-
%
2
-Windows-x
86
set
packagClientName_x86
=
TDengine
-client
-
%
2
-Windows-x
86
)
)
...
@@ -59,8 +59,8 @@ rd /s /Q C:\TDengine
...
@@ -59,8 +59,8 @@ rd /s /Q C:\TDengine
cmake
--install
.
cmake
--install
.
if
not
%errorlevel%
==
0
(
call
:RUNFAILED
build
x86
failed
&
exit
/b
1
)
if
not
%errorlevel%
==
0
(
call
:RUNFAILED
build
x86
failed
&
exit
/b
1
)
cd
%package_dir%
cd
%package_dir%
iscc
/DMyAppInstallName
=
"
%packagServerName
_x86
%
"
/DMyAppVersion
=
"
%
2"
/DMyAppExcludeSource
=
""
tools
\tdengine.iss
/O
..\release
@REM
iscc /DMyAppInstallName="%packagServerName_x86%" /DMyAppVersion="%2" /DMyAppExcludeSource="" tools\tdengine.iss /O..\release
if
not
%errorlevel%
==
0
(
call
:RUNFAILED
package
%packagServerName
_x86
%
failed
&
exit
/b
1
)
@REM
if not %errorlevel% == 0 ( call :RUNFAILED package %packagServerName_x86% failed & exit /b 1)
iscc
/DMyAppInstallName
=
"
%packagClientName
_x86
%
"
/DMyAppVersion
=
"
%
2"
/DMyAppExcludeSource
=
"taosd.exe"
tools
\tdengine.iss
/O
..\release
iscc
/DMyAppInstallName
=
"
%packagClientName
_x86
%
"
/DMyAppVersion
=
"
%
2"
/DMyAppExcludeSource
=
"taosd.exe"
tools
\tdengine.iss
/O
..\release
if
not
%errorlevel%
==
0
(
call
:RUNFAILED
package
%packagClientName
_x86
%
failed
&
exit
/b
1
)
if
not
%errorlevel%
==
0
(
call
:RUNFAILED
package
%packagClientName
_x86
%
failed
&
exit
/b
1
)
...
...
source/libs/sync/src/syncReplication.c
浏览文件 @
66dd7d7e
...
@@ -199,7 +199,6 @@ int32_t syncNodeAppendEntriesPeersSnapshot2(SSyncNode* pSyncNode) {
...
@@ -199,7 +199,6 @@ int32_t syncNodeAppendEntriesPeersSnapshot2(SSyncNode* pSyncNode) {
// send msg
// send msg
syncNodeAppendEntriesBatch
(
pSyncNode
,
pDestId
,
pMsg
);
syncNodeAppendEntriesBatch
(
pSyncNode
,
pDestId
,
pMsg
);
syncAppendEntriesBatchDestroy
(
pMsg
);
// speed up
// speed up
if
(
pMsg
->
dataCount
>
0
&&
pSyncNode
->
commitIndex
-
pMsg
->
prevLogIndex
>
SYNC_SLOW_DOWN_RANGE
)
{
if
(
pMsg
->
dataCount
>
0
&&
pSyncNode
->
commitIndex
-
pMsg
->
prevLogIndex
>
SYNC_SLOW_DOWN_RANGE
)
{
...
@@ -216,6 +215,8 @@ int32_t syncNodeAppendEntriesPeersSnapshot2(SSyncNode* pSyncNode) {
...
@@ -216,6 +215,8 @@ int32_t syncNodeAppendEntriesPeersSnapshot2(SSyncNode* pSyncNode) {
} while (0);
} while (0);
#endif
#endif
}
}
syncAppendEntriesBatchDestroy
(
pMsg
);
}
}
return
ret
;
return
ret
;
...
...
source/libs/transport/inc/transComm.h
浏览文件 @
66dd7d7e
...
@@ -128,7 +128,7 @@ typedef struct {
...
@@ -128,7 +128,7 @@ typedef struct {
int8_t
retryCnt
;
int8_t
retryCnt
;
int8_t
retryLimit
;
int8_t
retryLimit
;
// bool setMaxRetry;
STransCtx
appCtx
;
//
STransCtx
appCtx
;
//
STransMsg
*
pRsp
;
// for synchronous API
STransMsg
*
pRsp
;
// for synchronous API
tsem_t
*
pSem
;
// for synchronous API
tsem_t
*
pSem
;
// for synchronous API
...
@@ -195,17 +195,7 @@ typedef enum { ConnNormal, ConnAcquire, ConnRelease, ConnBroken, ConnInPool } Co
...
@@ -195,17 +195,7 @@ typedef enum { ConnNormal, ConnAcquire, ConnRelease, ConnBroken, ConnInPool } Co
#define transLabel(trans) ((STrans*)trans)->label
#define transLabel(trans) ((STrans*)trans)->label
// int rpcAuthenticateMsg(void* pMsg, int msgLen, void* pAuth, void* pKey);
// void rpcBuildAuthHead(void* pMsg, int msgLen, void* pAuth, void* pKey);
//// int32_t rpcCompressRpcMsg(char* pCont, int32_t contLen);
//
// int transAuthenticateMsg(void* pMsg, int msgLen, void* pAuth, void* pKey);
// void transBuildAuthHead(void* pMsg, int msgLen, void* pAuth, void* pKey);
// bool transCompressMsg(char* msg, int32_t len, int32_t* flen);
// bool transDecompressMsg(char* msg, int32_t len, int32_t* flen);
void
transFreeMsg
(
void
*
msg
);
void
transFreeMsg
(
void
*
msg
);
//
//
typedef
struct
SConnBuffer
{
typedef
struct
SConnBuffer
{
char
*
buf
;
char
*
buf
;
...
@@ -323,7 +313,7 @@ void* transCtxDumpBrokenlinkVal(STransCtx* ctx, int32_t* msgType);
...
@@ -323,7 +313,7 @@ void* transCtxDumpBrokenlinkVal(STransCtx* ctx, int32_t* msgType);
// request list
// request list
typedef
struct
STransReq
{
typedef
struct
STransReq
{
queue
q
;
queue
q
;
void
*
data
;
uv_write_t
wreq
;
}
STransReq
;
}
STransReq
;
void
transReqQueueInit
(
queue
*
q
);
void
transReqQueueInit
(
queue
*
q
);
...
...
source/libs/transport/src/transCli.c
浏览文件 @
66dd7d7e
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
typedef
struct
SConnList
{
typedef
struct
SConnList
{
queue
conn
;
queue
conn
;
int32_t
size
;
}
SConnList
;
}
SConnList
;
typedef
struct
SCliConn
{
typedef
struct
SCliConn
{
...
@@ -339,8 +340,8 @@ void cliHandleResp(SCliConn* conn) {
...
@@ -339,8 +340,8 @@ void cliHandleResp(SCliConn* conn) {
tDebug
(
"%s conn %p stop timer"
,
CONN_GET_INST_LABEL
(
conn
),
conn
);
tDebug
(
"%s conn %p stop timer"
,
CONN_GET_INST_LABEL
(
conn
),
conn
);
uv_timer_stop
(
conn
->
timer
);
uv_timer_stop
(
conn
->
timer
);
}
}
conn
->
timer
->
data
=
NULL
;
taosArrayPush
(
pThrd
->
timerList
,
&
conn
->
timer
);
taosArrayPush
(
pThrd
->
timerList
,
&
conn
->
timer
);
conn
->
timer
->
data
=
NULL
;
conn
->
timer
=
NULL
;
conn
->
timer
=
NULL
;
}
}
...
@@ -510,7 +511,7 @@ static SCliConn* getConnFromPool(void* pool, char* ip, uint32_t port) {
...
@@ -510,7 +511,7 @@ static SCliConn* getConnFromPool(void* pool, char* ip, uint32_t port) {
SHashObj
*
pPool
=
pool
;
SHashObj
*
pPool
=
pool
;
SConnList
*
plist
=
taosHashGet
(
pPool
,
key
,
strlen
(
key
));
SConnList
*
plist
=
taosHashGet
(
pPool
,
key
,
strlen
(
key
));
if
(
plist
==
NULL
)
{
if
(
plist
==
NULL
)
{
SConnList
list
;
SConnList
list
=
{
0
}
;
taosHashPut
(
pPool
,
key
,
strlen
(
key
),
(
void
*
)
&
list
,
sizeof
(
list
));
taosHashPut
(
pPool
,
key
,
strlen
(
key
),
(
void
*
)
&
list
,
sizeof
(
list
));
plist
=
taosHashGet
(
pPool
,
key
,
strlen
(
key
));
plist
=
taosHashGet
(
pPool
,
key
,
strlen
(
key
));
QUEUE_INIT
(
&
plist
->
conn
);
QUEUE_INIT
(
&
plist
->
conn
);
...
@@ -519,15 +520,18 @@ static SCliConn* getConnFromPool(void* pool, char* ip, uint32_t port) {
...
@@ -519,15 +520,18 @@ static SCliConn* getConnFromPool(void* pool, char* ip, uint32_t port) {
if
(
QUEUE_IS_EMPTY
(
&
plist
->
conn
))
{
if
(
QUEUE_IS_EMPTY
(
&
plist
->
conn
))
{
return
NULL
;
return
NULL
;
}
}
plist
->
size
-=
1
;
queue
*
h
=
QUEUE_HEAD
(
&
plist
->
conn
);
queue
*
h
=
QUEUE_HEAD
(
&
plist
->
conn
);
SCliConn
*
conn
=
QUEUE_DATA
(
h
,
SCliConn
,
q
);
SCliConn
*
conn
=
QUEUE_DATA
(
h
,
SCliConn
,
q
);
conn
->
status
=
ConnNormal
;
conn
->
status
=
ConnNormal
;
QUEUE_REMOVE
(
&
conn
->
q
);
QUEUE_REMOVE
(
&
conn
->
q
);
QUEUE_INIT
(
&
conn
->
q
);
QUEUE_INIT
(
&
conn
->
q
);
if
(
conn
->
task
!=
NULL
)
{
transDQCancel
(((
SCliThrd
*
)
conn
->
hostThrd
)
->
timeoutQueue
,
conn
->
task
);
transDQCancel
(((
SCliThrd
*
)
conn
->
hostThrd
)
->
timeoutQueue
,
conn
->
task
);
conn
->
task
=
NULL
;
conn
->
task
=
NULL
;
}
return
conn
;
return
conn
;
}
}
static
void
addConnToPool
(
void
*
pool
,
SCliConn
*
conn
)
{
static
void
addConnToPool
(
void
*
pool
,
SCliConn
*
conn
)
{
...
@@ -539,6 +543,13 @@ static void addConnToPool(void* pool, SCliConn* conn) {
...
@@ -539,6 +543,13 @@ static void addConnToPool(void* pool, SCliConn* conn) {
allocConnRef
(
conn
,
true
);
allocConnRef
(
conn
,
true
);
if
(
conn
->
timer
!=
NULL
)
{
uv_timer_stop
(
conn
->
timer
);
taosArrayPush
(
thrd
->
timerList
,
&
conn
->
timer
);
conn
->
timer
->
data
=
NULL
;
conn
->
timer
=
NULL
;
}
STrans
*
pTransInst
=
thrd
->
pTransInst
;
STrans
*
pTransInst
=
thrd
->
pTransInst
;
cliReleaseUnfinishedMsg
(
conn
);
cliReleaseUnfinishedMsg
(
conn
);
transQueueClear
(
&
conn
->
cliMsgs
);
transQueueClear
(
&
conn
->
cliMsgs
);
...
@@ -556,13 +567,17 @@ static void addConnToPool(void* pool, SCliConn* conn) {
...
@@ -556,13 +567,17 @@ static void addConnToPool(void* pool, SCliConn* conn) {
assert
(
conn
->
list
!=
NULL
);
assert
(
conn
->
list
!=
NULL
);
QUEUE_INIT
(
&
conn
->
q
);
QUEUE_INIT
(
&
conn
->
q
);
QUEUE_PUSH
(
&
conn
->
list
->
conn
,
&
conn
->
q
);
QUEUE_PUSH
(
&
conn
->
list
->
conn
,
&
conn
->
q
);
conn
->
list
->
size
+=
1
;
conn
->
task
=
NULL
;
assert
(
!
QUEUE_IS_EMPTY
(
&
conn
->
list
->
conn
));
assert
(
!
QUEUE_IS_EMPTY
(
&
conn
->
list
->
conn
));
if
(
conn
->
list
->
size
>=
50
)
{
STaskArg
*
arg
=
taosMemoryCalloc
(
1
,
sizeof
(
STaskArg
));
STaskArg
*
arg
=
taosMemoryCalloc
(
1
,
sizeof
(
STaskArg
));
arg
->
param1
=
conn
;
arg
->
param1
=
conn
;
arg
->
param2
=
thrd
;
arg
->
param2
=
thrd
;
conn
->
task
=
transDQSched
(
thrd
->
timeoutQueue
,
doCloseIdleConn
,
arg
,
CONN_PERSIST_TIME
(
pTransInst
->
idleTime
));
conn
->
task
=
transDQSched
(
thrd
->
timeoutQueue
,
doCloseIdleConn
,
arg
,
CONN_PERSIST_TIME
(
pTransInst
->
idleTime
));
}
}
}
static
int32_t
allocConnRef
(
SCliConn
*
conn
,
bool
update
)
{
static
int32_t
allocConnRef
(
SCliConn
*
conn
,
bool
update
)
{
if
(
update
)
{
if
(
update
)
{
...
@@ -1374,7 +1389,7 @@ int transReleaseCliHandle(void* handle) {
...
@@ -1374,7 +1389,7 @@ int transReleaseCliHandle(void* handle) {
}
}
STransMsg
tmsg
=
{.
info
.
handle
=
handle
};
STransMsg
tmsg
=
{.
info
.
handle
=
handle
};
TRACE_SET_MSGID
(
&
tmsg
.
info
.
traceId
,
tGenIdPI64
());
//
TRACE_SET_MSGID(&tmsg.info.traceId, tGenIdPI64());
SCliMsg
*
cmsg
=
taosMemoryCalloc
(
1
,
sizeof
(
SCliMsg
));
SCliMsg
*
cmsg
=
taosMemoryCalloc
(
1
,
sizeof
(
SCliMsg
));
cmsg
->
msg
=
tmsg
;
cmsg
->
msg
=
tmsg
;
...
@@ -1415,7 +1430,6 @@ int transSendRequest(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STran
...
@@ -1415,7 +1430,6 @@ int transSendRequest(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STran
if
(
ctx
!=
NULL
)
{
if
(
ctx
!=
NULL
)
{
pCtx
->
appCtx
=
*
ctx
;
pCtx
->
appCtx
=
*
ctx
;
}
}
assert
(
pTransInst
->
connType
==
TAOS_CONN_CLIENT
);
SCliMsg
*
cliMsg
=
taosMemoryCalloc
(
1
,
sizeof
(
SCliMsg
));
SCliMsg
*
cliMsg
=
taosMemoryCalloc
(
1
,
sizeof
(
SCliMsg
));
cliMsg
->
ctx
=
pCtx
;
cliMsg
->
ctx
=
pCtx
;
...
...
source/libs/transport/src/transComm.c
浏览文件 @
66dd7d7e
...
@@ -23,33 +23,6 @@ static TdThreadOnce transModuleInit = PTHREAD_ONCE_INIT;
...
@@ -23,33 +23,6 @@ static TdThreadOnce transModuleInit = PTHREAD_ONCE_INIT;
static
int32_t
refMgt
;
static
int32_t
refMgt
;
static
int32_t
instMgt
;
static
int32_t
instMgt
;
int
transAuthenticateMsg
(
void
*
pMsg
,
int
msgLen
,
void
*
pAuth
,
void
*
pKey
)
{
T_MD5_CTX
context
;
int
ret
=
-
1
;
tMD5Init
(
&
context
);
tMD5Update
(
&
context
,
(
uint8_t
*
)
pKey
,
TSDB_PASSWORD_LEN
);
tMD5Update
(
&
context
,
(
uint8_t
*
)
pMsg
,
msgLen
);
tMD5Update
(
&
context
,
(
uint8_t
*
)
pKey
,
TSDB_PASSWORD_LEN
);
tMD5Final
(
&
context
);
if
(
memcmp
(
context
.
digest
,
pAuth
,
sizeof
(
context
.
digest
))
==
0
)
ret
=
0
;
return
ret
;
}
void
transBuildAuthHead
(
void
*
pMsg
,
int
msgLen
,
void
*
pAuth
,
void
*
pKey
)
{
T_MD5_CTX
context
;
tMD5Init
(
&
context
);
tMD5Update
(
&
context
,
(
uint8_t
*
)
pKey
,
TSDB_PASSWORD_LEN
);
tMD5Update
(
&
context
,
(
uint8_t
*
)
pMsg
,
msgLen
);
tMD5Update
(
&
context
,
(
uint8_t
*
)
pKey
,
TSDB_PASSWORD_LEN
);
tMD5Final
(
&
context
);
memcpy
(
pAuth
,
context
.
digest
,
sizeof
(
context
.
digest
));
}
bool
transCompressMsg
(
char
*
msg
,
int32_t
len
,
int32_t
*
flen
)
{
bool
transCompressMsg
(
char
*
msg
,
int32_t
len
,
int32_t
*
flen
)
{
return
false
;
return
false
;
// SRpcHead* pHead = rpcHeadFromCont(pCont);
// SRpcHead* pHead = rpcHeadFromCont(pCont);
...
@@ -176,7 +149,6 @@ int transAllocBuffer(SConnBuffer* connBuf, uv_buf_t* uvBuf) {
...
@@ -176,7 +149,6 @@ int transAllocBuffer(SConnBuffer* connBuf, uv_buf_t* uvBuf) {
* info--->|
* info--->|
*/
*/
SConnBuffer
*
p
=
connBuf
;
SConnBuffer
*
p
=
connBuf
;
uvBuf
->
base
=
p
->
buf
+
p
->
len
;
uvBuf
->
base
=
p
->
buf
+
p
->
len
;
if
(
p
->
left
==
-
1
)
{
if
(
p
->
left
==
-
1
)
{
uvBuf
->
len
=
p
->
cap
-
p
->
len
;
uvBuf
->
len
=
p
->
cap
-
p
->
len
;
...
@@ -184,7 +156,8 @@ int transAllocBuffer(SConnBuffer* connBuf, uv_buf_t* uvBuf) {
...
@@ -184,7 +156,8 @@ int transAllocBuffer(SConnBuffer* connBuf, uv_buf_t* uvBuf) {
if
(
p
->
left
<
p
->
cap
-
p
->
len
)
{
if
(
p
->
left
<
p
->
cap
-
p
->
len
)
{
uvBuf
->
len
=
p
->
left
;
uvBuf
->
len
=
p
->
left
;
}
else
{
}
else
{
p
->
buf
=
taosMemoryRealloc
(
p
->
buf
,
p
->
left
+
p
->
len
);
p
->
cap
=
p
->
left
+
p
->
len
;
p
->
buf
=
taosMemoryRealloc
(
p
->
buf
,
p
->
cap
);
uvBuf
->
base
=
p
->
buf
+
p
->
len
;
uvBuf
->
base
=
p
->
buf
+
p
->
len
;
uvBuf
->
len
=
p
->
left
;
uvBuf
->
len
=
p
->
left
;
}
}
...
@@ -266,14 +239,9 @@ int transAsyncSend(SAsyncPool* pool, queue* q) {
...
@@ -266,14 +239,9 @@ int transAsyncSend(SAsyncPool* pool, queue* q) {
uv_async_t
*
async
=
&
(
pool
->
asyncs
[
idx
]);
uv_async_t
*
async
=
&
(
pool
->
asyncs
[
idx
]);
SAsyncItem
*
item
=
async
->
data
;
SAsyncItem
*
item
=
async
->
data
;
int64_t
st
=
taosGetTimestampUs
();
taosThreadMutexLock
(
&
item
->
mtx
);
taosThreadMutexLock
(
&
item
->
mtx
);
QUEUE_PUSH
(
&
item
->
qmsg
,
q
);
QUEUE_PUSH
(
&
item
->
qmsg
,
q
);
taosThreadMutexUnlock
(
&
item
->
mtx
);
taosThreadMutexUnlock
(
&
item
->
mtx
);
int64_t
el
=
taosGetTimestampUs
()
-
st
;
if
(
el
>
50
)
{
// tInfo("lock and unlock cost:%d", (int)el);
}
return
uv_async_send
(
async
);
return
uv_async_send
(
async
);
}
}
...
@@ -349,30 +317,21 @@ void transReqQueueInit(queue* q) {
...
@@ -349,30 +317,21 @@ void transReqQueueInit(queue* q) {
QUEUE_INIT
(
q
);
QUEUE_INIT
(
q
);
}
}
void
*
transReqQueuePush
(
queue
*
q
)
{
void
*
transReqQueuePush
(
queue
*
q
)
{
uv_write_t
*
req
=
taosMemoryCalloc
(
1
,
sizeof
(
uv_write_t
));
STransReq
*
req
=
taosMemoryCalloc
(
1
,
sizeof
(
STransReq
));
STransReq
*
wreq
=
taosMemoryCalloc
(
1
,
sizeof
(
STransReq
));
req
->
wreq
.
data
=
req
;
wreq
->
data
=
req
;
QUEUE_PUSH
(
q
,
&
req
->
q
);
req
->
data
=
wreq
;
return
&
req
->
wreq
;
QUEUE_PUSH
(
q
,
&
wreq
->
q
);
return
req
;
}
}
void
*
transReqQueueRemove
(
void
*
arg
)
{
void
*
transReqQueueRemove
(
void
*
arg
)
{
void
*
ret
=
NULL
;
void
*
ret
=
NULL
;
uv_write_t
*
req
=
arg
;
uv_write_t
*
wreq
=
arg
;
STransReq
*
wreq
=
req
&&
req
->
data
?
req
->
data
:
NULL
;
assert
(
wreq
->
data
==
req
);
STransReq
*
req
=
wreq
?
wreq
->
data
:
NULL
;
if
(
wreq
==
NULL
||
wreq
->
data
==
NULL
)
{
if
(
req
==
NULL
)
return
NULL
;
taosMemoryFree
(
wreq
->
data
);
QUEUE_REMOVE
(
&
req
->
q
);
taosMemoryFree
(
wreq
);
return
req
;
}
QUEUE_REMOVE
(
&
wreq
->
q
);
ret
=
req
&&
req
->
handle
?
req
->
handle
->
data
:
NULL
;
ret
=
wreq
&&
wreq
->
handle
?
wreq
->
handle
->
data
:
NULL
;
taosMemoryFree
(
wreq
->
data
);
taosMemoryFree
(
req
);
taosMemoryFree
(
wreq
);
return
ret
;
return
ret
;
}
}
...
@@ -381,7 +340,6 @@ void transReqQueueClear(queue* q) {
...
@@ -381,7 +340,6 @@ void transReqQueueClear(queue* q) {
queue
*
h
=
QUEUE_HEAD
(
q
);
queue
*
h
=
QUEUE_HEAD
(
q
);
QUEUE_REMOVE
(
h
);
QUEUE_REMOVE
(
h
);
STransReq
*
req
=
QUEUE_DATA
(
h
,
STransReq
,
q
);
STransReq
*
req
=
QUEUE_DATA
(
h
,
STransReq
,
q
);
taosMemoryFree
(
req
->
data
);
taosMemoryFree
(
req
);
taosMemoryFree
(
req
);
}
}
}
}
...
...
source/libs/transport/src/transSvr.c
浏览文件 @
66dd7d7e
...
@@ -75,7 +75,6 @@ typedef struct SWorkThrd {
...
@@ -75,7 +75,6 @@ typedef struct SWorkThrd {
SAsyncPool
*
asyncPool
;
SAsyncPool
*
asyncPool
;
uv_prepare_t
*
prepare
;
uv_prepare_t
*
prepare
;
queue
msg
;
queue
msg
;
TdThreadMutex
msgMtx
;
queue
conn
;
queue
conn
;
void
*
pTransInst
;
void
*
pTransInst
;
...
@@ -499,6 +498,7 @@ void uvWorkerAsyncCb(uv_async_t* handle) {
...
@@ -499,6 +498,7 @@ void uvWorkerAsyncCb(uv_async_t* handle) {
tError
(
"unexcept occurred, continue"
);
tError
(
"unexcept occurred, continue"
);
continue
;
continue
;
}
}
// release handle to rpc init
// release handle to rpc init
if
(
msg
->
type
==
Quit
)
{
if
(
msg
->
type
==
Quit
)
{
(
*
transAsyncHandle
[
msg
->
type
])(
msg
,
pThrd
);
(
*
transAsyncHandle
[
msg
->
type
])(
msg
,
pThrd
);
...
@@ -743,7 +743,6 @@ static bool addHandleToWorkloop(SWorkThrd* pThrd, char* pipeName) {
...
@@ -743,7 +743,6 @@ static bool addHandleToWorkloop(SWorkThrd* pThrd, char* pipeName) {
pThrd
->
pipe
->
data
=
pThrd
;
pThrd
->
pipe
->
data
=
pThrd
;
QUEUE_INIT
(
&
pThrd
->
msg
);
QUEUE_INIT
(
&
pThrd
->
msg
);
taosThreadMutexInit
(
&
pThrd
->
msgMtx
,
NULL
);
pThrd
->
prepare
=
taosMemoryCalloc
(
1
,
sizeof
(
uv_prepare_t
));
pThrd
->
prepare
=
taosMemoryCalloc
(
1
,
sizeof
(
uv_prepare_t
));
uv_prepare_init
(
pThrd
->
loop
,
pThrd
->
prepare
);
uv_prepare_init
(
pThrd
->
loop
,
pThrd
->
prepare
);
...
...
source/libs/transport/test/svrBench.c
浏览文件 @
66dd7d7e
...
@@ -75,15 +75,14 @@ void processShellMsg() {
...
@@ -75,15 +75,14 @@ void processShellMsg() {
void
*
handle
=
pRpcMsg
->
info
.
handle
;
void
*
handle
=
pRpcMsg
->
info
.
handle
;
taosFreeQitem
(
pRpcMsg
);
taosFreeQitem
(
pRpcMsg
);
//{
{
// SRpcMsg nRpcMsg = {0};
SRpcMsg
nRpcMsg
=
{
0
};
// nRpcMsg.pCont = rpcMallocCont(msgSize);
nRpcMsg
.
pCont
=
rpcMallocCont
(
msgSize
);
// nRpcMsg.contLen = msgSize;
nRpcMsg
.
contLen
=
msgSize
;
// nRpcMsg.info.handle = handle;
nRpcMsg
.
info
.
handle
=
handle
;
// nRpcMsg.code = TSDB_CODE_CTG_NOT_READY;
nRpcMsg
.
code
=
TSDB_CODE_CTG_NOT_READY
;
// rpcSendResponse(&nRpcMsg);
rpcSendResponse
(
&
nRpcMsg
);
//}
}
}
}
taosUpdateItemSize
(
qinfo
.
queue
,
numOfMsgs
);
taosUpdateItemSize
(
qinfo
.
queue
,
numOfMsgs
);
...
...
source/os/src/osSemaphore.c
浏览文件 @
66dd7d7e
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#define ALLOW_FORBID_FUNC
#define ALLOW_FORBID_FUNC
#define _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#include "os.h"
#include "os.h"
#include "tdef.h"
#include "pthread.h"
#include "pthread.h"
#ifdef WINDOWS
#ifdef WINDOWS
...
@@ -57,7 +58,7 @@ int32_t taosGetAppName(char* name, int32_t* len) {
...
@@ -57,7 +58,7 @@ int32_t taosGetAppName(char* name, int32_t* len) {
end
=
filepath
;
end
=
filepath
;
}
}
strcpy
(
name
,
end
);
tstrncpy
(
name
,
end
,
TSDB_APP_NAME_LEN
);
if
(
len
!=
NULL
)
{
if
(
len
!=
NULL
)
{
*
len
=
(
int32_t
)
strlen
(
end
);
*
len
=
(
int32_t
)
strlen
(
end
);
...
@@ -625,7 +626,7 @@ int32_t taosGetAppName(char *name, int32_t *len) {
...
@@ -625,7 +626,7 @@ int32_t taosGetAppName(char *name, int32_t *len) {
buf
[
PATH_MAX
]
=
'\0'
;
buf
[
PATH_MAX
]
=
'\0'
;
size_t
n
=
strlen
(
buf
);
size_t
n
=
strlen
(
buf
);
if
(
len
)
*
len
=
n
;
if
(
len
)
*
len
=
n
;
if
(
name
)
strcpy
(
name
,
buf
);
if
(
name
)
tstrncpy
(
name
,
buf
,
TSDB_APP_NAME_LEN
);
return
0
;
return
0
;
}
}
...
@@ -668,7 +669,7 @@ int32_t taosGetAppName(char* name, int32_t* len) {
...
@@ -668,7 +669,7 @@ int32_t taosGetAppName(char* name, int32_t* len) {
++
end
;
++
end
;
strcpy
(
name
,
end
);
tstrncpy
(
name
,
end
,
TSDB_APP_NAME_LEN
);
if
(
len
!=
NULL
)
{
if
(
len
!=
NULL
)
{
*
len
=
strlen
(
name
);
*
len
=
strlen
(
name
);
...
...
source/os/src/osSysinfo.c
浏览文件 @
66dd7d7e
...
@@ -398,7 +398,7 @@ int32_t taosGetCpuInfo(char *cpuModel, int32_t maxLen, float *numOfCores) {
...
@@ -398,7 +398,7 @@ int32_t taosGetCpuInfo(char *cpuModel, int32_t maxLen, float *numOfCores) {
if
(
line
!=
NULL
)
taosMemoryFree
(
line
);
if
(
line
!=
NULL
)
taosMemoryFree
(
line
);
taosCloseFile
(
&
pFile
);
taosCloseFile
(
&
pFile
);
if
(
code
!=
0
)
{
if
(
code
!=
0
&&
(
done
&
1
)
==
0
)
{
TdFilePtr
pFile1
=
taosOpenFile
(
"/proc/device-tree/model"
,
TD_FILE_READ
|
TD_FILE_STREAM
);
TdFilePtr
pFile1
=
taosOpenFile
(
"/proc/device-tree/model"
,
TD_FILE_READ
|
TD_FILE_STREAM
);
if
(
pFile1
==
NULL
)
return
code
;
if
(
pFile1
==
NULL
)
return
code
;
taosGetsFile
(
pFile1
,
maxLen
,
cpuModel
);
taosGetsFile
(
pFile1
,
maxLen
,
cpuModel
);
...
@@ -407,6 +407,16 @@ int32_t taosGetCpuInfo(char *cpuModel, int32_t maxLen, float *numOfCores) {
...
@@ -407,6 +407,16 @@ int32_t taosGetCpuInfo(char *cpuModel, int32_t maxLen, float *numOfCores) {
done
|=
1
;
done
|=
1
;
}
}
if
(
code
!=
0
&&
(
done
&
1
)
==
0
)
{
TdCmdPtr
pCmd
=
taosOpenCmd
(
"uname -a"
);
if
(
pCmd
==
NULL
)
return
code
;
if
(
taosGetsCmd
(
pCmd
,
maxLen
,
cpuModel
)
>
0
)
{
code
=
0
;
done
|=
1
;
}
taosCloseCmd
(
&
pCmd
);
}
if
((
done
&
2
)
==
0
)
{
if
((
done
&
2
)
==
0
)
{
*
numOfCores
=
coreCount
;
*
numOfCores
=
coreCount
;
done
|=
2
;
done
|=
2
;
...
...
source/os/src/osSystem.c
浏览文件 @
66dd7d7e
...
@@ -248,6 +248,16 @@ TdCmdPtr taosOpenCmd(const char* cmd) {
...
@@ -248,6 +248,16 @@ TdCmdPtr taosOpenCmd(const char* cmd) {
#endif
#endif
}
}
int64_t
taosGetsCmd
(
TdCmdPtr
pCmd
,
int32_t
maxSize
,
char
*
__restrict
buf
)
{
if
(
pCmd
==
NULL
||
buf
==
NULL
)
{
return
-
1
;
}
if
(
fgets
(
buf
,
maxSize
,
(
FILE
*
)
pCmd
)
==
NULL
)
{
return
-
1
;
}
return
strlen
(
buf
);
}
int64_t
taosGetLineCmd
(
TdCmdPtr
pCmd
,
char
**
__restrict
ptrBuf
)
{
int64_t
taosGetLineCmd
(
TdCmdPtr
pCmd
,
char
**
__restrict
ptrBuf
)
{
if
(
pCmd
==
NULL
||
ptrBuf
==
NULL
)
{
if
(
pCmd
==
NULL
||
ptrBuf
==
NULL
)
{
return
-
1
;
return
-
1
;
...
...
source/util/src/tref.c
浏览文件 @
66dd7d7e
tests/script/jenkins/basic.txt
浏览文件 @
66dd7d7e
...
@@ -332,8 +332,8 @@
...
@@ -332,8 +332,8 @@
./test.sh -f tsim/vnode/stable_replica3_vnode3.sim
./test.sh -f tsim/vnode/stable_replica3_vnode3.sim
# --- sync
# --- sync
#
./test.sh -f tsim/sync/3Replica1VgElect.sim
./test.sh -f tsim/sync/3Replica1VgElect.sim
#
./test.sh -f tsim/sync/3Replica5VgElect.sim
./test.sh -f tsim/sync/3Replica5VgElect.sim
./test.sh -f tsim/sync/oneReplica1VgElect.sim
./test.sh -f tsim/sync/oneReplica1VgElect.sim
./test.sh -f tsim/sync/oneReplica5VgElect.sim
./test.sh -f tsim/sync/oneReplica5VgElect.sim
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录