Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c2db42f1
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
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看板
提交
c2db42f1
编写于
8月 02, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of
https://github.com/taosdata/TDengine
into refact/tsdb_last
上级
418166cd
711c7565
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
27 addition
and
12 deletion
+27
-12
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+17
-10
source/libs/catalog/inc/catalogInt.h
source/libs/catalog/inc/catalogInt.h
+1
-0
source/libs/catalog/src/ctgCache.c
source/libs/catalog/src/ctgCache.c
+7
-0
source/libs/catalog/src/ctgDbg.c
source/libs/catalog/src/ctgDbg.c
+1
-1
source/libs/catalog/src/ctgRemote.c
source/libs/catalog/src/ctgRemote.c
+1
-1
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
c2db42f1
...
...
@@ -146,7 +146,8 @@ static int32_t doMergeRowsInFileBlocks(SBlockData* pBlockData, STableBlockScanI
static
int32_t
doMergeRowsInBuf
(
SIterInfo
*
pIter
,
uint64_t
uid
,
int64_t
ts
,
SArray
*
pDelList
,
SRowMerger
*
pMerger
,
STsdbReader
*
pReader
);
static
int32_t
doAppendRowFromTSRow
(
SSDataBlock
*
pBlock
,
STsdbReader
*
pReader
,
STSRow
*
pTSRow
);
static
int32_t
doAppendRowFromBlock
(
SSDataBlock
*
pResBlock
,
STsdbReader
*
pReader
,
SBlockData
*
pBlockData
,
int32_t
rowIndex
);
static
int32_t
doAppendRowFromBlock
(
SSDataBlock
*
pResBlock
,
STsdbReader
*
pReader
,
SBlockData
*
pBlockData
,
int32_t
rowIndex
);
static
void
setComposedBlockFlag
(
STsdbReader
*
pReader
,
bool
composed
);
static
void
updateSchema
(
TSDBROW
*
pRow
,
uint64_t
uid
,
STsdbReader
*
pReader
);
static
bool
hasBeenDropped
(
const
SArray
*
pDelList
,
int32_t
*
index
,
TSDBKEY
*
pKey
,
int32_t
order
);
...
...
@@ -1444,9 +1445,9 @@ static int32_t buildComposedDataBlockImpl(STsdbReader* pReader, STableBlockScanI
// 2. the direct next point is not an duplicated timestamp
if
((
pDumpInfo
->
rowIndex
<
pDumpInfo
->
totalRows
-
1
&&
pReader
->
order
==
TSDB_ORDER_ASC
)
||
(
pDumpInfo
->
rowIndex
>
0
&&
pReader
->
order
==
TSDB_ORDER_DESC
))
{
int32_t
step
=
pReader
->
order
==
TSDB_ORDER_ASC
?
1
:
-
1
;
int32_t
step
=
pReader
->
order
==
TSDB_ORDER_ASC
?
1
:
-
1
;
int64_t
nextKey
=
pBlockData
->
aTSKEY
[
pDumpInfo
->
rowIndex
+
step
];
if
(
nextKey
!=
key
)
{
// merge is not needed
if
(
nextKey
!=
key
)
{
// merge is not needed
doAppendRowFromBlock
(
pReader
->
pResBlock
,
pReader
,
pBlockData
,
pDumpInfo
->
rowIndex
);
pDumpInfo
->
rowIndex
+=
step
;
return
TSDB_CODE_SUCCESS
;
...
...
@@ -2134,15 +2135,18 @@ int32_t doMergeRowsInBuf(SIterInfo* pIter, uint64_t uid, int64_t ts, SArray* pDe
int32_t
sversion
=
TSDBROW_SVERSION
(
pRow
);
STSchema
*
pTSchema
=
NULL
;
if
(
sversion
!=
pReader
->
pSchema
->
version
)
{
if
(
pReader
->
pSchema
==
NULL
||
sversion
!=
pReader
->
pSchema
->
version
)
{
metaGetTbTSchemaEx
(
pReader
->
pTsdb
->
pVnode
->
pMeta
,
pReader
->
suid
,
uid
,
sversion
,
&
pTSchema
);
if
(
pReader
->
pSchema
==
NULL
)
{
pReader
->
pSchema
=
pTSchema
;
}
}
else
{
pTSchema
=
pReader
->
pSchema
;
}
tRowMergerAdd
(
pMerger
,
pRow
,
pTSchema
);
if
(
sversion
!=
pReader
->
pSchema
->
version
)
{
if
(
pTSchema
!=
pReader
->
pSchema
)
{
taosMemoryFree
(
pTSchema
);
}
}
...
...
@@ -2230,7 +2234,7 @@ int32_t doMergeRowsInFileBlocks(SBlockData* pBlockData, STableBlockScanInfo* pSc
int32_t
step
=
asc
?
1
:
-
1
;
pDumpInfo
->
rowIndex
+=
step
;
if
((
pDumpInfo
->
rowIndex
<=
pBlockData
->
nRow
-
1
&&
asc
)
||
(
pDumpInfo
->
rowIndex
>=
0
&&
!
asc
))
{
if
((
pDumpInfo
->
rowIndex
<=
pBlockData
->
nRow
-
1
&&
asc
)
||
(
pDumpInfo
->
rowIndex
>=
0
&&
!
asc
))
{
pDumpInfo
->
rowIndex
=
doMergeRowsInFileBlockImpl
(
pBlockData
,
pDumpInfo
->
rowIndex
,
key
,
pMerger
,
&
pReader
->
verRange
,
step
);
}
...
...
@@ -2271,8 +2275,11 @@ void doMergeMultiRows(TSDBROW* pRow, uint64_t uid, SIterInfo* pIter, SArray* pDe
// updateSchema(pRow, uid, pReader);
int32_t
sversion
=
TSDBROW_SVERSION
(
pRow
);
STSchema
*
pTSchema
=
NULL
;
if
(
sversion
!=
pReader
->
pSchema
->
version
)
{
if
(
pReader
->
pSchema
==
NULL
||
sversion
!=
pReader
->
pSchema
->
version
)
{
metaGetTbTSchemaEx
(
pReader
->
pTsdb
->
pVnode
->
pMeta
,
pReader
->
suid
,
uid
,
sversion
,
&
pTSchema
);
if
(
pReader
->
pSchema
==
NULL
)
{
pReader
->
pSchema
=
pTSchema
;
}
}
else
{
pTSchema
=
pReader
->
pSchema
;
}
...
...
@@ -2282,7 +2289,7 @@ void doMergeMultiRows(TSDBROW* pRow, uint64_t uid, SIterInfo* pIter, SArray* pDe
tRowMergerGetRow
(
&
merge
,
pTSRow
);
tRowMergerClear
(
&
merge
);
if
(
sversion
!=
pReader
->
pSchema
->
version
)
{
if
(
pTSchema
!=
pReader
->
pSchema
)
{
taosMemoryFree
(
pTSchema
);
}
}
...
...
@@ -2425,9 +2432,9 @@ int32_t doAppendRowFromBlock(SSDataBlock* pResBlock, STsdbReader* pReader, SBloc
int32_t
numOfInputCols
=
taosArrayGetSize
(
pBlockData
->
aIdx
);
int32_t
numOfOutputCols
=
blockDataGetNumOfCols
(
pResBlock
);
while
(
i
<
numOfOutputCols
&&
j
<
numOfInputCols
)
{
while
(
i
<
numOfOutputCols
&&
j
<
numOfInputCols
)
{
SColumnInfoData
*
pCol
=
taosArrayGet
(
pResBlock
->
pDataBlock
,
i
);
SColData
*
pData
=
tBlockDataGetColDataByIdx
(
pBlockData
,
j
);
SColData
*
pData
=
tBlockDataGetColDataByIdx
(
pBlockData
,
j
);
if
(
pData
->
cid
==
pCol
->
info
.
colId
)
{
tColDataGetValue
(
pData
,
rowIndex
,
&
cv
);
...
...
source/libs/catalog/inc/catalogInt.h
浏览文件 @
c2db42f1
...
...
@@ -416,6 +416,7 @@ typedef struct SCtgCacheOperation {
bool
syncOp
;
tsem_t
rspSem
;
bool
stopQueue
;
bool
unLocked
;
}
SCtgCacheOperation
;
typedef
struct
SCtgQNode
{
...
...
source/libs/catalog/src/ctgCache.c
浏览文件 @
c2db42f1
...
...
@@ -674,7 +674,13 @@ int32_t ctgEnqueue(SCatalog* pCtg, SCtgCacheOperation *operation) {
tsem_post
(
&
gCtgMgmt
.
queue
.
reqSem
);
if
(
syncOp
)
{
if
(
!
operation
->
unLocked
)
{
CTG_UNLOCK
(
CTG_READ
,
&
gCtgMgmt
.
lock
);
}
tsem_wait
(
&
operation
->
rspSem
);
if
(
!
operation
->
unLocked
)
{
CTG_LOCK
(
CTG_READ
,
&
gCtgMgmt
.
lock
);
}
taosMemoryFree
(
operation
);
}
...
...
@@ -1011,6 +1017,7 @@ int32_t ctgClearCacheEnqueue(SCatalog* pCtg, bool freeCtg, bool stopQueue, bool
op
->
opId
=
CTG_OP_CLEAR_CACHE
;
op
->
syncOp
=
syncOp
;
op
->
stopQueue
=
stopQueue
;
op
->
unLocked
=
true
;
SCtgClearCacheMsg
*
msg
=
taosMemoryMalloc
(
sizeof
(
SCtgClearCacheMsg
));
if
(
NULL
==
msg
)
{
...
...
source/libs/catalog/src/ctgDbg.c
浏览文件 @
c2db42f1
...
...
@@ -19,7 +19,7 @@
#include "catalogInt.h"
extern
SCatalogMgmt
gCtgMgmt
;
SCtgDebug
gCTGDebug
=
{
0
};
SCtgDebug
gCTGDebug
=
{
.
lockEnable
=
true
};
void
ctgdUserCallback
(
SMetaData
*
pResult
,
void
*
param
,
int32_t
code
)
{
ASSERT
(
*
(
int32_t
*
)
param
==
1
);
...
...
source/libs/catalog/src/ctgRemote.c
浏览文件 @
c2db42f1
...
...
@@ -331,7 +331,7 @@ int32_t ctgHandleMsgCallback(void *param, SDataBuf *pMsg, int32_t rspCode) {
SHashObj
*
pBatchs
=
taosHashInit
(
CTG_DEFAULT_BATCH_NUM
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
false
,
HASH_NO_LOCK
);
if
(
NULL
==
pBatchs
)
{
ctgError
(
"taosHashInit %d batch failed"
,
CTG_DEFAULT_BATCH_NUM
);
CTG_ERR_RET
(
TSDB_CODE_OUT_OF_MEMORY
);
CTG_ERR_
J
RET
(
TSDB_CODE_OUT_OF_MEMORY
);
}
pTask
->
pBatchs
=
pBatchs
;
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录