Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8b3b6a89
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8b3b6a89
编写于
8月 21, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: code optimization and memory leak
上级
0de7f3e3
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
29 addition
and
22 deletion
+29
-22
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
+0
-1
source/dnode/vnode/src/inc/sma.h
source/dnode/vnode/src/inc/sma.h
+7
-7
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+0
-1
source/dnode/vnode/src/sma/smaCommit.c
source/dnode/vnode/src/sma/smaCommit.c
+7
-7
source/dnode/vnode/src/sma/smaEnv.c
source/dnode/vnode/src/sma/smaEnv.c
+3
-3
source/dnode/vnode/src/sma/smaOpen.c
source/dnode/vnode/src/sma/smaOpen.c
+6
-2
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+3
-1
source/libs/tdb/src/db/tdbBtree.c
source/libs/tdb/src/db/tdbBtree.c
+3
-0
未找到文件。
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
浏览文件 @
8b3b6a89
...
...
@@ -87,7 +87,6 @@ void vmCloseVnode(SVnodeMgmt *pMgmt, SVnodeObj *pVnode) {
while
(
pVnode
->
refCount
>
0
)
taosMsleep
(
10
);
dTrace
(
"vgId:%d, wait for vnode queue is empty"
,
pVnode
->
vgId
);
while
(
!
taosQueueEmpty
(
pVnode
->
pWriteQ
))
taosMsleep
(
10
);
while
(
!
taosQueueEmpty
(
pVnode
->
pSyncQ
))
taosMsleep
(
10
);
while
(
!
taosQueueEmpty
(
pVnode
->
pApplyQ
))
taosMsleep
(
10
);
...
...
source/dnode/vnode/src/inc/sma.h
浏览文件 @
8b3b6a89
...
...
@@ -118,12 +118,12 @@ struct SSmaStat {
#define RSMA_FS_LOCK(r) (&(r)->lock)
struct
SRSmaInfoItem
{
int8_t
level
;
int8_t
triggerStat
;
uint8_t
nSkipped
;
// number of skipped to fetch data from all active window
int8_t
fetchLevel
;
int32_t
maxDelay
;
// ms
tmr_h
tmrId
;
int8_t
level
:
4
;
int8_t
fetchLevel
:
4
;
int8_t
triggerStat
;
uint16_t
nSkipped
;
// number of skipped to fetch data from all active window
int32_t
maxDelay
;
// ms
tmr_h
tmrId
;
};
struct
SRSmaInfo
{
...
...
@@ -131,8 +131,8 @@ struct SRSmaInfo {
int64_t
suid
;
int64_t
refId
;
// refId of SRSmaStat
int64_t
lastRecv
;
// ms
int8_t
delFlag
;
int8_t
assigned
;
// 0 idle, 1 assgined for exec
int8_t
delFlag
;
int16_t
padding
;
T_REF_DECLARE
()
SRSmaInfoItem
items
[
TSDB_RETENTION_L2
];
...
...
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
8b3b6a89
...
...
@@ -328,7 +328,6 @@ struct SVnode {
SQHandle
*
pQuery
;
};
#define TD_VID(PVNODE) ((PVNODE)->config.vgId)
#define VND_TSDB(vnd) ((vnd)->pTsdb)
...
...
source/dnode/vnode/src/sma/smaCommit.c
浏览文件 @
8b3b6a89
...
...
@@ -109,7 +109,7 @@ int32_t smaBegin(SSma *pSma) {
/**
* @brief pre-commit for rollup sma(sync commit).
* 1) set trigger stat of rsma timer TASK_TRIGGER_STAT_PAUSED.
* 2) wait
all triggered fetch tasks finished
* 2) wait
for all triggered fetch tasks to finish
* 3) perform persist task for qTaskInfo
*
* @param pSma
...
...
@@ -127,14 +127,14 @@ static int32_t tdProcessRSmaSyncPreCommitImpl(SSma *pSma) {
// step 1: set rsma stat paused
atomic_store_8
(
RSMA_TRIGGER_STAT
(
pRSmaStat
),
TASK_TRIGGER_STAT_PAUSED
);
// step 2: wait
all triggered fetch tasks finished
// step 2: wait
for all triggered fetch tasks to finish
int32_t
nLoops
=
0
;
while
(
1
)
{
if
(
T_REF_VAL_GET
(
pStat
)
==
0
)
{
smaDebug
(
"vgId:%d, rsma fetch tasks all finished"
,
SMA_VID
(
pSma
));
smaDebug
(
"vgId:%d, rsma fetch tasks a
re a
ll finished"
,
SMA_VID
(
pSma
));
break
;
}
else
{
smaDebug
(
"vgId:%d, rsma fetch tasks not all finished yet"
,
SMA_VID
(
pSma
));
smaDebug
(
"vgId:%d, rsma fetch tasks
are
not all finished yet"
,
SMA_VID
(
pSma
));
}
++
nLoops
;
if
(
nLoops
>
1000
)
{
...
...
@@ -319,14 +319,14 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma) {
pRSmaStat
->
commitAppliedVer
=
pSma
->
pVnode
->
state
.
applied
;
ASSERT
(
pRSmaStat
->
commitAppliedVer
>
0
);
// step 2: wait
all triggered fetch tasks finished
// step 2: wait
for all triggered fetch tasks to finish
int32_t
nLoops
=
0
;
while
(
1
)
{
if
(
T_REF_VAL_GET
(
pStat
)
==
0
)
{
smaDebug
(
"vgId:%d, rsma commit, fetch tasks all finished"
,
SMA_VID
(
pSma
));
smaDebug
(
"vgId:%d, rsma commit, fetch tasks a
re a
ll finished"
,
SMA_VID
(
pSma
));
break
;
}
else
{
smaDebug
(
"vgId:%d, rsma commit, fetch tasks not all finished yet"
,
SMA_VID
(
pSma
));
smaDebug
(
"vgId:%d, rsma commit, fetch tasks
are
not all finished yet"
,
SMA_VID
(
pSma
));
}
++
nLoops
;
if
(
nLoops
>
1000
)
{
...
...
source/dnode/vnode/src/sma/smaEnv.c
浏览文件 @
8b3b6a89
...
...
@@ -275,14 +275,14 @@ static void tdDestroyRSmaStat(void *pRSmaStat) {
}
taosHashCleanup
(
RSMA_INFO_HASH
(
pStat
));
// step 3: wait
all triggered fetch tasks finished
// step 3: wait
for all triggered fetch tasks to finish
int32_t
nLoops
=
0
;
while
(
1
)
{
if
(
T_REF_VAL_GET
((
SSmaStat
*
)
pStat
)
==
0
)
{
smaDebug
(
"vgId:%d, rsma fetch tasks all finished"
,
SMA_VID
(
pSma
));
smaDebug
(
"vgId:%d, rsma fetch tasks a
re a
ll finished"
,
SMA_VID
(
pSma
));
break
;
}
else
{
smaDebug
(
"vgId:%d, rsma fetch tasks not all finished yet"
,
SMA_VID
(
pSma
));
smaDebug
(
"vgId:%d, rsma fetch tasks
are
not all finished yet"
,
SMA_VID
(
pSma
));
}
++
nLoops
;
if
(
nLoops
>
1000
)
{
...
...
source/dnode/vnode/src/sma/smaOpen.c
浏览文件 @
8b3b6a89
...
...
@@ -148,9 +148,13 @@ int32_t smaClose(SSma *pSma) {
int32_t
smaPreClose
(
SSma
*
pSma
)
{
if
(
pSma
&&
VND_IS_RSMA
(
pSma
->
pVnode
))
{
SRSmaStat
*
pRSmaStat
=
SMA_RSMA_STAT
(
pSma
);
SSmaEnv
*
pEnv
=
NULL
;
SRSmaStat
*
pStat
=
NULL
;
if
(
!
(
pEnv
=
SMA_RSMA_ENV
(
pSma
))
||
!
(
pStat
=
(
SRSmaStat
*
)
SMA_ENV_STAT
(
pEnv
)))
{
return
0
;
}
for
(
int32_t
i
=
0
;
i
<
RSMA_EXECUTOR_MAX
;
++
i
)
{
tsem_post
(
&
(
p
RSma
Stat
->
notEmpty
));
tsem_post
(
&
(
pStat
->
notEmpty
));
}
}
return
0
;
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
8b3b6a89
...
...
@@ -1524,7 +1524,7 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) {
SRSmaStat
*
pStat
=
(
SRSmaStat
*
)
tdAcquireSmaRef
(
smaMgmt
.
rsetId
,
pRSmaInfo
->
refId
);
if
(
!
pStat
)
{
sma
Warn
(
"rsma fetch task not start since rsma stat already destroyed, rsetId:%"
PRIi64
" refId:%d)"
,
smaMgmt
.
rsetId
,
sma
Debug
(
"rsma fetch task not start since rsma stat already destroyed, rsetId:%"
PRIi64
" refId:%d)"
,
smaMgmt
.
rsetId
,
pRSmaInfo
->
refId
);
return
;
}
...
...
@@ -1557,10 +1557,12 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) {
SMA_VID
(
pSma
),
pItem
->
level
,
pRSmaInfo
->
suid
);
// async process
pItem
->
fetchLevel
=
pItem
->
level
;
#if 0
SRSmaInfo *qInfo = tdAcquireRSmaInfoBySuid(pSma, pRSmaInfo->suid);
SRSmaInfoItem *qItem = RSMA_INFO_ITEM(qInfo, pItem->level - 1);
ASSERT(qItem->level == pItem->level);
ASSERT(qItem->fetchLevel == pItem->fetchLevel);
#endif
tsem_post
(
&
(
pStat
->
notEmpty
));
smaInfo
(
"vgId:%d, rsma fetch task planned for level:%"
PRIi8
" suid:%"
PRIi64
,
SMA_VID
(
pSma
),
pItem
->
level
,
pRSmaInfo
->
suid
);
...
...
source/libs/tdb/src/db/tdbBtree.c
浏览文件 @
8b3b6a89
...
...
@@ -782,6 +782,9 @@ static int tdbBtreeBalanceNonRoot(SBTree *pBt, SPage *pParent, int idx, TXN *pTx
pBt
);
tdbPageInsertCell
(
pParent
,
sIdx
++
,
pNewCell
,
szNewCell
,
0
);
tdbOsFree
(
pNewCell
);
if
(
TDB_CELLDECODER_FREE_VAL
(
&
cd
))
{
tdbFree
(
cd
.
pVal
);
}
}
// move to next new page
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录