Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b282e39b
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b282e39b
编写于
10月 21, 2022
作者:
haoranc
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' into fix/TD-19312
上级
70b37608
12fd4bfc
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
4981 addition
and
35 deletion
+4981
-35
cmake/taosws_CMakeLists.txt.in
cmake/taosws_CMakeLists.txt.in
+1
-1
source/libs/function/src/tudf.c
source/libs/function/src/tudf.c
+36
-29
source/libs/wal/src/walWrite.c
source/libs/wal/src/walWrite.c
+6
-1
tests/system-test/2-query/stablity.py
tests/system-test/2-query/stablity.py
+4933
-0
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+5
-4
未找到文件。
cmake/taosws_CMakeLists.txt.in
浏览文件 @
b282e39b
...
...
@@ -2,7 +2,7 @@
# taosws-rs
ExternalProject_Add(taosws-rs
GIT_REPOSITORY https://github.com/taosdata/taos-connector-rust.git
GIT_TAG
1bdfca3
GIT_TAG
0373a70
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosws-rs"
BINARY_DIR ""
#BUILD_IN_SOURCE TRUE
...
...
source/libs/function/src/tudf.c
浏览文件 @
b282e39b
...
...
@@ -339,10 +339,11 @@ typedef struct SUdfcProxy {
uv_mutex_t
udfStubsMutex
;
SArray
*
udfStubs
;
// SUdfcFuncStub
uv_mutex_t
udfcUvMutex
;
int8_t
initialized
;
}
SUdfcProxy
;
SUdfcProxy
gUdf
d
Proxy
=
{
0
};
SUdfcProxy
gUdf
c
Proxy
=
{
0
};
typedef
struct
SUdfcUvSession
{
SUdfcProxy
*
udfc
;
...
...
@@ -896,23 +897,23 @@ int compareUdfcFuncSub(const void *elem1, const void *elem2) {
int32_t
acquireUdfFuncHandle
(
char
*
udfName
,
UdfcFuncHandle
*
pHandle
)
{
int32_t
code
=
0
;
uv_mutex_lock
(
&
gUdf
d
Proxy
.
udfStubsMutex
);
uv_mutex_lock
(
&
gUdf
c
Proxy
.
udfStubsMutex
);
SUdfcFuncStub
key
=
{
0
};
strncpy
(
key
.
udfName
,
udfName
,
TSDB_FUNC_NAME_LEN
);
int32_t
stubIndex
=
taosArraySearchIdx
(
gUdf
d
Proxy
.
udfStubs
,
&
key
,
compareUdfcFuncSub
,
TD_EQ
);
int32_t
stubIndex
=
taosArraySearchIdx
(
gUdf
c
Proxy
.
udfStubs
,
&
key
,
compareUdfcFuncSub
,
TD_EQ
);
if
(
stubIndex
!=
-
1
)
{
SUdfcFuncStub
*
foundStub
=
taosArrayGet
(
gUdf
d
Proxy
.
udfStubs
,
stubIndex
);
SUdfcFuncStub
*
foundStub
=
taosArrayGet
(
gUdf
c
Proxy
.
udfStubs
,
stubIndex
);
UdfcFuncHandle
handle
=
foundStub
->
handle
;
if
(
handle
!=
NULL
&&
((
SUdfcUvSession
*
)
handle
)
->
udfUvPipe
!=
NULL
)
{
*
pHandle
=
foundStub
->
handle
;
++
foundStub
->
refCount
;
foundStub
->
lastRefTime
=
taosGetTimestampUs
();
uv_mutex_unlock
(
&
gUdf
d
Proxy
.
udfStubsMutex
);
uv_mutex_unlock
(
&
gUdf
c
Proxy
.
udfStubsMutex
);
return
0
;
}
else
{
fnInfo
(
"invalid handle for %s, refCount: %d, last ref time: %"
PRId64
". remove it from cache"
,
udfName
,
foundStub
->
refCount
,
foundStub
->
lastRefTime
);
taosArrayRemove
(
gUdf
d
Proxy
.
udfStubs
,
stubIndex
);
taosArrayRemove
(
gUdf
c
Proxy
.
udfStubs
,
stubIndex
);
}
}
*
pHandle
=
NULL
;
...
...
@@ -923,46 +924,46 @@ int32_t acquireUdfFuncHandle(char *udfName, UdfcFuncHandle *pHandle) {
stub
.
handle
=
*
pHandle
;
++
stub
.
refCount
;
stub
.
lastRefTime
=
taosGetTimestampUs
();
taosArrayPush
(
gUdf
d
Proxy
.
udfStubs
,
&
stub
);
taosArraySort
(
gUdf
d
Proxy
.
udfStubs
,
compareUdfcFuncSub
);
taosArrayPush
(
gUdf
c
Proxy
.
udfStubs
,
&
stub
);
taosArraySort
(
gUdf
c
Proxy
.
udfStubs
,
compareUdfcFuncSub
);
}
else
{
*
pHandle
=
NULL
;
}
uv_mutex_unlock
(
&
gUdf
d
Proxy
.
udfStubsMutex
);
uv_mutex_unlock
(
&
gUdf
c
Proxy
.
udfStubsMutex
);
return
code
;
}
void
releaseUdfFuncHandle
(
char
*
udfName
)
{
uv_mutex_lock
(
&
gUdf
d
Proxy
.
udfStubsMutex
);
uv_mutex_lock
(
&
gUdf
c
Proxy
.
udfStubsMutex
);
SUdfcFuncStub
key
=
{
0
};
strncpy
(
key
.
udfName
,
udfName
,
TSDB_FUNC_NAME_LEN
);
SUdfcFuncStub
*
foundStub
=
taosArraySearch
(
gUdf
d
Proxy
.
udfStubs
,
&
key
,
compareUdfcFuncSub
,
TD_EQ
);
SUdfcFuncStub
*
foundStub
=
taosArraySearch
(
gUdf
c
Proxy
.
udfStubs
,
&
key
,
compareUdfcFuncSub
,
TD_EQ
);
if
(
!
foundStub
)
{
uv_mutex_unlock
(
&
gUdf
d
Proxy
.
udfStubsMutex
);
uv_mutex_unlock
(
&
gUdf
c
Proxy
.
udfStubsMutex
);
return
;
}
if
(
foundStub
->
refCount
>
0
)
{
--
foundStub
->
refCount
;
}
uv_mutex_unlock
(
&
gUdf
d
Proxy
.
udfStubsMutex
);
uv_mutex_unlock
(
&
gUdf
c
Proxy
.
udfStubsMutex
);
}
int32_t
cleanUpUdfs
()
{
int8_t
initialized
=
atomic_load_8
(
&
gUdf
d
Proxy
.
initialized
);
int8_t
initialized
=
atomic_load_8
(
&
gUdf
c
Proxy
.
initialized
);
if
(
!
initialized
)
{
return
TSDB_CODE_SUCCESS
;
}
uv_mutex_lock
(
&
gUdf
d
Proxy
.
udfStubsMutex
);
if
(
gUdf
dProxy
.
udfStubs
==
NULL
||
taosArrayGetSize
(
gUdfd
Proxy
.
udfStubs
)
==
0
)
{
uv_mutex_unlock
(
&
gUdf
d
Proxy
.
udfStubsMutex
);
uv_mutex_lock
(
&
gUdf
c
Proxy
.
udfStubsMutex
);
if
(
gUdf
cProxy
.
udfStubs
==
NULL
||
taosArrayGetSize
(
gUdfc
Proxy
.
udfStubs
)
==
0
)
{
uv_mutex_unlock
(
&
gUdf
c
Proxy
.
udfStubsMutex
);
return
TSDB_CODE_SUCCESS
;
}
SArray
*
udfStubs
=
taosArrayInit
(
16
,
sizeof
(
SUdfcFuncStub
));
int32_t
i
=
0
;
while
(
i
<
taosArrayGetSize
(
gUdf
d
Proxy
.
udfStubs
))
{
SUdfcFuncStub
*
stub
=
taosArrayGet
(
gUdf
d
Proxy
.
udfStubs
,
i
);
while
(
i
<
taosArrayGetSize
(
gUdf
c
Proxy
.
udfStubs
))
{
SUdfcFuncStub
*
stub
=
taosArrayGet
(
gUdf
c
Proxy
.
udfStubs
,
i
);
if
(
stub
->
refCount
==
0
)
{
fnInfo
(
"tear down udf. udf name: %s, handle: %p, ref count: %d"
,
stub
->
udfName
,
stub
->
handle
,
stub
->
refCount
);
doTeardownUdf
(
stub
->
handle
);
...
...
@@ -979,9 +980,9 @@ int32_t cleanUpUdfs() {
}
++
i
;
}
taosArrayDestroy
(
gUdf
d
Proxy
.
udfStubs
);
gUdf
d
Proxy
.
udfStubs
=
udfStubs
;
uv_mutex_unlock
(
&
gUdf
d
Proxy
.
udfStubsMutex
);
taosArrayDestroy
(
gUdf
c
Proxy
.
udfStubs
);
gUdf
c
Proxy
.
udfStubs
=
udfStubs
;
uv_mutex_unlock
(
&
gUdf
c
Proxy
.
udfStubsMutex
);
return
0
;
}
...
...
@@ -1157,9 +1158,11 @@ void onUdfcPipeClose(uv_handle_t *handle) {
QUEUE_REMOVE
(
&
task
->
procTaskQueue
);
uv_sem_post
(
&
task
->
taskSem
);
}
uv_mutex_lock
(
&
gUdfcProxy
.
udfcUvMutex
);
if
(
conn
->
session
!=
NULL
)
{
conn
->
session
->
udfUvPipe
=
NULL
;
}
uv_mutex_unlock
(
&
gUdfcProxy
.
udfcUvMutex
);
taosMemoryFree
(
conn
->
readBuf
.
buf
);
taosMemoryFree
(
conn
);
taosMemoryFree
((
uv_pipe_t
*
)
handle
);
...
...
@@ -1553,11 +1556,11 @@ void constructUdfService(void *argsThread) {
}
int32_t
udfcOpen
()
{
int8_t
old
=
atomic_val_compare_exchange_8
(
&
gUdf
d
Proxy
.
initialized
,
0
,
1
);
int8_t
old
=
atomic_val_compare_exchange_8
(
&
gUdf
c
Proxy
.
initialized
,
0
,
1
);
if
(
old
==
1
)
{
return
0
;
}
SUdfcProxy
*
proxy
=
&
gUdf
d
Proxy
;
SUdfcProxy
*
proxy
=
&
gUdf
c
Proxy
;
getUdfdPipeName
(
proxy
->
udfdPipeName
,
sizeof
(
proxy
->
udfdPipeName
));
proxy
->
udfcState
=
UDFC_STATE_STARTNG
;
uv_barrier_init
(
&
proxy
->
initBarrier
,
2
);
...
...
@@ -1567,16 +1570,17 @@ int32_t udfcOpen() {
uv_barrier_wait
(
&
proxy
->
initBarrier
);
uv_mutex_init
(
&
proxy
->
udfStubsMutex
);
proxy
->
udfStubs
=
taosArrayInit
(
8
,
sizeof
(
SUdfcFuncStub
));
uv_mutex_init
(
&
proxy
->
udfcUvMutex
);
fnInfo
(
"udfc initialized"
)
return
0
;
}
int32_t
udfcClose
()
{
int8_t
old
=
atomic_val_compare_exchange_8
(
&
gUdf
d
Proxy
.
initialized
,
1
,
0
);
int8_t
old
=
atomic_val_compare_exchange_8
(
&
gUdf
c
Proxy
.
initialized
,
1
,
0
);
if
(
old
==
0
)
{
return
0
;
}
SUdfcProxy
*
udfc
=
&
gUdf
d
Proxy
;
SUdfcProxy
*
udfc
=
&
gUdf
c
Proxy
;
udfc
->
udfcState
=
UDFC_STATE_STOPPING
;
uv_async_send
(
&
udfc
->
loopStopAsync
);
uv_thread_join
(
&
udfc
->
loopThread
);
...
...
@@ -1584,6 +1588,7 @@ int32_t udfcClose() {
uv_barrier_destroy
(
&
udfc
->
initBarrier
);
taosArrayDestroy
(
udfc
->
udfStubs
);
uv_mutex_destroy
(
&
udfc
->
udfStubsMutex
);
uv_mutex_destroy
(
&
udfc
->
udfcUvMutex
);
udfc
->
udfcState
=
UDFC_STATE_INITAL
;
fnInfo
(
"udfc is cleaned up"
);
return
0
;
...
...
@@ -1611,13 +1616,13 @@ int32_t udfcRunUdfUvTask(SClientUdfTask *task, int8_t uvTaskType) {
}
int32_t
doSetupUdf
(
char
udfName
[],
UdfcFuncHandle
*
funcHandle
)
{
if
(
gUdf
d
Proxy
.
udfcState
!=
UDFC_STATE_READY
)
{
if
(
gUdf
c
Proxy
.
udfcState
!=
UDFC_STATE_READY
)
{
return
TSDB_CODE_UDF_INVALID_STATE
;
}
SClientUdfTask
*
task
=
taosMemoryCalloc
(
1
,
sizeof
(
SClientUdfTask
));
task
->
errCode
=
0
;
task
->
session
=
taosMemoryCalloc
(
1
,
sizeof
(
SUdfcUvSession
));
task
->
session
->
udfc
=
&
gUdf
d
Proxy
;
task
->
session
->
udfc
=
&
gUdf
c
Proxy
;
task
->
type
=
UDF_TASK_SETUP
;
SUdfSetupRequest
*
req
=
&
task
->
_setup
.
req
;
...
...
@@ -1625,7 +1630,7 @@ int32_t doSetupUdf(char udfName[], UdfcFuncHandle *funcHandle) {
int32_t
errCode
=
udfcRunUdfUvTask
(
task
,
UV_TASK_CONNECT
);
if
(
errCode
!=
0
)
{
fnError
(
"failed to connect to pipe. udfName: %s, pipe: %s"
,
udfName
,
(
&
gUdf
d
Proxy
)
->
udfdPipeName
);
fnError
(
"failed to connect to pipe. udfName: %s, pipe: %s"
,
udfName
,
(
&
gUdf
c
Proxy
)
->
udfdPipeName
);
taosMemoryFree
(
task
->
session
);
taosMemoryFree
(
task
);
return
TSDB_CODE_UDF_PIPE_CONNECT_ERR
;
...
...
@@ -1799,10 +1804,12 @@ int32_t doTeardownUdf(UdfcFuncHandle handle) {
fnInfo
(
"tear down udf. udf name: %s, udf func handle: %p"
,
session
->
udfName
,
handle
);
// TODO: synchronization refactor between libuv event loop and request thread
uv_mutex_lock
(
&
gUdfcProxy
.
udfcUvMutex
);
if
(
session
->
udfUvPipe
!=
NULL
&&
session
->
udfUvPipe
->
data
!=
NULL
)
{
SClientUvConn
*
conn
=
session
->
udfUvPipe
->
data
;
conn
->
session
=
NULL
;
}
uv_mutex_unlock
(
&
gUdfcProxy
.
udfcUvMutex
);
taosMemoryFree
(
session
);
taosMemoryFree
(
task
);
...
...
source/libs/wal/src/walWrite.c
浏览文件 @
b282e39b
...
...
@@ -424,7 +424,12 @@ static int32_t walWriteIndex(SWal *pWal, int64_t ver, int64_t offset) {
return
-
1
;
}
ASSERT
(
taosLSeekFile
(
pWal
->
pIdxFile
,
0
,
SEEK_END
)
==
idxOffset
+
sizeof
(
SWalIdxEntry
)
&&
"Offset of idx entries misaligned"
);
// check alignment of idx entries
int64_t
endOffset
=
taosLSeekFile
(
pWal
->
pIdxFile
,
0
,
SEEK_END
);
if
(
endOffset
<
0
)
{
wFatal
(
"vgId:%d, failed to seek end of idxfile due to %s. ver:%"
PRId64
""
,
pWal
->
cfg
.
vgId
,
strerror
(
errno
),
ver
);
}
ASSERT
(
endOffset
==
idxOffset
+
sizeof
(
SWalIdxEntry
)
&&
"Offset of idx entries misaligned"
);
return
0
;
}
...
...
tests/system-test/2-query/stablity.py
0 → 100755
浏览文件 @
b282e39b
此差异已折叠。
点击以展开。
tests/system-test/fulltest.sh
浏览文件 @
b282e39b
...
...
@@ -217,10 +217,11 @@ python3 ./test.py -f 0-others/compatibility.py
# python3 ./test.py -f 2-query/json_tag.py
# # python3 ./test.py -f 2-query/nestedQuery.py
# # TD-15983 subquery output duplicate name column.
# # Please Xiangyang Guo modify the following script
# # python3 ./test.py -f 2-query/nestedQuery_str.py
# python3 ./test.py -f 2-query/nestedQuery.py
# TD-15983 subquery output duplicate name column.
# Please Xiangyang Guo modify the following script
# python3 ./test.py -f 2-query/nestedQuery_str.py
# python3 ./test.py -f 2-query/stablity.py
# python3 ./test.py -f 2-query/elapsed.py
# python3 ./test.py -f 2-query/csum.py
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录