Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e571ddf3
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看板
提交
e571ddf3
编写于
1月 12, 2023
作者:
K
kailixu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: tsma transaction refactor
上级
a696cd9f
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
23 addition
and
5 deletion
+23
-5
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+4
-0
source/dnode/mnode/impl/src/mndSma.c
source/dnode/mnode/impl/src/mndSma.c
+16
-2
source/dnode/vnode/src/sma/smaTimeRange.c
source/dnode/vnode/src/sma/smaTimeRange.c
+1
-3
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+1
-0
tests/script/tsim/sma/tsmaCreateInsertQuery.sim
tests/script/tsim/sma/tsmaCreateInsertQuery.sim
+1
-0
未找到文件。
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
浏览文件 @
e571ddf3
...
@@ -157,6 +157,7 @@ static int32_t vmTsmaAdjustDays(SVnodeCfg *pCfg, SCreateVnodeReq *pReq) {
...
@@ -157,6 +157,7 @@ static int32_t vmTsmaAdjustDays(SVnodeCfg *pCfg, SCreateVnodeReq *pReq) {
return
0
;
return
0
;
}
}
#if 0
static int32_t vmTsmaProcessCreate(SVnode *pVnode, SCreateVnodeReq *pReq) {
static int32_t vmTsmaProcessCreate(SVnode *pVnode, SCreateVnodeReq *pReq) {
if (pReq->isTsma) {
if (pReq->isTsma) {
SMsgHead *smaMsg = pReq->pTsma;
SMsgHead *smaMsg = pReq->pTsma;
...
@@ -165,6 +166,7 @@ static int32_t vmTsmaProcessCreate(SVnode *pVnode, SCreateVnodeReq *pReq) {
...
@@ -165,6 +166,7 @@ static int32_t vmTsmaProcessCreate(SVnode *pVnode, SCreateVnodeReq *pReq) {
}
}
return 0;
return 0;
}
}
#endif
int32_t
vmProcessCreateVnodeReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
int32_t
vmProcessCreateVnodeReq
(
SVnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
SCreateVnodeReq
req
=
{
0
};
SCreateVnodeReq
req
=
{
0
};
...
@@ -245,12 +247,14 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
...
@@ -245,12 +247,14 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
goto
_OVER
;
goto
_OVER
;
}
}
#if 0
code = vmTsmaProcessCreate(pImpl, &req);
code = vmTsmaProcessCreate(pImpl, &req);
if (code != 0) {
if (code != 0) {
dError("vgId:%d, failed to create tsma since %s", req.vgId, terrstr());
dError("vgId:%d, failed to create tsma since %s", req.vgId, terrstr());
code = terrno;
code = terrno;
goto _OVER;
goto _OVER;
}
}
#endif
code
=
vnodeStart
(
pImpl
);
code
=
vnodeStart
(
pImpl
);
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
...
...
source/dnode/mnode/impl/src/mndSma.c
浏览文件 @
e571ddf3
...
@@ -457,8 +457,10 @@ static int32_t mndSetCreateSmaVgroupRedoActions(SMnode *pMnode, STrans *pTrans,
...
@@ -457,8 +457,10 @@ static int32_t mndSetCreateSmaVgroupRedoActions(SMnode *pMnode, STrans *pTrans,
int32_t
contLen
=
0
;
int32_t
contLen
=
0
;
void
*
pReq
=
mndBuildCreateVnodeReq
(
pMnode
,
pDnode
,
pDb
,
pVgroup
,
&
contLen
);
void
*
pReq
=
mndBuildCreateVnodeReq
(
pMnode
,
pDnode
,
pDb
,
pVgroup
,
&
contLen
);
if
(
pReq
==
NULL
)
{
taosMemoryFreeClear
(
pSmaReq
);
taosMemoryFreeClear
(
pSmaReq
);
if
(
pReq
==
NULL
)
return
-
1
;
return
-
1
;
}
action
.
pCont
=
pReq
;
action
.
pCont
=
pReq
;
action
.
contLen
=
contLen
;
action
.
contLen
=
contLen
;
...
@@ -466,6 +468,18 @@ static int32_t mndSetCreateSmaVgroupRedoActions(SMnode *pMnode, STrans *pTrans,
...
@@ -466,6 +468,18 @@ static int32_t mndSetCreateSmaVgroupRedoActions(SMnode *pMnode, STrans *pTrans,
action
.
acceptableCode
=
TSDB_CODE_VND_ALREADY_EXIST
;
action
.
acceptableCode
=
TSDB_CODE_VND_ALREADY_EXIST
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
taosMemoryFreeClear
(
pSmaReq
);
taosMemoryFree
(
pReq
);
return
-
1
;
}
action
.
pCont
=
pSmaReq
;
action
.
contLen
=
smaContLen
;
action
.
msgType
=
TDMT_VND_CREATE_SMA
;
action
.
acceptableCode
=
TSDB_CODE_TSMA_ALREADY_EXIST
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
taosMemoryFreeClear
(
pSmaReq
);
taosMemoryFree
(
pReq
);
taosMemoryFree
(
pReq
);
return
-
1
;
return
-
1
;
}
}
...
...
source/dnode/vnode/src/sma/smaTimeRange.c
浏览文件 @
e571ddf3
...
@@ -25,14 +25,13 @@ static int32_t tdProcessTSmaCreateImpl(SSma *pSma, int64_t version, const char *
...
@@ -25,14 +25,13 @@ static int32_t tdProcessTSmaCreateImpl(SSma *pSma, int64_t version, const char *
static
int32_t
tdProcessTSmaInsertImpl
(
SSma
*
pSma
,
int64_t
indexUid
,
const
char
*
msg
);
static
int32_t
tdProcessTSmaInsertImpl
(
SSma
*
pSma
,
int64_t
indexUid
,
const
char
*
msg
);
static
int32_t
tdProcessTSmaGetDaysImpl
(
SVnodeCfg
*
pCfg
,
void
*
pCont
,
uint32_t
contLen
,
int32_t
*
days
);
static
int32_t
tdProcessTSmaGetDaysImpl
(
SVnodeCfg
*
pCfg
,
void
*
pCont
,
uint32_t
contLen
,
int32_t
*
days
);
// TODO: Who is responsible for resource allocate and release?
int32_t
tdProcessTSmaInsert
(
SSma
*
pSma
,
int64_t
indexUid
,
const
char
*
msg
)
{
int32_t
tdProcessTSmaInsert
(
SSma
*
pSma
,
int64_t
indexUid
,
const
char
*
msg
)
{
int32_t
code
=
TSDB_CODE_SUCCESS
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
if
((
code
=
tdProcessTSmaInsertImpl
(
pSma
,
indexUid
,
msg
))
<
0
)
{
if
((
code
=
tdProcessTSmaInsertImpl
(
pSma
,
indexUid
,
msg
))
<
0
)
{
smaWarn
(
"vgId:%d, insert tsma data failed since %s"
,
SMA_VID
(
pSma
),
tstrerror
(
terrno
));
smaWarn
(
"vgId:%d, insert tsma data failed since %s"
,
SMA_VID
(
pSma
),
tstrerror
(
terrno
));
}
}
// TODO: destroy SSDataBlocks(msg)
return
code
;
return
code
;
}
}
...
@@ -42,7 +41,6 @@ int32_t tdProcessTSmaCreate(SSma *pSma, int64_t version, const char *msg) {
...
@@ -42,7 +41,6 @@ int32_t tdProcessTSmaCreate(SSma *pSma, int64_t version, const char *msg) {
if
((
code
=
tdProcessTSmaCreateImpl
(
pSma
,
version
,
msg
))
<
0
)
{
if
((
code
=
tdProcessTSmaCreateImpl
(
pSma
,
version
,
msg
))
<
0
)
{
smaWarn
(
"vgId:%d, create tsma failed since %s"
,
SMA_VID
(
pSma
),
tstrerror
(
terrno
));
smaWarn
(
"vgId:%d, create tsma failed since %s"
,
SMA_VID
(
pSma
),
tstrerror
(
terrno
));
}
}
// TODO: destroy SSDataBlocks(msg)
return
code
;
return
code
;
}
}
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
e571ddf3
...
@@ -1716,6 +1716,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
...
@@ -1716,6 +1716,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
/*resetTableScanInfo(pTSInfo, pWin);*/
/*resetTableScanInfo(pTSInfo, pWin);*/
tsdbReaderClose
(
pTSInfo
->
base
.
dataReader
);
tsdbReaderClose
(
pTSInfo
->
base
.
dataReader
);
pTSInfo
->
base
.
dataReader
=
NULL
;
pTSInfo
->
base
.
dataReader
=
NULL
;
pInfo
->
pTableScanOp
->
status
=
OP_OPENED
;
pTSInfo
->
scanTimes
=
0
;
pTSInfo
->
scanTimes
=
0
;
pTSInfo
->
currentGroupId
=
-
1
;
pTSInfo
->
currentGroupId
=
-
1
;
...
...
tests/script/tsim/sma/tsmaCreateInsertQuery.sim
浏览文件 @
e571ddf3
...
@@ -6,6 +6,7 @@ sql connect
...
@@ -6,6 +6,7 @@ sql connect
print =============== create database
print =============== create database
sql create database d1 keep 36500d vgroups 1
sql create database d1 keep 36500d vgroups 1
sql alter local 'querySmaOptimize' '1';
sql use d1
sql use d1
print =============== create super table, include column type for count/sum/min/max/first
print =============== create super table, include column type for count/sum/min/max/first
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录