Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
31fb2a31
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看板
提交
31fb2a31
编写于
9月 05, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: drop child tables support for rsma
上级
91bbca0b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
13 deletion
+22
-13
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+2
-2
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+5
-1
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+7
-7
source/dnode/vnode/src/tsdb/tsdbWrite.c
source/dnode/vnode/src/tsdb/tsdbWrite.c
+1
-1
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+7
-2
未找到文件。
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
31fb2a31
...
...
@@ -104,7 +104,7 @@ int metaCreateSTable(SMeta* pMeta, int64_t version, SVCreateStbReq*
int
metaAlterSTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVCreateStbReq
*
pReq
);
int
metaDropSTable
(
SMeta
*
pMeta
,
int64_t
verison
,
SVDropStbReq
*
pReq
,
SArray
*
tbUidList
);
int
metaCreateTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVCreateTbReq
*
pReq
,
STableMetaRsp
**
pMetaRsp
);
int
metaDropTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVDropTbReq
*
pReq
,
SArray
*
tbUids
);
int
metaDropTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVDropTbReq
*
pReq
,
SArray
*
tbUids
,
int64_t
*
tbUid
);
int
metaTtlDropTable
(
SMeta
*
pMeta
,
int64_t
ttl
,
SArray
*
tbUids
);
int
metaAlterTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVAlterTbReq
*
pReq
,
STableMetaRsp
*
pMetaRsp
);
SSchemaWrapper
*
metaGetTableSchema
(
SMeta
*
pMeta
,
tb_uid_t
uid
,
int32_t
sver
,
bool
isinline
);
...
...
@@ -208,7 +208,7 @@ int32_t tdProcessRSmaCreate(SSma* pSma, SVCreateStbReq* pReq);
int32_t
tdProcessRSmaSubmit
(
SSma
*
pSma
,
void
*
pMsg
,
int32_t
inputType
);
int32_t
tdProcessRSmaDrop
(
SSma
*
pSma
,
SVDropStbReq
*
pReq
);
int32_t
tdFetchTbUidList
(
SSma
*
pSma
,
STbUidStore
**
ppStore
,
tb_uid_t
suid
,
tb_uid_t
uid
);
int32_t
tdUpdateTbUidList
(
SSma
*
pSma
,
STbUidStore
*
pUidStore
);
int32_t
tdUpdateTbUidList
(
SSma
*
pSma
,
STbUidStore
*
pUidStore
,
bool
isAdd
);
void
tdUidStoreDestory
(
STbUidStore
*
pStore
);
void
*
tdUidStoreFree
(
STbUidStore
*
pStore
);
...
...
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
31fb2a31
...
...
@@ -474,7 +474,7 @@ _err:
return
-
1
;
}
int
metaDropTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVDropTbReq
*
pReq
,
SArray
*
tbUids
)
{
int
metaDropTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVDropTbReq
*
pReq
,
SArray
*
tbUids
,
tb_uid_t
*
tbUid
)
{
void
*
pData
=
NULL
;
int
nData
=
0
;
int
rc
=
0
;
...
...
@@ -496,6 +496,10 @@ int metaDropTable(SMeta *pMeta, int64_t version, SVDropTbReq *pReq, SArray *tbUi
taosArrayPush
(
tbUids
,
&
uid
);
}
if
((
type
==
TSDB_CHILD_TABLE
)
&&
tbUid
)
{
*
tbUid
=
uid
;
}
tdbFree
(
pData
);
return
0
;
}
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
31fb2a31
...
...
@@ -34,7 +34,7 @@ typedef struct SRSmaQTaskInfoItem SRSmaQTaskInfoItem;
typedef
struct
SRSmaQTaskInfoIter
SRSmaQTaskInfoIter
;
static
int32_t
tdUidStorePut
(
STbUidStore
*
pStore
,
tb_uid_t
suid
,
tb_uid_t
*
uid
);
static
int32_t
tdUpdateTbUidListImpl
(
SSma
*
pSma
,
tb_uid_t
*
suid
,
SArray
*
tbUids
);
static
int32_t
tdUpdateTbUidListImpl
(
SSma
*
pSma
,
tb_uid_t
*
suid
,
SArray
*
tbUids
,
bool
isAdd
);
static
int32_t
tdSetRSmaInfoItemParams
(
SSma
*
pSma
,
SRSmaParam
*
param
,
SRSmaStat
*
pStat
,
SRSmaInfo
*
pRSmaInfo
,
int8_t
idx
);
static
int32_t
tdExecuteRSmaImpl
(
SSma
*
pSma
,
const
void
*
pMsg
,
int32_t
msgSize
,
int32_t
inputType
,
SRSmaInfo
*
pInfo
,
...
...
@@ -175,7 +175,7 @@ static FORCE_INLINE int32_t tdUidStoreInit(STbUidStore **pStore) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
tdUpdateTbUidListImpl
(
SSma
*
pSma
,
tb_uid_t
*
suid
,
SArray
*
tbUids
)
{
static
int32_t
tdUpdateTbUidListImpl
(
SSma
*
pSma
,
tb_uid_t
*
suid
,
SArray
*
tbUids
,
bool
isAdd
)
{
SRSmaInfo
*
pRSmaInfo
=
NULL
;
if
(
!
suid
||
!
tbUids
)
{
...
...
@@ -199,7 +199,7 @@ static int32_t tdUpdateTbUidListImpl(SSma *pSma, tb_uid_t *suid, SArray *tbUids)
for
(
int32_t
i
=
0
;
i
<
TSDB_RETENTION_L2
;
++
i
)
{
if
(
pRSmaInfo
->
taskInfo
[
i
])
{
if
(((
terrno
=
qUpdateQualifiedTableId
(
pRSmaInfo
->
taskInfo
[
i
],
tbUids
,
true
))
<
0
))
{
if
(((
terrno
=
qUpdateQualifiedTableId
(
pRSmaInfo
->
taskInfo
[
i
],
tbUids
,
isAdd
))
<
0
))
{
tdReleaseRSmaInfo
(
pSma
,
pRSmaInfo
);
smaError
(
"vgId:%d, update tbUidList failed for uid:%"
PRIi64
" level %d since %s"
,
SMA_VID
(
pSma
),
*
suid
,
i
,
terrstr
());
...
...
@@ -215,12 +215,12 @@ static int32_t tdUpdateTbUidListImpl(SSma *pSma, tb_uid_t *suid, SArray *tbUids)
return
TSDB_CODE_SUCCESS
;
}
int32_t
tdUpdateTbUidList
(
SSma
*
pSma
,
STbUidStore
*
pStore
)
{
int32_t
tdUpdateTbUidList
(
SSma
*
pSma
,
STbUidStore
*
pStore
,
bool
isAdd
)
{
if
(
!
pStore
||
(
taosArrayGetSize
(
pStore
->
tbUids
)
==
0
))
{
return
TSDB_CODE_SUCCESS
;
}
if
(
tdUpdateTbUidListImpl
(
pSma
,
&
pStore
->
suid
,
pStore
->
tbUids
)
!=
TSDB_CODE_SUCCESS
)
{
if
(
tdUpdateTbUidListImpl
(
pSma
,
&
pStore
->
suid
,
pStore
->
tbUids
,
isAdd
)
!=
TSDB_CODE_SUCCESS
)
{
return
TSDB_CODE_FAILED
;
}
...
...
@@ -229,7 +229,7 @@ int32_t tdUpdateTbUidList(SSma *pSma, STbUidStore *pStore) {
tb_uid_t
*
pTbSuid
=
(
tb_uid_t
*
)
taosHashGetKey
(
pIter
,
NULL
);
SArray
*
pTbUids
=
*
(
SArray
**
)
pIter
;
if
(
tdUpdateTbUidListImpl
(
pSma
,
pTbSuid
,
pTbUids
)
!=
TSDB_CODE_SUCCESS
)
{
if
(
tdUpdateTbUidListImpl
(
pSma
,
pTbSuid
,
pTbUids
,
isAdd
)
!=
TSDB_CODE_SUCCESS
)
{
taosHashCancelIterate
(
pStore
->
uidHash
,
pIter
);
return
TSDB_CODE_FAILED
;
}
...
...
@@ -1118,7 +1118,7 @@ static int32_t tdRSmaRestoreQTaskInfoInit(SSma *pSma, int64_t *nTables) {
goto
_err
;
}
if
(
tdUpdateTbUidList
(
pVnode
->
pSma
,
&
uidStore
)
<
0
)
{
if
(
tdUpdateTbUidList
(
pVnode
->
pSma
,
&
uidStore
,
true
)
<
0
)
{
smaError
(
"vgId:%d, rsma restore, update tb uid list failed for %"
PRIi64
" since %s"
,
TD_VID
(
pVnode
),
suid
,
terrstr
());
goto
_err
;
...
...
source/dnode/vnode/src/tsdb/tsdbWrite.c
浏览文件 @
31fb2a31
...
...
@@ -39,7 +39,7 @@ int tsdbInsertData(STsdb *pTsdb, int64_t version, SSubmitReq *pMsg, SSubmitRsp *
SSubmitBlkRsp
r
=
{
0
};
tGetSubmitMsgNext
(
&
msgIter
,
&
pBlock
);
if
(
pBlock
==
NULL
)
break
;
if
(
tsdbInsertTableData
(
pTsdb
,
version
,
&
msgIter
,
pBlock
,
&
r
)
<
0
)
{
if
(
(
terrno
=
tsdbInsertTableData
(
pTsdb
,
version
,
&
msgIter
,
pBlock
,
&
r
)
)
<
0
)
{
return
-
1
;
}
...
...
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
31fb2a31
...
...
@@ -534,7 +534,7 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t version, void *pR
}
tqUpdateTbUidList
(
pVnode
->
pTq
,
tbUids
,
true
);
if
(
tdUpdateTbUidList
(
pVnode
->
pSma
,
pStore
)
<
0
)
{
if
(
tdUpdateTbUidList
(
pVnode
->
pSma
,
pStore
,
true
)
<
0
)
{
goto
_exit
;
}
tdUidStoreFree
(
pStore
);
...
...
@@ -692,6 +692,7 @@ static int32_t vnodeProcessDropTbReq(SVnode *pVnode, int64_t version, void *pReq
SEncoder
encoder
=
{
0
};
int32_t
ret
;
SArray
*
tbUids
=
NULL
;
STbUidStore
*
pStore
=
NULL
;
pRsp
->
msgType
=
TDMT_VND_DROP_TABLE_RSP
;
pRsp
->
pCont
=
NULL
;
...
...
@@ -715,9 +716,10 @@ static int32_t vnodeProcessDropTbReq(SVnode *pVnode, int64_t version, void *pReq
for
(
int32_t
iReq
=
0
;
iReq
<
req
.
nReqs
;
iReq
++
)
{
SVDropTbReq
*
pDropTbReq
=
req
.
pReqs
+
iReq
;
SVDropTbRsp
dropTbRsp
=
{
0
};
tb_uid_t
tbUid
=
0
;
/* code */
ret
=
metaDropTable
(
pVnode
->
pMeta
,
version
,
pDropTbReq
,
tbUids
);
ret
=
metaDropTable
(
pVnode
->
pMeta
,
version
,
pDropTbReq
,
tbUids
,
VND_IS_RSMA
(
pVnode
)
?
&
tbUid
:
NULL
);
if
(
ret
<
0
)
{
if
(
pDropTbReq
->
igNotExists
&&
terrno
==
TSDB_CODE_VND_TABLE_NOT_EXIST
)
{
dropTbRsp
.
code
=
TSDB_CODE_SUCCESS
;
...
...
@@ -726,15 +728,18 @@ static int32_t vnodeProcessDropTbReq(SVnode *pVnode, int64_t version, void *pReq
}
}
else
{
dropTbRsp
.
code
=
TSDB_CODE_SUCCESS
;
if
(
tbUid
>
0
)
tdFetchTbUidList
(
pVnode
->
pSma
,
&
pStore
,
pDropTbReq
->
suid
,
tbUid
);
}
taosArrayPush
(
rsp
.
pArray
,
&
dropTbRsp
);
}
tqUpdateTbUidList
(
pVnode
->
pTq
,
tbUids
,
false
);
tdUpdateTbUidList
(
pVnode
->
pSma
,
pStore
,
false
);
_exit:
taosArrayDestroy
(
tbUids
);
tdUidStoreFree
(
pStore
);
tDecoderClear
(
&
decoder
);
tEncodeSize
(
tEncodeSVDropTbBatchRsp
,
&
rsp
,
pRsp
->
contLen
,
ret
);
pRsp
->
pCont
=
rpcMallocCont
(
pRsp
->
contLen
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录