Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b0e0f973
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
未验证
提交
b0e0f973
编写于
4月 16, 2021
作者:
H
haojun Liao
提交者:
GitHub
4月 16, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5816 from taosdata/hotfix/TD-3774
[TD-3774]dulicated CQ created when wal is re-executed issue
上级
daf406f7
73d60547
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
25 addition
and
6 deletion
+25
-6
src/client/src/tscStream.c
src/client/src/tscStream.c
+1
-1
src/cq/src/cqMain.c
src/cq/src/cqMain.c
+24
-5
未找到文件。
src/client/src/tscStream.c
浏览文件 @
b0e0f973
...
@@ -619,7 +619,7 @@ TAOS_STREAM *taos_open_stream(TAOS *taos, const char *sqlstr, void (*fp)(void *p
...
@@ -619,7 +619,7 @@ TAOS_STREAM *taos_open_stream(TAOS *taos, const char *sqlstr, void (*fp)(void *p
if
(
code
==
TSDB_CODE_SUCCESS
)
{
if
(
code
==
TSDB_CODE_SUCCESS
)
{
tscCreateStream
(
pStream
,
pSql
,
code
);
tscCreateStream
(
pStream
,
pSql
,
code
);
}
else
if
(
code
!=
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
}
else
if
(
code
!=
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
tscError
(
"%p open stream failed, sql:%s, code:%s"
,
pSql
,
sqlstr
,
tstrerror
(
pRes
->
code
));
tscError
(
"%p open stream failed, sql:%s, code:%s"
,
pSql
,
sqlstr
,
tstrerror
(
code
));
taosReleaseRef
(
tscObjRef
,
pSql
->
self
);
taosReleaseRef
(
tscObjRef
,
pSql
->
self
);
free
(
pStream
);
free
(
pStream
);
return
NULL
;
return
NULL
;
...
...
src/cq/src/cqMain.c
浏览文件 @
b0e0f973
...
@@ -311,7 +311,22 @@ void *cqCreate(void *handle, uint64_t uid, int32_t sid, const char* dstTable, ch
...
@@ -311,7 +311,22 @@ void *cqCreate(void *handle, uint64_t uid, int32_t sid, const char* dstTable, ch
SCqContext
*
pContext
=
handle
;
SCqContext
*
pContext
=
handle
;
int64_t
rid
=
0
;
int64_t
rid
=
0
;
SCqObj
*
pObj
=
calloc
(
sizeof
(
SCqObj
),
1
);
pthread_mutex_lock
(
&
pContext
->
mutex
);
SCqObj
*
pObj
=
pContext
->
pHead
;
while
(
pObj
)
{
if
(
pObj
->
uid
==
uid
)
{
rid
=
pObj
->
rid
;
pthread_mutex_unlock
(
&
pContext
->
mutex
);
return
(
void
*
)
rid
;
}
pObj
=
pObj
->
next
;
}
pthread_mutex_unlock
(
&
pContext
->
mutex
);
pObj
=
calloc
(
sizeof
(
SCqObj
),
1
);
if
(
pObj
==
NULL
)
return
NULL
;
if
(
pObj
==
NULL
)
return
NULL
;
pObj
->
uid
=
uid
;
pObj
->
uid
=
uid
;
...
@@ -389,9 +404,12 @@ static void doCreateStream(void *param, TAOS_RES *result, int32_t code) {
...
@@ -389,9 +404,12 @@ static void doCreateStream(void *param, TAOS_RES *result, int32_t code) {
SCqContext
*
pContext
=
pObj
->
pContext
;
SCqContext
*
pContext
=
pObj
->
pContext
;
SSqlObj
*
pSql
=
(
SSqlObj
*
)
result
;
SSqlObj
*
pSql
=
(
SSqlObj
*
)
result
;
if
(
code
==
TSDB_CODE_SUCCESS
)
{
if
(
atomic_val_compare_exchange_ptr
(
&
(
pContext
->
dbConn
),
NULL
,
pSql
->
pTscObj
)
!=
NULL
)
{
if
(
atomic_val_compare_exchange_ptr
(
&
(
pContext
->
dbConn
),
NULL
,
pSql
->
pTscObj
)
!=
NULL
)
{
taos_close
(
pSql
->
pTscObj
);
taos_close
(
pSql
->
pTscObj
);
}
}
}
pthread_mutex_lock
(
&
pContext
->
mutex
);
pthread_mutex_lock
(
&
pContext
->
mutex
);
cqCreateStream
(
pContext
,
pObj
);
cqCreateStream
(
pContext
,
pObj
);
pthread_mutex_unlock
(
&
pContext
->
mutex
);
pthread_mutex_unlock
(
&
pContext
->
mutex
);
...
@@ -427,6 +445,7 @@ static void cqCreateStream(SCqContext *pContext, SCqObj *pObj) {
...
@@ -427,6 +445,7 @@ static void cqCreateStream(SCqContext *pContext, SCqObj *pObj) {
pObj
->
tmrId
=
taosTmrStart
(
cqProcessCreateTimer
,
1000
,
(
void
*
)
pObj
->
rid
,
pContext
->
tmrCtrl
);
pObj
->
tmrId
=
taosTmrStart
(
cqProcessCreateTimer
,
1000
,
(
void
*
)
pObj
->
rid
,
pContext
->
tmrCtrl
);
return
;
return
;
}
}
pObj
->
tmrId
=
0
;
pObj
->
tmrId
=
0
;
if
(
pObj
->
pStream
==
NULL
)
{
if
(
pObj
->
pStream
==
NULL
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录