Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
dffc20f9
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
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看板
未验证
提交
dffc20f9
编写于
12月 05, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
12月 05, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18684 from taosdata/fix/TD-20656
fix: use tdbTrace to reduce 135 debug log output
上级
7c56979a
6b7c5408
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
20 deletion
+16
-20
source/libs/tdb/src/db/tdbPCache.c
source/libs/tdb/src/db/tdbPCache.c
+9
-13
source/libs/tdb/src/db/tdbPage.c
source/libs/tdb/src/db/tdbPage.c
+6
-6
source/libs/tdb/src/db/tdbPager.c
source/libs/tdb/src/db/tdbPager.c
+1
-1
未找到文件。
source/libs/tdb/src/db/tdbPCache.c
浏览文件 @
dffc20f9
...
...
@@ -184,9 +184,9 @@ SPage *tdbPCacheFetch(SPCache *pCache, const SPgid *pPgid, TXN *pTxn) {
// TDB_PAGE_PGNO(pPage), pPage, nRef);
if
(
pPage
)
{
tdb
Debug
(
"pcache/fetch page %p/%d/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
,
nRef
);
tdb
Trace
(
"pcache/fetch page %p/%d/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
,
nRef
);
}
else
{
tdb
Debug
(
"pcache/fetch page %p"
,
pPage
);
tdb
Trace
(
"pcache/fetch page %p"
,
pPage
);
}
return
pPage
;
...
...
@@ -202,7 +202,7 @@ void tdbPCacheRelease(SPCache *pCache, SPage *pPage, TXN *pTxn) {
tdbPCacheLock
(
pCache
);
nRef
=
tdbUnrefPage
(
pPage
);
tdb
Debug
(
"pcache/release page %p/%d/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
,
nRef
);
tdb
Trace
(
"pcache/release page %p/%d/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
,
nRef
);
if
(
nRef
==
0
)
{
// test the nRef again to make sure
// it is safe th handle the page
...
...
@@ -221,8 +221,6 @@ void tdbPCacheRelease(SPCache *pCache, SPage *pPage, TXN *pTxn) {
// }
}
tdbPCacheUnlock
(
pCache
);
// printf("thread %" PRId64 " relas page %d pgno %d pPage %p nRef %d\n", taosGetSelfPthreadId(), pPage->id,
// TDB_PAGE_PGNO(pPage), pPage, nRef);
}
int
tdbPCacheGetPageSize
(
SPCache
*
pCache
)
{
return
pCache
->
szPage
;
}
...
...
@@ -335,8 +333,7 @@ static void tdbPCachePinPage(SPCache *pCache, SPage *pPage) {
pCache
->
nRecyclable
--
;
// printf("pin page %d pgno %d pPage %p\n", pPage->id, TDB_PAGE_PGNO(pPage), pPage);
tdbDebug
(
"pcache/pin page %p/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
);
tdbTrace
(
"pcache/pin page %p/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
);
}
}
...
...
@@ -349,7 +346,7 @@ static void tdbPCacheUnpinPage(SPCache *pCache, SPage *pPage) {
ASSERT
(
pPage
->
pLruNext
==
NULL
);
tdb
Debug
(
"pCache:%p unpin page %p/%d/%d, nPages:%d"
,
pCache
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
,
pCache
->
nPages
);
tdb
Trace
(
"pCache:%p unpin page %p/%d/%d, nPages:%d"
,
pCache
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
,
pCache
->
nPages
);
if
(
pPage
->
id
<
pCache
->
nPages
)
{
pPage
->
pLruPrev
=
&
(
pCache
->
lru
);
pPage
->
pLruNext
=
pCache
->
lru
.
pLruNext
;
...
...
@@ -359,9 +356,9 @@ static void tdbPCacheUnpinPage(SPCache *pCache, SPage *pPage) {
pCache
->
nRecyclable
++
;
// printf("unpin page %d pgno %d pPage %p\n", pPage->id, TDB_PAGE_PGNO(pPage), pPage);
tdb
Debug
(
"pcache/unpin page %p/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
);
tdb
Trace
(
"pcache/unpin page %p/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
);
}
else
{
tdb
Debug
(
"pcache destroy page: %p/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
);
tdb
Trace
(
"pcache destroy page: %p/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
);
tdbPCacheRemovePageFromHash
(
pCache
,
pPage
);
tdbPageDestroy
(
pPage
,
tdbDefaultFree
,
NULL
);
...
...
@@ -381,7 +378,7 @@ static void tdbPCacheRemovePageFromHash(SPCache *pCache, SPage *pPage) {
// printf("rmv page %d to hash, pgno %d, pPage %p\n", pPage->id, TDB_PAGE_PGNO(pPage), pPage);
}
tdb
Debug
(
"pcache/remove page %p/%d/%d from hash %"
PRIu32
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
,
h
);
tdb
Trace
(
"pcache/remove page %p/%d/%d from hash %"
PRIu32
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
,
h
);
}
static
void
tdbPCacheAddPageToHash
(
SPCache
*
pCache
,
SPage
*
pPage
)
{
...
...
@@ -392,8 +389,7 @@ static void tdbPCacheAddPageToHash(SPCache *pCache, SPage *pPage) {
pCache
->
nPage
++
;
// printf("add page %d to hash, pgno %d, pPage %p\n", pPage->id, TDB_PAGE_PGNO(pPage), pPage);
tdbDebug
(
"pcache/add page %p/%d/%d to hash %"
PRIu32
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
,
h
);
tdbTrace
(
"pcache/add page %p/%d/%d to hash %"
PRIu32
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
,
h
);
}
static
int
tdbPCacheOpenImpl
(
SPCache
*
pCache
)
{
...
...
source/libs/tdb/src/db/tdbPage.c
浏览文件 @
dffc20f9
...
...
@@ -81,7 +81,7 @@ int tdbPageDestroy(SPage *pPage, void (*xFree)(void *arg, void *ptr), void *arg)
ASSERT
(
xFree
);
for
(
int
iOvfl
=
0
;
iOvfl
<
pPage
->
nOverflow
;
iOvfl
++
)
{
tdb
Debug
(
"tdbPage/destroy/free ovfl cell: %p/%p"
,
pPage
->
apOvfl
[
iOvfl
],
pPage
);
tdb
Trace
(
"tdbPage/destroy/free ovfl cell: %p/%p"
,
pPage
->
apOvfl
[
iOvfl
],
pPage
);
tdbOsFree
(
pPage
->
apOvfl
[
iOvfl
]);
}
...
...
@@ -92,7 +92,7 @@ int tdbPageDestroy(SPage *pPage, void (*xFree)(void *arg, void *ptr), void *arg)
}
void
tdbPageZero
(
SPage
*
pPage
,
u8
szAmHdr
,
int
(
*
xCellSize
)(
const
SPage
*
,
SCell
*
,
int
,
TXN
*
,
SBTree
*
pBt
))
{
tdb
Debug
(
"page/zero: %p %"
PRIu8
" %p"
,
pPage
,
szAmHdr
,
xCellSize
);
tdb
Trace
(
"page/zero: %p %"
PRIu8
" %p"
,
pPage
,
szAmHdr
,
xCellSize
);
pPage
->
pPageHdr
=
pPage
->
pData
+
szAmHdr
;
TDB_PAGE_NCELLS_SET
(
pPage
,
0
);
TDB_PAGE_CCELLS_SET
(
pPage
,
pPage
->
pageSize
-
sizeof
(
SPageFtr
));
...
...
@@ -109,7 +109,7 @@ void tdbPageZero(SPage *pPage, u8 szAmHdr, int (*xCellSize)(const SPage *, SCell
}
void
tdbPageInit
(
SPage
*
pPage
,
u8
szAmHdr
,
int
(
*
xCellSize
)(
const
SPage
*
,
SCell
*
,
int
,
TXN
*
,
SBTree
*
pBt
))
{
tdb
Debug
(
"page/init: %p %"
PRIu8
" %p"
,
pPage
,
szAmHdr
,
xCellSize
);
tdb
Trace
(
"page/init: %p %"
PRIu8
" %p"
,
pPage
,
szAmHdr
,
xCellSize
);
pPage
->
pPageHdr
=
pPage
->
pData
+
szAmHdr
;
pPage
->
pCellIdx
=
pPage
->
pPageHdr
+
TDB_PAGE_HDR_SIZE
(
pPage
);
pPage
->
pFreeStart
=
pPage
->
pCellIdx
+
TDB_PAGE_OFFSET_SIZE
(
pPage
)
*
TDB_PAGE_NCELLS
(
pPage
);
...
...
@@ -154,7 +154,7 @@ int tdbPageInsertCell(SPage *pPage, int idx, SCell *pCell, int szCell, u8 asOvfl
pNewCell
=
(
SCell
*
)
tdbOsMalloc
(
szCell
);
memcpy
(
pNewCell
,
pCell
,
szCell
);
tdb
Debug
(
"tdbPage/insert/new ovfl cell: %p/%p"
,
pNewCell
,
pPage
);
tdb
Trace
(
"tdbPage/insert/new ovfl cell: %p/%p"
,
pNewCell
,
pPage
);
pPage
->
apOvfl
[
iOvfl
]
=
pNewCell
;
pPage
->
aiOvfl
[
iOvfl
]
=
idx
;
...
...
@@ -204,7 +204,7 @@ int tdbPageDropCell(SPage *pPage, int idx, TXN *pTxn, SBTree *pBt) {
if
(
pPage
->
aiOvfl
[
iOvfl
]
==
idx
)
{
// remove the over flow cell
tdbOsFree
(
pPage
->
apOvfl
[
iOvfl
]);
tdb
Debug
(
"tdbPage/drop/free ovfl cell: %p"
,
pPage
->
apOvfl
[
iOvfl
]);
tdb
Trace
(
"tdbPage/drop/free ovfl cell: %p"
,
pPage
->
apOvfl
[
iOvfl
]);
for
(;
(
++
iOvfl
)
<
pPage
->
nOverflow
;)
{
pPage
->
aiOvfl
[
iOvfl
-
1
]
=
pPage
->
aiOvfl
[
iOvfl
]
-
1
;
pPage
->
apOvfl
[
iOvfl
-
1
]
=
pPage
->
apOvfl
[
iOvfl
];
...
...
@@ -257,7 +257,7 @@ void tdbPageCopy(SPage *pFromPage, SPage *pToPage, int deepCopyOvfl) {
int
szCell
=
(
*
pFromPage
->
xCellSize
)(
pFromPage
,
pFromPage
->
apOvfl
[
iOvfl
],
0
,
NULL
,
NULL
);
pNewCell
=
(
SCell
*
)
tdbOsMalloc
(
szCell
);
memcpy
(
pNewCell
,
pFromPage
->
apOvfl
[
iOvfl
],
szCell
);
tdb
Debug
(
"tdbPage/copy/new ovfl cell: %p/%p/%p"
,
pNewCell
,
pToPage
,
pFromPage
);
tdb
Trace
(
"tdbPage/copy/new ovfl cell: %p/%p/%p"
,
pNewCell
,
pToPage
,
pFromPage
);
}
pToPage
->
apOvfl
[
iOvfl
]
=
pNewCell
;
...
...
source/libs/tdb/src/db/tdbPager.c
浏览文件 @
dffc20f9
...
...
@@ -239,7 +239,7 @@ int tdbPagerWrite(SPager *pPager, SPage *pPage) {
// ref page one more time so the page will not be release
tdbRefPage
(
pPage
);
tdb
Debug
(
"pager/mdirty page %p/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
);
tdb
Trace
(
"pager/mdirty page %p/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
);
// Set page as dirty
pPage
->
isDirty
=
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录