Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b383651d
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看板
提交
b383651d
编写于
5月 13, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(tmq): fix the invalid write and set the flag when closing taosx sub.
上级
5b2ef2a6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
49 addition
and
46 deletion
+49
-46
source/dnode/vnode/src/inc/tq.h
source/dnode/vnode/src/inc/tq.h
+1
-8
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+8
-1
source/dnode/vnode/src/tq/tqUtil.c
source/dnode/vnode/src/tq/tqUtil.c
+9
-7
tests/script/tsim/alter/table.sim
tests/script/tsim/alter/table.sim
+30
-29
tests/script/tsim/parser/alter_column.sim
tests/script/tsim/parser/alter_column.sim
+1
-1
未找到文件。
source/dnode/vnode/src/inc/tq.h
浏览文件 @
b383651d
...
...
@@ -105,13 +105,6 @@ typedef struct {
int8_t
exec
;
}
STqHandle
;
typedef
struct
{
SMqDataRsp
*
pDataRsp
;
char
subKey
[
TSDB_SUBSCRIBE_KEY_LEN
];
SRpcHandleInfo
info
;
STqHandle
*
pHandle
;
}
STqPushEntry
;
struct
STQ
{
SVnode
*
pVnode
;
char
*
path
;
...
...
@@ -190,7 +183,7 @@ int32_t tqExtractDataForMq(STQ* pTq, STqHandle* pHandle, const SMqPollReq* pRequ
int32_t
tqDoSendDataRsp
(
const
SRpcHandleInfo
*
pRpcHandleInfo
,
const
SMqDataRsp
*
pRsp
,
int32_t
epoch
,
int64_t
consumerId
,
int32_t
type
,
int64_t
sver
,
int64_t
ever
);
int32_t
tqInitDataRsp
(
SMqDataRsp
*
pRsp
,
const
SMqPollReq
*
pReq
);
bool
tqIsHandleExecuting
(
STqHandle
*
pHandle
);
#ifdef __cplusplus
}
#endif
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
b383651d
...
...
@@ -545,8 +545,9 @@ int32_t tqProcessVgWalInfoReq(STQ* pTq, SRpcMsg* pMsg) {
int32_t
tqProcessDeleteSubReq
(
STQ
*
pTq
,
int64_t
sversion
,
char
*
msg
,
int32_t
msgLen
)
{
SMqVDeleteReq
*
pReq
=
(
SMqVDeleteReq
*
)
msg
;
int32_t
vgId
=
TD_VID
(
pTq
->
pVnode
);
tqDebug
(
"vgId:%d, tq process delete sub req %s"
,
pTq
->
pVnode
->
config
.
vgId
,
pReq
->
subKey
);
tqDebug
(
"vgId:%d, tq process delete sub req %s"
,
vgId
,
pReq
->
subKey
);
int32_t
code
=
0
;
// taosWLockLatch(&pTq->lock);
// int32_t code = taosHashRemove(pTq->pPushMgr, pReq->subKey, strlen(pReq->subKey));
...
...
@@ -561,6 +562,12 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
if
(
pHandle
->
pRef
)
{
walCloseRef
(
pTq
->
pVnode
->
pWal
,
pHandle
->
pRef
->
refId
);
}
while
(
tqIsHandleExecuting
(
pHandle
))
{
tqDebug
(
"vgId:%d, topic:%s, subscription is executing, wait for 5ms and retry"
,
vgId
,
pHandle
->
subKey
);
taosMsleep
(
5
);
}
code
=
taosHashRemove
(
pTq
->
pHandle
,
pReq
->
subKey
,
strlen
(
pReq
->
subKey
));
if
(
code
!=
0
)
{
tqError
(
"cannot process tq delete req %s, since no such handle"
,
pReq
->
subKey
);
...
...
source/dnode/vnode/src/tq/tqUtil.c
浏览文件 @
b383651d
...
...
@@ -162,9 +162,7 @@ static int32_t extractResetOffsetVal(STqOffsetVal* pOffsetVal, STQ* pTq, STqHand
return
0
;
}
static
bool
isHandleExecuting
(
STqHandle
*
pHandle
){
return
1
==
atomic_load_8
(
&
pHandle
->
exec
);
}
bool
tqIsHandleExecuting
(
STqHandle
*
pHandle
)
{
return
1
==
atomic_load_8
(
&
pHandle
->
exec
);
}
static
int32_t
extractDataAndRspForNormalSubscribe
(
STQ
*
pTq
,
STqHandle
*
pHandle
,
const
SMqPollReq
*
pRequest
,
SRpcMsg
*
pMsg
,
STqOffsetVal
*
pOffset
)
{
...
...
@@ -181,8 +179,9 @@ static int32_t extractDataAndRspForNormalSubscribe(STQ* pTq, STqHandle* pHandle,
// return code;
// }
while
(
isHandleExecuting
(
pHandle
)){
tqInfo
(
"sub is executing, pHandle:%p"
,
pHandle
);
// todo add more status check to avoid race condition
while
(
tqIsHandleExecuting
(
pHandle
))
{
tqDebug
(
"vgId:%d, topic:%s, subscription is executing, wait for 5ms and retry"
,
vgId
,
pHandle
->
subKey
);
taosMsleep
(
5
);
}
...
...
@@ -241,10 +240,11 @@ static int32_t extractDataAndRspForDbStbSubscribe(STQ* pTq, STqHandle* pHandle,
// return code;
// }
while
(
isHandleExecuting
(
pHandle
))
{
tq
Info
(
"sub is executing, pHandle:%p"
,
pHandle
);
while
(
tqIsHandleExecuting
(
pHandle
))
{
tq
Debug
(
"vgId:%d, topic:%s, subscription is executing, wait for 5ms and retry"
,
vgId
,
pHandle
->
subKey
);
taosMsleep
(
5
);
}
atomic_store_8
(
&
pHandle
->
exec
,
1
);
if
(
offset
->
type
!=
TMQ_OFFSET__LOG
)
{
...
...
@@ -266,6 +266,7 @@ static int32_t extractDataAndRspForDbStbSubscribe(STQ* pTq, STqHandle* pHandle,
if
(
taosxRsp
.
blockNum
>
0
)
{
code
=
tqSendDataRsp
(
pHandle
,
pMsg
,
pRequest
,
(
SMqDataRsp
*
)
&
taosxRsp
,
TMQ_MSG_TYPE__TAOSX_RSP
,
vgId
);
tDeleteSTaosxRsp
(
&
taosxRsp
);
atomic_store_8
(
&
pHandle
->
exec
,
0
);
return
code
;
}
else
{
*
offset
=
taosxRsp
.
rspOffset
;
...
...
@@ -281,6 +282,7 @@ static int32_t extractDataAndRspForDbStbSubscribe(STQ* pTq, STqHandle* pHandle,
code
=
-
1
;
goto
end
;
}
walSetReaderCapacity
(
pHandle
->
pWalReader
,
2048
);
int
totalRows
=
0
;
while
(
1
)
{
...
...
tests/script/tsim/alter/table.sim
浏览文件 @
b383651d
...
...
@@ -657,35 +657,36 @@ if $data20 != null then
return -1
endi
print =============== error for normal table
sql create table tb2023(ts timestamp, f int);
sql_error alter table tb2023 add column v varchar(65535);
sql_error alter table tb2023 add column v varchar(65535);
sql_error alter table tb2023 add column v varchar(65530);
sql alter table tb2023 add column v varchar(16374);
sql_error alter table tb2023 modify column v varchar(16375);
sql desc tb2023
sql alter table tb2023 drop column v
sql_error alter table tb2023 add column v nchar(4094);
sql alter table tb2023 add column v nchar(4093);
sql_error alter table tb2023 modify column v nchar(4094);
sql_error alter table tb2023 add column v nchar(16384);
sql alter table tb2023 add column v nchar(16374);
sql desc tb2023
print =============== error for super table
sql create table stb2023(ts timestamp, f int) tags(t1 int);
sql_error alter table stb2023 add column v varchar(16375);
sql_error alter table stb2023 add column v varchar(16385);
sql_error alter table stb2023 add column v varchar(33100);
sql alter table stb2023 add column v varchar(16374);
sql_error alter table stb2023 modify column v varchar(16375);
sql desc stb2023
sql alter table stb2023 drop column v
sql_error alter table stb2023 add column v nchar(4094);
sql alter table stb2023 add column v nchar(4093);
sql_error alter table stb2023 modify column v nchar(4094);
sql desc stb2023
#print =============== error for normal table
#sql create table tb2023(ts timestamp, f int);
#sql_error alter table tb2023 add column v varchar(65535);
#sql_error alter table tb2023 add column v varchar(65535);
#sql_error alter table tb2023 add column v varchar(65530);
#sql alter table tb2023 add column v varchar(16374);
#sql_error alter table tb2023 modify column v varchar(65536);
#sql desc tb2023
#sql alter table tb2023 drop column v
#sql_error alter table tb2023 add column v nchar(16384);
#sql alter table tb2023 add column v nchar(4093);
#sql_error alter table tb2023 modify column v nchar(16384);
#sql_error alter table tb2023 add column v nchar(16384);
#sql alter table tb2023 drop column v
#sql alter table tb2023 add column v nchar(16374);
#sql desc tb2023
#
#print =============== error for super table
#sql create table stb2023(ts timestamp, f int) tags(t1 int);
#sql_error alter table stb2023 add column v varchar(65535);
#sql_error alter table stb2023 add column v varchar(65536);
#sql_error alter table stb2023 add column v varchar(33100);
#sql alter table stb2023 add column v varchar(16374);
#sql_error alter table stb2023 modify column v varchar(16375);
#sql desc stb2023
#sql alter table stb2023 drop column v
#sql_error alter table stb2023 add column v nchar(4094);
#sql alter table stb2023 add column v nchar(4093);
#sql_error alter table stb2023 modify column v nchar(4094);
#sql desc stb2023
print ======= over
sql drop database d1
...
...
tests/script/tsim/parser/alter_column.sim
浏览文件 @
b383651d
...
...
@@ -48,7 +48,7 @@ sql_error alter table tb modify column c2 binary(10);
sql_error alter table tb modify column c2 binary(9);
sql_error alter table tb modify column c2 binary(-9);
sql_error alter table tb modify column c2 binary(0);
sql_error alter table tb modify column c2 binary(
170
00);
sql_error alter table tb modify column c2 binary(
656
00);
sql_error alter table tb modify column c2 nchar(30);
sql_error alter table tb modify column c3 double;
sql_error alter table tb modify column c3 nchar(10);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录