Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
875eabdb
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
875eabdb
编写于
8月 08, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: send rsma fetch msg to designated vg
上级
16ccf2ad
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
39 addition
and
10 deletion
+39
-10
include/common/tmsg.h
include/common/tmsg.h
+0
-3
include/util/taoserror.h
include/util/taoserror.h
+2
-0
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+34
-6
source/util/src/terror.c
source/util/src/terror.c
+2
-0
tests/system-test/1-insert/create_retentions.py
tests/system-test/1-insert/create_retentions.py
+1
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
875eabdb
...
@@ -2658,7 +2658,6 @@ typedef struct {
...
@@ -2658,7 +2658,6 @@ typedef struct {
}
SVgEpSet
;
}
SVgEpSet
;
typedef
struct
{
typedef
struct
{
int64_t
refId
;
int64_t
suid
;
int64_t
suid
;
int8_t
level
;
int8_t
level
;
}
SRSmaFetchMsg
;
}
SRSmaFetchMsg
;
...
@@ -2666,7 +2665,6 @@ typedef struct {
...
@@ -2666,7 +2665,6 @@ typedef struct {
static
FORCE_INLINE
int32_t
tEncodeSRSmaFetchMsg
(
SEncoder
*
pCoder
,
const
SRSmaFetchMsg
*
pReq
)
{
static
FORCE_INLINE
int32_t
tEncodeSRSmaFetchMsg
(
SEncoder
*
pCoder
,
const
SRSmaFetchMsg
*
pReq
)
{
if
(
tStartEncode
(
pCoder
)
<
0
)
return
-
1
;
if
(
tStartEncode
(
pCoder
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pCoder
,
pReq
->
refId
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pCoder
,
pReq
->
suid
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pCoder
,
pReq
->
suid
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pCoder
,
pReq
->
level
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pCoder
,
pReq
->
level
)
<
0
)
return
-
1
;
...
@@ -2677,7 +2675,6 @@ static FORCE_INLINE int32_t tEncodeSRSmaFetchMsg(SEncoder* pCoder, const SRSmaFe
...
@@ -2677,7 +2675,6 @@ static FORCE_INLINE int32_t tEncodeSRSmaFetchMsg(SEncoder* pCoder, const SRSmaFe
static
FORCE_INLINE
int32_t
tDecodeSRSmaFetchMsg
(
SDecoder
*
pCoder
,
SRSmaFetchMsg
*
pReq
)
{
static
FORCE_INLINE
int32_t
tDecodeSRSmaFetchMsg
(
SDecoder
*
pCoder
,
SRSmaFetchMsg
*
pReq
)
{
if
(
tStartDecode
(
pCoder
)
<
0
)
return
-
1
;
if
(
tStartDecode
(
pCoder
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pCoder
,
&
pReq
->
refId
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pCoder
,
&
pReq
->
suid
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pCoder
,
&
pReq
->
suid
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pCoder
,
&
pReq
->
level
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pCoder
,
&
pReq
->
level
)
<
0
)
return
-
1
;
...
...
include/util/taoserror.h
浏览文件 @
875eabdb
...
@@ -610,6 +610,8 @@ int32_t* taosGetErrno();
...
@@ -610,6 +610,8 @@ int32_t* taosGetErrno();
#define TSDB_CODE_RSMA_QTASKINFO_CREATE TAOS_DEF_ERROR_CODE(0, 0x3152)
#define TSDB_CODE_RSMA_QTASKINFO_CREATE TAOS_DEF_ERROR_CODE(0, 0x3152)
#define TSDB_CODE_RSMA_FILE_CORRUPTED TAOS_DEF_ERROR_CODE(0, 0x3153)
#define TSDB_CODE_RSMA_FILE_CORRUPTED TAOS_DEF_ERROR_CODE(0, 0x3153)
#define TSDB_CODE_RSMA_REMOVE_EXISTS TAOS_DEF_ERROR_CODE(0, 0x3154)
#define TSDB_CODE_RSMA_REMOVE_EXISTS TAOS_DEF_ERROR_CODE(0, 0x3154)
#define TSDB_CODE_RSMA_FETCH_MSG_MSSED_UP TAOS_DEF_ERROR_CODE(0, 0x3155)
#define TSDB_CODE_RSMA_EMPTY_INFO TAOS_DEF_ERROR_CODE(0, 0x3156)
//index
//index
#define TSDB_CODE_INDEX_REBUILDING TAOS_DEF_ERROR_CODE(0, 0x3200)
#define TSDB_CODE_INDEX_REBUILDING TAOS_DEF_ERROR_CODE(0, 0x3200)
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
875eabdb
...
@@ -1389,7 +1389,7 @@ _end:
...
@@ -1389,7 +1389,7 @@ _end:
* @return int32_t
* @return int32_t
*/
*/
int32_t
tdRSmaFetchSend
(
SSma
*
pSma
,
SRSmaInfo
*
pInfo
,
int8_t
level
)
{
int32_t
tdRSmaFetchSend
(
SSma
*
pSma
,
SRSmaInfo
*
pInfo
,
int8_t
level
)
{
SRSmaFetchMsg
fetchMsg
=
{
.
refId
=
pInfo
->
refId
,
.
suid
=
pInfo
->
suid
,
.
level
=
level
};
SRSmaFetchMsg
fetchMsg
=
{
.
suid
=
pInfo
->
suid
,
.
level
=
level
};
int32_t
ret
=
0
;
int32_t
ret
=
0
;
int32_t
contLen
=
0
;
int32_t
contLen
=
0
;
SEncoder
encoder
=
{
0
};
SEncoder
encoder
=
{
0
};
...
@@ -1400,13 +1400,17 @@ int32_t tdRSmaFetchSend(SSma *pSma, SRSmaInfo *pInfo, int8_t level) {
...
@@ -1400,13 +1400,17 @@ int32_t tdRSmaFetchSend(SSma *pSma, SRSmaInfo *pInfo, int8_t level) {
goto
_err
;
goto
_err
;
}
}
void
*
pBuf
=
rpcMallocCont
(
contLen
);
void
*
pBuf
=
rpcMallocCont
(
contLen
+
sizeof
(
SMsgHead
)
);
tEncoderInit
(
&
encoder
,
pBuf
,
contLen
);
tEncoderInit
(
&
encoder
,
POINTER_SHIFT
(
pBuf
,
sizeof
(
SMsgHead
))
,
contLen
);
if
(
tEncodeSRSmaFetchMsg
(
&
encoder
,
&
fetchMsg
)
<
0
)
{
if
(
tEncodeSRSmaFetchMsg
(
&
encoder
,
&
fetchMsg
)
<
0
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
tEncoderClear
(
&
encoder
);
tEncoderClear
(
&
encoder
);
}
}
tEncoderClear
(
&
encoder
);
tEncoderClear
(
&
encoder
);
((
SMsgHead
*
)
pBuf
)
->
vgId
=
SMA_VID
(
pSma
);
((
SMsgHead
*
)
pBuf
)
->
contLen
=
contLen
+
sizeof
(
SMsgHead
);
SRpcMsg
rpcMsg
=
{
SRpcMsg
rpcMsg
=
{
.
code
=
0
,
.
code
=
0
,
.
msgType
=
TDMT_VND_FETCH_RSMA
,
.
msgType
=
TDMT_VND_FETCH_RSMA
,
...
@@ -1415,24 +1419,42 @@ int32_t tdRSmaFetchSend(SSma *pSma, SRSmaInfo *pInfo, int8_t level) {
...
@@ -1415,24 +1419,42 @@ int32_t tdRSmaFetchSend(SSma *pSma, SRSmaInfo *pInfo, int8_t level) {
};
};
if
((
terrno
=
tmsgPutToQueue
(
&
pSma
->
pVnode
->
msgCb
,
FETCH_QUEUE
,
&
rpcMsg
))
!=
0
)
{
if
((
terrno
=
tmsgPutToQueue
(
&
pSma
->
pVnode
->
msgCb
,
FETCH_QUEUE
,
&
rpcMsg
))
!=
0
)
{
smaError
(
"vgId:%d, failed to put rsma fetch msg into fetch-queue for suid:%
d
level:%"
PRIi8
" since %s"
,
smaError
(
"vgId:%d, failed to put rsma fetch msg into fetch-queue for suid:%
"
PRIi64
"
level:%"
PRIi8
" since %s"
,
SMA_VID
(
pSma
),
pInfo
->
suid
,
level
,
terrstr
());
SMA_VID
(
pSma
),
pInfo
->
suid
,
level
,
terrstr
());
goto
_err
;
goto
_err
;
}
}
smaDebug
(
"vgId:%d, success to put rsma fetch msg into fetch-queue for suid:%"
PRIi64
" level:%"
PRIi8
,
SMA_VID
(
pSma
),
pInfo
->
suid
,
level
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
_err:
_err:
return
TSDB_CODE_FAILED
;
return
TSDB_CODE_FAILED
;
}
}
/**
* @brief fetch rsma data of level 2/3 and submit
*
* @param pSma
* @param pMsg
* @return int32_t
*/
int32_t
smaProcessFetch
(
SSma
*
pSma
,
void
*
pMsg
)
{
int32_t
smaProcessFetch
(
SSma
*
pSma
,
void
*
pMsg
)
{
SRpcMsg
*
pRpcMsg
=
(
SRpcMsg
*
)
pMsg
;
SRpcMsg
*
pRpcMsg
=
(
SRpcMsg
*
)
pMsg
;
SRSmaFetchMsg
req
=
{
0
};
SRSmaFetchMsg
req
=
{
0
};
SDecoder
decoder
=
{
0
};
SDecoder
decoder
=
{
0
};
void
*
pBuf
=
NULL
;
SRSmaInfo
*
pInfo
=
NULL
;
SRSmaInfo
*
pInfo
=
NULL
;
SRSmaInfoItem
*
pItem
=
NULL
;
SRSmaInfoItem
*
pItem
=
NULL
;
tDecoderInit
(
&
decoder
,
pRpcMsg
->
pCont
,
pRpcMsg
->
contLen
);
if
(
!
pRpcMsg
||
pRpcMsg
->
contLen
<
sizeof
(
SMsgHead
))
{
terrno
=
TSDB_CODE_RSMA_FETCH_MSG_MSSED_UP
;
return
-
1
;
}
pBuf
=
POINTER_SHIFT
(
pRpcMsg
->
pCont
,
sizeof
(
SMsgHead
));
tDecoderInit
(
&
decoder
,
pBuf
,
pRpcMsg
->
contLen
);
if
(
tDecodeSRSmaFetchMsg
(
&
decoder
,
&
req
)
<
0
)
{
if
(
tDecodeSRSmaFetchMsg
(
&
decoder
,
&
req
)
<
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
goto
_err
;
goto
_err
;
...
@@ -1440,7 +1462,11 @@ int32_t smaProcessFetch(SSma *pSma, void *pMsg) {
...
@@ -1440,7 +1462,11 @@ int32_t smaProcessFetch(SSma *pSma, void *pMsg) {
pInfo
=
tdAcquireRSmaInfoBySuid
(
pSma
,
req
.
suid
);
pInfo
=
tdAcquireRSmaInfoBySuid
(
pSma
,
req
.
suid
);
if
(
!
pInfo
)
{
if
(
!
pInfo
)
{
smaDebug
(
"vgId:%d, failed to process rsma fetch msg since Empty rsma info"
,
SMA_VID
(
pSma
));
if
(
terrno
==
TSDB_CODE_SUCCESS
)
{
terrno
=
TSDB_CODE_RSMA_EMPTY_INFO
;
}
smaWarn
(
"vgId:%d, failed to process rsma fetch msg for suid:%"
PRIi64
" level:%"
PRIi8
" since %s"
,
SMA_VID
(
pSma
),
req
.
suid
,
req
.
level
,
terrstr
());
goto
_err
;
goto
_err
;
}
}
...
@@ -1459,6 +1485,8 @@ int32_t smaProcessFetch(SSma *pSma, void *pMsg) {
...
@@ -1459,6 +1485,8 @@ int32_t smaProcessFetch(SSma *pSma, void *pMsg) {
tdReleaseRSmaInfo
(
pSma
,
pInfo
);
tdReleaseRSmaInfo
(
pSma
,
pInfo
);
tDecoderClear
(
&
decoder
);
tDecoderClear
(
&
decoder
);
smaDebug
(
"vgId:%d, success to process rsma fetch msg for suid:%"
PRIi64
" level:%"
PRIi8
,
SMA_VID
(
pSma
),
req
.
suid
,
req
.
level
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
_err:
_err:
tdReleaseRSmaInfo
(
pSma
,
pInfo
);
tdReleaseRSmaInfo
(
pSma
,
pInfo
);
...
...
source/util/src/terror.c
浏览文件 @
875eabdb
...
@@ -614,6 +614,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_INVALID_STAT, "Invalid rsma state"
...
@@ -614,6 +614,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_INVALID_STAT, "Invalid rsma state"
TAOS_DEFINE_ERROR
(
TSDB_CODE_RSMA_QTASKINFO_CREATE
,
"Rsma qtaskinfo creation error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RSMA_QTASKINFO_CREATE
,
"Rsma qtaskinfo creation error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RSMA_FILE_CORRUPTED
,
"Rsma file corrupted"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RSMA_FILE_CORRUPTED
,
"Rsma file corrupted"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RSMA_REMOVE_EXISTS
,
"Rsma remove exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RSMA_REMOVE_EXISTS
,
"Rsma remove exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RSMA_FETCH_MSG_MSSED_UP
,
"Rsma fetch msg is messed up"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RSMA_EMPTY_INFO
,
"Rsma info is empty"
)
//index
//index
TAOS_DEFINE_ERROR
(
TSDB_CODE_INDEX_REBUILDING
,
"Index is rebuilding"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INDEX_REBUILDING
,
"Index is rebuilding"
)
...
...
tests/system-test/1-insert/create_retentions.py
浏览文件 @
875eabdb
...
@@ -187,7 +187,7 @@ class TDTestCase:
...
@@ -187,7 +187,7 @@ class TDTestCase:
tdSql
.
execute
(
f
'create table
{
dbname
}
.ct
{
i
+
1
}
using
{
dbname
}
.
{
stb
}
tags (
{
i
+
1
}
)'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.ct
{
i
+
1
}
using
{
dbname
}
.
{
stb
}
tags (
{
i
+
1
}
)'
)
def
__insert_data
(
self
,
rows
,
ctb_num
=
20
,
dbname
=
DBNAME
,
rsma
=
False
,
rsma_type
=
"sum"
):
def
__insert_data
(
self
,
rows
,
ctb_num
=
20
,
dbname
=
DBNAME
,
rsma
=
False
,
rsma_type
=
"sum"
):
tdLog
.
printNoPrefix
(
"==========step: start inser data into tables now....."
)
tdLog
.
printNoPrefix
(
"==========step: start inser
t
data into tables now....."
)
# from ...pytest.util.common import DataSet
# from ...pytest.util.common import DataSet
data
=
DataSet
()
data
=
DataSet
()
data
.
get_order_set
(
rows
)
data
.
get_order_set
(
rows
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录