Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9b4c8811
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9b4c8811
编写于
12月 01, 2022
作者:
K
kailixu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: rsma logic optimization
上级
58477d3b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
29 deletion
+21
-29
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+0
-1
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+18
-25
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+3
-3
未找到文件。
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
9b4c8811
...
...
@@ -225,7 +225,6 @@ 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
,
bool
isAdd
);
void
tdUidStoreDestory
(
STbUidStore
*
pStore
);
void
*
tdUidStoreFree
(
STbUidStore
*
pStore
);
// SMetaSnapReader ========================================
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
9b4c8811
...
...
@@ -29,9 +29,9 @@ SSmaMgmt smaMgmt = {
#define TD_QTASKINFO_FNAME_PREFIX "qinf.v"
typedef
struct
SRSmaQTaskInfoItem
SRSmaQTaskInfoItem
;
typedef
struct
SRSmaQTaskInfoIter
SRSmaQTaskInfoIter
;
static
int32_t
tdUidStorePut
(
STbUidStore
*
pStore
,
tb_uid_t
suid
,
tb_uid_t
*
uid
);
static
void
tdUidStoreDestory
(
STbUidStore
*
pStore
);
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
);
...
...
@@ -57,18 +57,6 @@ struct SRSmaQTaskInfoItem {
void
*
qTaskInfo
;
};
struct
SRSmaQTaskInfoIter
{
STFile
*
pTFile
;
int64_t
offset
;
int64_t
fsize
;
int32_t
nBytes
;
int32_t
nAlloc
;
char
*
pBuf
;
// ------------
char
*
qBuf
;
// for iterator
int32_t
nBufPos
;
};
void
tdRSmaQTaskInfoGetFileName
(
int32_t
vgId
,
int64_t
version
,
char
*
outputName
)
{
tdGetVndFileName
(
vgId
,
NULL
,
VNODE_RSMA_DIR
,
TD_QTASKINFO_FNAME_PREFIX
,
version
,
outputName
);
}
...
...
@@ -449,8 +437,8 @@ int32_t tdProcessRSmaCreate(SSma *pSma, SVCreateStbReq *pReq) {
}
if
(
!
VND_IS_RSMA
(
pVnode
))
{
sma
Trace
(
"vgId:%d, not create rsma for stable %s %"
PRIi64
" since vnd is not rsma"
,
TD_VID
(
pVnode
),
pReq
->
name
,
pReq
->
suid
);
sma
Warn
(
"vgId:%d, not create rsma for stable %s %"
PRIi64
" since vnd is not rsma"
,
TD_VID
(
pVnode
),
pReq
->
name
,
pReq
->
suid
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -494,9 +482,8 @@ int32_t tdProcessRSmaDrop(SSma *pSma, SVDropStbReq *pReq) {
tdReleaseRSmaInfo
(
pSma
,
pRSmaInfo
);
// save to file
// TODO
smaDebug
(
"vgId:%d, drop rsma for table %"
PRIi64
" succeed"
,
TD_VID
(
pVnode
),
pReq
->
suid
);
// no need to save to file as triggered by dropping stable
smaDebug
(
"vgId:%d, drop rsma for stable %"
PRIi64
" succeed"
,
TD_VID
(
pVnode
),
pReq
->
suid
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -561,7 +548,7 @@ static int32_t tdUidStorePut(STbUidStore *pStore, tb_uid_t suid, tb_uid_t *uid)
return
TSDB_CODE_SUCCESS
;
}
void
tdUidStoreDestory
(
STbUidStore
*
pStore
)
{
static
void
tdUidStoreDestory
(
STbUidStore
*
pStore
)
{
if
(
pStore
)
{
if
(
pStore
->
uidHash
)
{
if
(
pStore
->
tbUids
)
{
...
...
@@ -602,7 +589,7 @@ static int32_t tdProcessSubmitReq(STsdb *pTsdb, int64_t version, void *pReq) {
}
SSubmitReq
*
pSubmitReq
=
(
SSubmitReq
*
)
pReq
;
// TODO: spin lock for race condition
d
// TODO: spin lock for race condition
if
(
tsdbInsertData
(
pTsdb
,
version
,
pSubmitReq
,
NULL
)
<
0
)
{
return
TSDB_CODE_FAILED
;
}
...
...
@@ -871,6 +858,12 @@ static int32_t tdCloneQTaskInfo(SSma *pSma, qTaskInfo_t dstTaskInfo, qTaskInfo_t
char
*
pOutput
=
NULL
;
int32_t
len
=
0
;
if
(
!
srcTaskInfo
)
{
terrno
=
TSDB_CODE_INVALID_PTR
;
smaWarn
(
"vgId:%d, rsma clone, table %"
PRIi64
", no need since srcTaskInfo is NULL"
,
TD_VID
(
pVnode
),
suid
);
return
TSDB_CODE_FAILED
;
}
if
((
terrno
=
qSerializeTaskStatus
(
srcTaskInfo
,
&
pOutput
,
&
len
))
<
0
)
{
smaError
(
"vgId:%d, rsma clone, table %"
PRIi64
" serialize qTaskInfo failed since %s"
,
TD_VID
(
pVnode
),
suid
,
terrstr
());
...
...
@@ -1051,12 +1044,8 @@ int32_t tdProcessRSmaSubmit(SSma *pSma, void *pMsg, int32_t inputType) {
// only applicable when rsma env exists
return
TSDB_CODE_SUCCESS
;
}
STbUidStore
uidStore
=
{
0
};
SRetention
*
pRetention
=
SMA_RETENTION
(
pSma
);
if
(
!
RETENTION_VALID
(
pRetention
+
1
))
{
// return directly if retention level 1 is invalid
return
TSDB_CODE_SUCCESS
;
}
if
(
inputType
==
STREAM_INPUT__DATA_SUBMIT
)
{
if
(
tdFetchSubmitReqSuids
(
pMsg
,
&
uidStore
)
<
0
)
{
...
...
@@ -1191,10 +1180,12 @@ _err:
* @param pSma
* @return int32_t
*/
#if 0
static int32_t tdRSmaRestoreTSDataReload(SSma *pSma) {
// NOTHING TODO: the data would be restored from the unified WAL replay procedure
return TSDB_CODE_SUCCESS;
}
#endif
int32_t
tdRSmaProcessRestoreImpl
(
SSma
*
pSma
,
int8_t
type
,
int64_t
qtaskFileVer
)
{
// step 1: iterate all stables to restore the rsma env
...
...
@@ -1208,9 +1199,11 @@ int32_t tdRSmaProcessRestoreImpl(SSma *pSma, int8_t type, int64_t qtaskFileVer)
}
// step 2: reload ts data from checkpoint
#if 0
if (tdRSmaRestoreTSDataReload(pSma) < 0) {
goto _err;
}
#endif
// step 3: open SRSmaFS for qTaskFiles
if
(
tdRSmaFSOpen
(
pSma
,
qtaskFileVer
)
<
0
)
{
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
9b4c8811
...
...
@@ -3041,15 +3041,15 @@ static STsdb* getTsdbByRetentions(SVnode* pVnode, TSKEY winSKey, SRetention* ret
if
(
level
==
TSDB_RETENTION_L0
)
{
*
pLevel
=
TSDB_RETENTION_L0
;
tsdb
Debug
(
"vgId:%d, rsma level %d is selected to query %s"
,
TD_VID
(
pVnode
),
TSDB_RETENTION_L0
,
str
);
tsdb
Info
(
"vgId:%d, rsma level %d is selected to query %s"
,
TD_VID
(
pVnode
),
TSDB_RETENTION_L0
,
str
);
return
VND_RSMA0
(
pVnode
);
}
else
if
(
level
==
TSDB_RETENTION_L1
)
{
*
pLevel
=
TSDB_RETENTION_L1
;
tsdb
Debug
(
"vgId:%d, rsma level %d is selected to query %s"
,
TD_VID
(
pVnode
),
TSDB_RETENTION_L1
,
str
);
tsdb
Info
(
"vgId:%d, rsma level %d is selected to query %s"
,
TD_VID
(
pVnode
),
TSDB_RETENTION_L1
,
str
);
return
VND_RSMA1
(
pVnode
);
}
else
{
*
pLevel
=
TSDB_RETENTION_L2
;
tsdb
Debug
(
"vgId:%d, rsma level %d is selected to query %s"
,
TD_VID
(
pVnode
),
TSDB_RETENTION_L2
,
str
);
tsdb
Info
(
"vgId:%d, rsma level %d is selected to query %s"
,
TD_VID
(
pVnode
),
TSDB_RETENTION_L2
,
str
);
return
VND_RSMA2
(
pVnode
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录