Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
87bff867
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看板
提交
87bff867
编写于
8月 02, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-1038]
上级
d7fbf6b1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
34 addition
and
11 deletion
+34
-11
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+8
-2
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+5
-5
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+21
-4
未找到文件。
src/mnode/src/mnodeSdb.c
浏览文件 @
87bff867
...
...
@@ -487,8 +487,14 @@ static int32_t sdbInsertHash(SSdbTable *pTable, SSdbOper *pOper) {
sdbDebug
(
"table:%s, insert record:%s to hash, rowSize:%d numOfRows:%"
PRId64
", msg:%p"
,
pTable
->
tableName
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
),
pOper
->
rowSize
,
pTable
->
numOfRows
,
pOper
->
pMsg
);
(
*
pTable
->
insertFp
)(
pOper
);
return
TSDB_CODE_SUCCESS
;
int32_t
code
=
(
*
pTable
->
insertFp
)(
pOper
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
sdbError
(
"table:%s, failed to insert record:%s to hash, remove it"
,
pTable
->
tableName
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
));
sdbDeleteHash
(
pTable
,
pOper
);
}
return
code
;
}
static
int32_t
sdbDeleteHash
(
SSdbTable
*
pTable
,
SSdbOper
*
pOper
)
{
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
87bff867
...
...
@@ -2351,11 +2351,11 @@ static void mnodeProcessCreateChildTableRsp(SRpcMsg *rpcMsg) {
// if the vgroup is already dropped from hash, it can't be accquired by pTable->vgId
// so the refCount of vgroup can not be decreased
SVgObj
*
pVgroup
=
mnodeGetVgroup
(
pTable
->
vgId
);
if
(
pVgroup
==
NULL
)
{
mnodeRemoveTableFromVgroup
(
pVgroup
,
pTable
);
}
mnodeDecVgroupRef
(
pVgroup
);
//
SVgObj *pVgroup = mnodeGetVgroup(pTable->vgId);
//
if (pVgroup == NULL) {
// mnodeRemoveTableFromVgroup(mnodeMsg->
pVgroup, pTable);
//
}
//
mnodeDecVgroupRef(pVgroup);
mnodeSendDropChildTableMsg
(
mnodeMsg
,
false
);
rpcMsg
->
code
=
TSDB_CODE_SUCCESS
;
...
...
src/mnode/src/mnodeVgroup.c
浏览文件 @
87bff867
...
...
@@ -83,11 +83,12 @@ static int32_t mnodeVgroupActionInsert(SSdbOper *pOper) {
// refer to db
SDbObj
*
pDb
=
mnodeGetDb
(
pVgroup
->
dbName
);
if
(
pDb
==
NULL
)
{
mError
(
"vgId:%d, db:%s is not exist while insert into hash"
,
pVgroup
->
vgId
,
pVgroup
->
dbName
);
return
TSDB_CODE_MND_INVALID_DB
;
}
if
(
pDb
->
status
!=
TSDB_DB_STATUS_READY
)
{
mError
(
"
db:%s, status:%d, in dropping"
,
pDb
->
name
,
pDb
->
status
);
mError
(
"
vgId:%d, db:%s status:%d, in dropping"
,
pVgroup
->
vgId
,
pDb
->
name
,
pDb
->
status
);
return
TSDB_CODE_MND_DB_IN_DROPPING
;
}
...
...
@@ -116,10 +117,12 @@ static int32_t mnodeVgroupActionInsert(SSdbOper *pOper) {
static
int32_t
mnodeVgroupActionDelete
(
SSdbOper
*
pOper
)
{
SVgObj
*
pVgroup
=
pOper
->
pObj
;
if
(
pVgroup
->
pDb
!=
NULL
)
{
mnodeRemoveVgroupFromDb
(
pVgroup
);
if
(
pVgroup
->
pDb
==
NULL
)
{
mError
(
"vgId:%d, db:%s is not exist while insert into hash"
,
pVgroup
->
vgId
,
pVgroup
->
dbName
);
return
TSDB_CODE_MND_VGROUP_NOT_EXIST
;
}
mnodeRemoveVgroupFromDb
(
pVgroup
);
mnodeDecDbRef
(
pVgroup
->
pDb
);
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
...
...
@@ -517,6 +520,19 @@ static int32_t mnodeCreateVgroupCb(SMnodeMsg *pMsg, int32_t code) {
dnodeReprocessMnodeWriteMsg
(
pMsg
);
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
// if (pVgroup->status == TAOS_VG_STATUS_CREATING || pVgroup->status == TAOS_VG_STATUS_READY) {
// mInfo("app:%p:%p, vgId:%d, is created in sdb, db:%s replica:%d", pMsg->rpcMsg.ahandle, pMsg, pVgroup->vgId,
// pDb->name, pVgroup->numOfVnodes);
// pVgroup->status = TAOS_VG_STATUS_READY;
// SSdbOper desc = {.type = SDB_OPER_GLOBAL, .pObj = pVgroup, .table = tsVgroupSdb};
// (void)sdbUpdateRow(&desc);
// dnodeReprocessMnodeWriteMsg(pMsg);
// return TSDB_CODE_MND_ACTION_IN_PROGRESS;
// } else {
// mError("app:%p:%p, vgId:%d, is created in sdb, db:%s replica:%d, but vgroup is dropping", pMsg->rpcMsg.ahandle,
// pMsg, pVgroup->vgId, pDb->name, pVgroup->numOfVnodes);
// return TSDB_CODE_MND_VGROUP_NOT_EXIST;
// }
}
}
...
...
@@ -955,7 +971,7 @@ void mnodeSendDropVnodeMsg(int32_t vgId, SRpcEpSet *epSet, void *ahandle) {
static
void
mnodeSendDropVgroupMsg
(
SVgObj
*
pVgroup
,
void
*
ahandle
)
{
pVgroup
->
status
=
TAOS_VG_STATUS_DROPPING
;
// deleting
mDebug
(
"vgId:%d, send drop all vnodes msg, ahandle:%p
"
,
pVgroup
->
vgId
,
ahandl
e
);
mDebug
(
"vgId:%d, send drop all vnodes msg, ahandle:%p
db:%s"
,
pVgroup
->
vgId
,
ahandle
,
pVgroup
->
dbNam
e
);
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
SRpcEpSet
epSet
=
mnodeGetEpSetFromIp
(
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodeEp
);
mDebug
(
"vgId:%d, send drop vnode msg to dnode:%d, ahandle:%p"
,
pVgroup
->
vgId
,
pVgroup
->
vnodeGid
[
i
].
dnodeId
,
ahandle
);
...
...
@@ -1117,6 +1133,7 @@ void mnodeSendDropAllDbVgroupsMsg(SDbObj *pDropDb) {
}
mnodeDecVgroupRef
(
pVgroup
);
numOfVgroups
++
;
}
sdbFreeIter
(
pIter
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录