Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7296bf16
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看板
提交
7296bf16
编写于
7月 25, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: failed to create stb in 3 replica db
上级
d4abe20e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
6 deletion
+19
-6
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+4
-3
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+13
-1
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+2
-2
未找到文件。
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
7296bf16
...
...
@@ -641,6 +641,7 @@ static int32_t mndSetCreateStbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj
action
.
contLen
=
contLen
;
action
.
msgType
=
TDMT_VND_CREATE_STB
;
action
.
acceptableCode
=
TSDB_CODE_TDB_STB_ALREADY_EXIST
;
action
.
retryCode
=
TSDB_CODE_TDB_STB_NOT_EXIST
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
taosMemoryFree
(
pReq
);
sdbCancelFetch
(
pSdb
,
pIter
);
...
...
@@ -789,7 +790,7 @@ static int32_t mndCreateStb(SMnode *pMnode, SRpcMsg *pReq, SMCreateStbReq *pCrea
SStbObj
stbObj
=
{
0
};
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_CONFLICT_DB
_INSIDE
,
pReq
);
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_CONFLICT_DB
,
pReq
);
if
(
pTrans
==
NULL
)
goto
_OVER
;
mDebug
(
"trans:%d, used to create stb:%s"
,
pTrans
->
id
,
pCreate
->
name
);
...
...
@@ -1608,7 +1609,7 @@ static int32_t mndBuildSMAlterStbRsp(SDbObj *pDb, SStbObj *pObj, void **pCont, i
static
int32_t
mndAlterStbImp
(
SMnode
*
pMnode
,
SRpcMsg
*
pReq
,
SDbObj
*
pDb
,
SStbObj
*
pStb
,
bool
needRsp
,
void
*
alterOriData
,
int32_t
alterOriDataLen
)
{
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_CONFLICT_DB
_INSIDE
,
pReq
);
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_CONFLICT_DB
,
pReq
);
if
(
pTrans
==
NULL
)
goto
_OVER
;
mDebug
(
"trans:%d, used to alter stb:%s"
,
pTrans
->
id
,
pStb
->
name
);
...
...
@@ -1807,7 +1808,7 @@ static int32_t mndSetDropStbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *
static
int32_t
mndDropStb
(
SMnode
*
pMnode
,
SRpcMsg
*
pReq
,
SDbObj
*
pDb
,
SStbObj
*
pStb
)
{
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_CONFLICT_DB
_INSIDE
,
pReq
);
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_CONFLICT_DB
,
pReq
);
if
(
pTrans
==
NULL
)
goto
_OVER
;
mDebug
(
"trans:%d, used to drop stb:%s"
,
pTrans
->
id
,
pStb
->
name
);
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
7296bf16
...
...
@@ -794,7 +794,6 @@ static bool mndCheckTransConflict(SMnode *pMnode, STrans *pNew) {
mError
(
"trans:%d, can't execute since conflict with trans:%d, db1:%s db2:%s"
,
pNew
->
id
,
pTrans
->
id
,
pTrans
->
dbname1
,
pTrans
->
dbname2
);
conflict
=
true
;
sdbRelease
(
pMnode
->
pSdb
,
pTrans
);
}
...
...
@@ -1290,6 +1289,19 @@ static bool mndTransPerformRedoActionStage(SMnode *pMnode, STrans *pTrans) {
}
else
{
pTrans
->
code
=
terrno
;
if
(
pTrans
->
policy
==
TRN_POLICY_ROLLBACK
)
{
if
(
pTrans
->
lastAction
!=
0
)
{
STransAction
*
pAction
=
taosArrayGet
(
pTrans
->
redoActions
,
pTrans
->
lastAction
);
if
(
pAction
->
retryCode
!=
0
&&
pAction
->
retryCode
!=
pAction
->
errCode
)
{
if
(
pTrans
->
failedTimes
<
6
)
{
mError
(
"trans:%d, stage keep on redoAction since action:%d code:0x%x not 0x%x, failedTimes:%d"
,
pTrans
->
id
,
pTrans
->
lastAction
,
pTrans
->
code
,
pAction
->
retryCode
,
pTrans
->
failedTimes
);
taosMsleep
(
1000
);
continueExec
=
true
;
return
true
;
}
}
}
pTrans
->
stage
=
TRN_STAGE_ROLLBACK
;
mError
(
"trans:%d, stage from redoAction to rollback since %s"
,
pTrans
->
id
,
terrstr
());
continueExec
=
true
;
...
...
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
7296bf16
...
...
@@ -178,7 +178,7 @@ int metaCreateSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
if
(
metaGetTableEntryByName
(
&
mr
,
pReq
->
name
)
==
0
)
{
// TODO: just for pass case
#if 0
terrno = TSDB_CODE_TDB_
TABLE
_ALREADY_EXIST;
terrno = TSDB_CODE_TDB_
STB
_ALREADY_EXIST;
metaReaderClear(&mr);
return -1;
#else
...
...
@@ -223,7 +223,7 @@ int metaDropSTable(SMeta *pMeta, int64_t verison, SVDropStbReq *pReq, SArray *tb
// check if super table exists
rc
=
tdbTbGet
(
pMeta
->
pNameIdx
,
pReq
->
name
,
strlen
(
pReq
->
name
)
+
1
,
&
pData
,
&
nData
);
if
(
rc
<
0
||
*
(
tb_uid_t
*
)
pData
!=
pReq
->
suid
)
{
terrno
=
TSDB_CODE_
VND_TABLE
_NOT_EXIST
;
terrno
=
TSDB_CODE_
TDB_STB
_NOT_EXIST
;
return
-
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录