Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
39fa900c
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看板
提交
39fa900c
编写于
8月 09, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: wait for the vgroups have leader then create db return
上级
9cc08fbb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
6 deletion
+24
-6
source/dnode/mnode/impl/inc/mndDb.h
source/dnode/mnode/impl/inc/mndDb.h
+1
-0
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+2
-1
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+1
-1
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+20
-4
未找到文件。
source/dnode/mnode/impl/inc/mndDb.h
浏览文件 @
39fa900c
...
...
@@ -28,6 +28,7 @@ SDbObj *mndAcquireDb(SMnode *pMnode, const char *db);
void
mndReleaseDb
(
SMnode
*
pMnode
,
SDbObj
*
pDb
);
int32_t
mndValidateDbInfo
(
SMnode
*
pMnode
,
SDbVgVersion
*
pDbs
,
int32_t
numOfDbs
,
void
**
ppRsp
,
int32_t
*
pRspLen
);
int32_t
mndExtractDbInfo
(
SMnode
*
pMnode
,
SDbObj
*
pDb
,
SUseDbRsp
*
pRsp
,
const
SUseDbReq
*
pReq
);
bool
mndIsDbReady
(
SMnode
*
pMnode
,
SDbObj
*
pDb
);
const
char
*
mndGetDbStr
(
const
char
*
src
);
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
39fa900c
...
...
@@ -162,8 +162,9 @@ typedef struct {
int64_t
lastExecTime
;
int32_t
lastAction
;
int32_t
lastErrorNo
;
tmsg_t
lastMsgType
;
SEpSet
lastEpset
;
tmsg_t
lastMsgType
;
tmsg_t
originRpcType
;
char
dbname1
[
TSDB_TABLE_FNAME_LEN
];
char
dbname2
[
TSDB_TABLE_FNAME_LEN
];
int32_t
startFunc
;
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
39fa900c
...
...
@@ -1495,7 +1495,7 @@ static const char *getCacheModelStr(int8_t cacheModel) {
return
"unknown"
;
}
static
bool
mndIsDbReady
(
SMnode
*
pMnode
,
SDbObj
*
pDb
)
{
bool
mndIsDbReady
(
SMnode
*
pMnode
,
SDbObj
*
pDb
)
{
if
(
pDb
->
cfg
.
replications
==
1
)
return
true
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
39fa900c
...
...
@@ -124,8 +124,7 @@ static SSdbRaw *mndTransActionEncode(STrans *pTrans) {
SDB_SET_INT8
(
pRaw
,
dataPos
,
pTrans
->
exec
,
_OVER
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pTrans
->
oper
,
_OVER
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
0
,
_OVER
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
0
,
_OVER
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
0
,
_OVER
)
SDB_SET_INT16
(
pRaw
,
dataPos
,
pTrans
->
originRpcType
,
_OVER
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pTrans
->
createdTime
,
_OVER
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pTrans
->
dbname1
,
TSDB_TABLE_FNAME_LEN
,
_OVER
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pTrans
->
dbname2
,
TSDB_TABLE_FNAME_LEN
,
_OVER
)
...
...
@@ -282,13 +281,12 @@ static SSdbRow *mndTransActionDecode(SSdbRaw *pRaw) {
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
exec
,
_OVER
)
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
oper
,
_OVER
)
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
reserved
,
_OVER
)
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
reserved
,
_OVER
)
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
reserved
,
_OVER
)
pTrans
->
stage
=
stage
;
pTrans
->
policy
=
policy
;
pTrans
->
conflict
=
conflict
;
pTrans
->
exec
=
exec
;
pTrans
->
oper
=
oper
;
SDB_GET_INT16
(
pRaw
,
dataPos
,
&
pTrans
->
originRpcType
,
_OVER
)
SDB_GET_INT64
(
pRaw
,
dataPos
,
&
pTrans
->
createdTime
,
_OVER
)
SDB_GET_BINARY
(
pRaw
,
dataPos
,
pTrans
->
dbname1
,
TSDB_TABLE_FNAME_LEN
,
_OVER
)
SDB_GET_BINARY
(
pRaw
,
dataPos
,
pTrans
->
dbname2
,
TSDB_TABLE_FNAME_LEN
,
_OVER
)
...
...
@@ -611,6 +609,7 @@ STrans *mndTransCreate(SMnode *pMnode, ETrnPolicy policy, ETrnConflct conflict,
if
(
pReq
!=
NULL
)
{
taosArrayPush
(
pTrans
->
pRpcArray
,
&
pReq
->
info
);
pTrans
->
originRpcType
=
pReq
->
msgType
;
}
mTrace
(
"trans:%d, local object is created, data:%p"
,
pTrans
->
id
,
pTrans
);
return
pTrans
;
...
...
@@ -910,6 +909,23 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) {
}
}
if
(
pTrans
->
originRpcType
==
TDMT_MND_CREATE_DB
)
{
mDebug
(
"trans:%d, origin msgtype:%s"
,
pTrans
->
id
,
TMSG_INFO
(
pTrans
->
originRpcType
));
SDbObj
*
pDb
=
mndAcquireDb
(
pMnode
,
pTrans
->
dbname1
);
if
(
pDb
!=
NULL
)
{
for
(
int32_t
j
=
0
;
j
<
12
;
j
++
)
{
bool
ready
=
mndIsDbReady
(
pMnode
,
pDb
);
if
(
!
ready
)
{
mDebug
(
"trans:%d, db:%s not ready yet, wait %d times"
,
pTrans
->
id
,
pTrans
->
dbname1
,
j
);
taosMsleep
(
1000
);
}
else
{
break
;
}
}
}
mndReleaseDb
(
pMnode
,
pDb
);
}
tmsgSendRsp
(
&
rspMsg
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录