Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
0b1cab6c
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0b1cab6c
编写于
5月 09, 2020
作者:
guanshengliang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug while drop sdb
上级
924c46bb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
25 deletion
+29
-25
src/dnode/src/dnodeVWrite.c
src/dnode/src/dnodeVWrite.c
+1
-1
src/inc/taosmsg.h
src/inc/taosmsg.h
+1
-0
src/mnode/src/mgmtTable.c
src/mnode/src/mgmtTable.c
+26
-23
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+1
-1
未找到文件。
src/dnode/src/dnodeVWrite.c
浏览文件 @
0b1cab6c
...
...
@@ -85,7 +85,7 @@ void dnodeCleanupWrite() {
void
dnodeDispatchToVnodeWriteQueue
(
SRpcMsg
*
pMsg
)
{
char
*
pCont
=
(
char
*
)
pMsg
->
pCont
;
if
(
pMsg
->
msgType
==
TSDB_MSG_TYPE_SUBMIT
||
pMsg
->
msgType
==
TSDB_MSG_TYPE_MD_DROP_STABLE
)
{
if
(
pMsg
->
msgType
==
TSDB_MSG_TYPE_SUBMIT
)
{
SMsgDesc
*
pDesc
=
(
SMsgDesc
*
)
pCont
;
pDesc
->
numOfVnodes
=
htonl
(
pDesc
->
numOfVnodes
);
pCont
+=
sizeof
(
SMsgDesc
);
...
...
src/inc/taosmsg.h
浏览文件 @
0b1cab6c
...
...
@@ -326,6 +326,7 @@ typedef struct {
}
SMDDropTableMsg
;
typedef
struct
{
int32_t
contLen
;
int32_t
vgId
;
int64_t
uid
;
char
tableId
[
TSDB_TABLE_ID_LEN
+
1
];
...
...
src/mnode/src/mgmtTable.c
浏览文件 @
0b1cab6c
...
...
@@ -701,10 +701,10 @@ static void mgmtProcessDropTableMsg(SQueuedMsg *pMsg) {
}
if
(
pMsg
->
pTable
->
type
==
TSDB_SUPER_TABLE
)
{
m
Trace
(
"table:%s, start to drop stable"
,
pDrop
->
tableId
);
m
Print
(
"table:%s, start to drop stable"
,
pDrop
->
tableId
);
mgmtProcessDropSuperTableMsg
(
pMsg
);
}
else
{
m
Trace
(
"table:%s, start to drop ctable"
,
pDrop
->
tableId
);
m
Print
(
"table:%s, start to drop ctable"
,
pDrop
->
tableId
);
mgmtProcessDropChildTableMsg
(
pMsg
);
}
}
...
...
@@ -802,29 +802,32 @@ static void mgmtProcessDropSuperTableMsg(SQueuedMsg *pMsg) {
int32_t
vgId
=
pStable
->
vgList
[
vg
];
if
(
vgId
==
0
)
break
;
SVgObj
*
pVgroup
=
mgmtGetVgroup
(
vgId
);
if
(
pVgroup
==
NULL
)
break
;
SMDDropSTableMsg
*
pDrop
=
rpcMallocCont
(
sizeof
(
SMDDropSTableMsg
));
pDrop
->
contLen
=
htonl
(
sizeof
(
SMDDropSTableMsg
));
pDrop
->
vgId
=
htonl
(
vgId
);
pDrop
->
uid
=
htobe64
(
pStable
->
uid
);
mgmtExtractTableName
(
pStable
->
info
.
tableId
,
pDrop
->
tableId
);
SVgObj
*
pVgroup
=
mgmtGetVgroup
(
vgId
);
if
(
pVgroup
!=
NULL
)
{
SRpcIpSet
ipSet
=
mgmtGetIpSetFromVgroup
(
pVgroup
);
SRpcMsg
rpcMsg
=
{.
pCont
=
pDrop
,
.
contLen
=
sizeof
(
SMDDropSTableMsg
),
.
msgType
=
TSDB_MSG_TYPE_MD_DROP_STABLE
};
dnodeSendMsgToDnode
(
&
ipSet
,
&
rpcMsg
);
mgmtDecVgroupRef
(
pVgroup
);
}
mPrint
(
"stable:%s, send drop stable msg to vgId:%d"
,
pStable
->
info
.
tableId
,
vgId
);
SRpcIpSet
ipSet
=
mgmtGetIpSetFromVgroup
(
pVgroup
);
SRpcMsg
rpcMsg
=
{.
pCont
=
pDrop
,
.
contLen
=
sizeof
(
SMDDropSTableMsg
),
.
msgType
=
TSDB_MSG_TYPE_MD_DROP_STABLE
};
dnodeSendMsgToDnode
(
&
ipSet
,
&
rpcMsg
);
mgmtDecVgroupRef
(
pVgroup
);
}
}
else
{
SSdbOper
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
};
int32_t
code
=
sdbDeleteRow
(
&
oper
);
mLPrint
(
"stable:%s, is dropped from sdb, result:%s"
,
pStable
->
info
.
tableId
,
tstrerror
(
code
));
mgmtSendSimpleResp
(
pMsg
->
thandle
,
code
);
}
}
SSdbOper
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
};
int32_t
code
=
sdbDeleteRow
(
&
oper
);
mLPrint
(
"stable:%s, is dropped from sdb, result:%s"
,
pStable
->
info
.
tableId
,
tstrerror
(
code
));
mgmtSendSimpleResp
(
pMsg
->
thandle
,
code
);
}
static
int32_t
mgmtFindSuperTableTagIndex
(
SSuperTableObj
*
pStable
,
const
char
*
tagName
)
{
...
...
@@ -1303,7 +1306,7 @@ static void mgmtProcessSuperTableVgroupMsg(SQueuedMsg *pMsg) {
}
static
void
mgmtProcessDropSuperTableRsp
(
SRpcMsg
*
rpcMsg
)
{
mTrace
(
"drop stable rsp received, handle:%p code:%s"
,
rpcMsg
->
handle
,
tstrerror
(
rpcMsg
->
code
));
mPrint
(
"drop stable rsp received, result:%s"
,
tstrerror
(
rpcMsg
->
code
));
}
static
void
*
mgmtBuildCreateChildTableMsg
(
SCMCreateTableMsg
*
pMsg
,
SChildTableObj
*
pTable
)
{
...
...
@@ -1540,7 +1543,7 @@ static void mgmtProcessDropChildTableMsg(SQueuedMsg *pMsg) {
SRpcIpSet
ipSet
=
mgmtGetIpSetFromVgroup
(
pMsg
->
pVgroup
);
m
Trace
(
"table:%s, send drop ctable msg"
,
pDrop
->
tableId
);
m
Print
(
"table:%s, send drop ctable msg"
,
pDrop
->
tableId
);
SQueuedMsg
*
newMsg
=
mgmtCloneQueuedMsg
(
pMsg
);
newMsg
->
ahandle
=
pMsg
->
pTable
;
SRpcMsg
rpcMsg
=
{
...
...
@@ -1867,7 +1870,7 @@ static void mgmtProcessDropChildTableRsp(SRpcMsg *rpcMsg) {
queueMsg
->
received
++
;
SChildTableObj
*
pTable
=
queueMsg
->
ahandle
;
m
Trace
(
"table:%s, drop table rsp received, thandle:%p result:%s"
,
pTable
->
info
.
tableId
,
queueMsg
->
thandle
,
tstrerror
(
rpcMsg
->
code
));
m
Print
(
"table:%s, drop table rsp received, thandle:%p result:%s"
,
pTable
->
info
.
tableId
,
queueMsg
->
thandle
,
tstrerror
(
rpcMsg
->
code
));
if
(
rpcMsg
->
code
!=
TSDB_CODE_SUCCESS
)
{
mError
(
"table:%s, failed to drop in dnode, reason:%s"
,
pTable
->
info
.
tableId
,
tstrerror
(
rpcMsg
->
code
));
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
0b1cab6c
...
...
@@ -301,7 +301,7 @@ void *vnodeGetVnode(int32_t vgId) {
SVnodeObj
**
ppVnode
=
(
SVnodeObj
**
)
taosGetIntHashData
(
tsDnodeVnodesHash
,
vgId
);
if
(
ppVnode
==
NULL
||
*
ppVnode
==
NULL
)
{
terrno
=
TSDB_CODE_INVALID_VGROUP_ID
;
vPrint
(
"vgId:%d not exist"
,
vgId
);
vPrint
(
"vgId:%d
,
not exist"
,
vgId
);
return
NULL
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录