Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bcbf6726
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
bcbf6726
编写于
1月 05, 2023
作者:
sangshuduo
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' into chore/sangshuduo/TD-19391-oem-support
上级
82978953
4fa6aba2
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
69 addition
and
32 deletion
+69
-32
cmake/taostools_CMakeLists.txt.in
cmake/taostools_CMakeLists.txt.in
+1
-1
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+4
-4
source/common/src/tdataformat.c
source/common/src/tdataformat.c
+1
-3
source/common/src/trow.c
source/common/src/trow.c
+1
-1
source/dnode/vnode/src/meta/metaCache.c
source/dnode/vnode/src/meta/metaCache.c
+6
-6
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+3
-1
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+17
-0
source/dnode/vnode/src/vnd/vnodeCfg.c
source/dnode/vnode/src/vnd/vnodeCfg.c
+2
-1
source/libs/function/src/tpercentile.c
source/libs/function/src/tpercentile.c
+19
-3
source/libs/tdb/src/db/tdbPager.c
source/libs/tdb/src/db/tdbPager.c
+2
-2
source/os/src/osFile.c
source/os/src/osFile.c
+13
-10
未找到文件。
cmake/taostools_CMakeLists.txt.in
浏览文件 @
bcbf6726
...
...
@@ -2,7 +2,7 @@
# taos-tools
ExternalProject_Add(taos-tools
GIT_REPOSITORY https://github.com/taosdata/taos-tools.git
GIT_TAG
4776778
GIT_TAG
69964a0
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
BINARY_DIR ""
#BUILD_IN_SOURCE TRUE
...
...
source/common/src/tdatablock.c
浏览文件 @
bcbf6726
...
...
@@ -359,14 +359,14 @@ size_t blockDataGetNumOfCols(const SSDataBlock* pBlock) { return taosArrayGetSiz
size_t
blockDataGetNumOfRows
(
const
SSDataBlock
*
pBlock
)
{
return
pBlock
->
info
.
rows
;
}
int32_t
blockDataUpdateTsWindow
(
SSDataBlock
*
pDataBlock
,
int32_t
tsColumnIndex
)
{
if
(
pDataBlock
->
info
.
rows
>
0
)
{
// ASSERT(pDataBlock->info.dataLoad == 1);
}
if
(
pDataBlock
==
NULL
||
pDataBlock
->
info
.
rows
<=
0
||
pDataBlock
->
info
.
dataLoad
==
0
)
{
return
0
;
}
if
(
pDataBlock
->
info
.
rows
>
0
)
{
// ASSERT(pDataBlock->info.dataLoad == 1);
}
size_t
numOfCols
=
taosArrayGetSize
(
pDataBlock
->
pDataBlock
);
if
(
numOfCols
<=
0
)
{
return
-
1
;
...
...
source/common/src/tdataformat.c
浏览文件 @
bcbf6726
...
...
@@ -903,9 +903,7 @@ static int32_t tRowAppendTupleToColData(SRow *pRow, STSchema *pTSchema, SColData
int32_t
iTColumn
=
1
;
STColumn
*
pTColumn
=
&
pTSchema
->
columns
[
iTColumn
];
uint8_t
*
pb
=
NULL
;
uint8_t
*
pf
;
uint8_t
*
pv
;
uint8_t
*
pb
=
NULL
,
*
pf
=
NULL
,
*
pv
=
NULL
;
switch
(
pRow
->
flag
)
{
case
HAS_VALUE
:
...
...
source/common/src/trow.c
浏览文件 @
bcbf6726
...
...
@@ -342,7 +342,7 @@ int32_t tdSTSRowNew(SArray *pArray, STSchema *pTSchema, STSRow **ppRow) {
}
if
(
iColumn
==
0
)
{
ASSERT
(
pColVal
->
cid
==
pTColumn
->
colId
);
ASSERT
(
pColVal
&&
pColVal
->
cid
==
pTColumn
->
colId
);
ASSERT
(
pTColumn
->
type
==
TSDB_DATA_TYPE_TIMESTAMP
);
ASSERT
(
pTColumn
->
colId
==
PRIMARYKEY_TIMESTAMP_COL_ID
);
}
else
{
...
...
source/dnode/vnode/src/meta/metaCache.c
浏览文件 @
bcbf6726
...
...
@@ -55,8 +55,8 @@ struct SMetaCache {
// query cache
struct
STagFilterResCache
{
TdThreadMutex
lock
;
SHashObj
*
pTableEntry
;
SLRUCache
*
pUidResCache
;
SHashObj
*
pTableEntry
;
SLRUCache
*
pUidResCache
;
}
sTagFilterResCache
;
};
...
...
@@ -563,13 +563,13 @@ int32_t metaUidFilterCachePut(SMeta* pMeta, uint64_t suid, const void* pKey, int
}
// add to cache.
taosLRUCacheInsert
(
pCache
,
buf
,
sizeof
(
uint64_t
)
+
keyLen
,
pPayload
,
payloadLen
,
freePayload
,
NULL
,
TAOS_LRU_PRIORITY_LOW
);
int32_t
ret
=
taosLRUCacheInsert
(
pCache
,
buf
,
sizeof
(
uint64_t
)
+
keyLen
,
pPayload
,
payloadLen
,
freePayload
,
NULL
,
TAOS_LRU_PRIORITY_LOW
);
taosThreadMutexUnlock
(
pLock
);
metaDebug
(
"vgId:%d, suid:%"
PRIu64
" list cache added into cache, total:%d, tables:%d
"
,
TD_VID
(
pMeta
->
pVnode
),
suid
,
(
int32_t
)
taosLRUCacheGetUsage
(
pCache
),
taosHashGetSize
(
pTableEntry
)
);
metaDebug
(
"vgId:%d, suid:%"
PRIu64
" list cache added into cache, total:%d, tables:%d
, ret:%d"
,
TD_VID
(
pMeta
->
pVnode
)
,
suid
,
(
int32_t
)
taosLRUCacheGetUsage
(
pCache
),
taosHashGetSize
(
pTableEntry
),
ret
);
return
TSDB_CODE_SUCCESS
;
}
...
...
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
bcbf6726
...
...
@@ -653,8 +653,10 @@ int32_t metaGetTbTSchemaEx(SMeta *pMeta, tb_uid_t suid, tb_uid_t uid, int32_t sv
}
if
(
c
==
0
)
{
metaError
(
"meta/query: incorrect c: %"
PRId32
"."
,
c
);
metaULock
(
pMeta
);
tdbTbcClose
(
pSkmDbC
);
code
=
TSDB_CODE_FAILED
;
metaError
(
"meta/query: incorrect c: %"
PRId32
"."
,
c
);
goto
_exit
;
}
...
...
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
bcbf6726
...
...
@@ -343,6 +343,10 @@ int metaAlterSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
tdbTbcOpen
(
pMeta
->
pTbDb
,
&
pTbDbc
,
NULL
);
ret
=
tdbTbcMoveTo
(
pTbDbc
,
&
((
STbDbKey
){.
uid
=
pReq
->
suid
,
.
version
=
oversion
}),
sizeof
(
STbDbKey
),
&
c
);
if
(
!
(
ret
==
0
&&
c
==
0
))
{
tdbTbcClose
(
pUidIdxc
);
tdbTbcClose
(
pTbDbc
);
terrno
=
TSDB_CODE_TDB_STB_NOT_EXIST
;
metaError
(
"meta/table: invalide ret: %"
PRId32
" or c: %"
PRId32
"alter stb failed."
,
ret
,
c
);
return
-
1
;
}
...
...
@@ -783,6 +787,7 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
tdbTbcOpen
(
pMeta
->
pUidIdx
,
&
pUidIdxc
,
NULL
);
tdbTbcMoveTo
(
pUidIdxc
,
&
uid
,
sizeof
(
uid
),
&
c
);
if
(
c
!=
0
)
{
tdbTbcClose
(
pUidIdxc
);
metaError
(
"meta/table: invalide c: %"
PRId32
" alt tb column failed."
,
c
);
return
-
1
;
}
...
...
@@ -796,6 +801,8 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
tdbTbcOpen
(
pMeta
->
pTbDb
,
&
pTbDbc
,
NULL
);
tdbTbcMoveTo
(
pTbDbc
,
&
((
STbDbKey
){.
uid
=
uid
,
.
version
=
oversion
}),
sizeof
(
STbDbKey
),
&
c
);
if
(
c
!=
0
)
{
tdbTbcClose
(
pUidIdxc
);
tdbTbcClose
(
pTbDbc
);
metaError
(
"meta/table: invalide c: %"
PRId32
" alt tb column failed."
,
c
);
return
-
1
;
}
...
...
@@ -809,6 +816,8 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
tDecoderInit
(
&
dc
,
entry
.
pBuf
,
nData
);
ret
=
metaDecodeEntry
(
&
dc
,
&
entry
);
if
(
ret
!=
0
)
{
tdbTbcClose
(
pUidIdxc
);
tdbTbcClose
(
pTbDbc
);
tDecoderClear
(
&
dc
);
metaError
(
"meta/table: invalide ret: %"
PRId32
" alt tb column failed."
,
ret
);
return
-
1
;
...
...
@@ -989,6 +998,8 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
tdbTbcOpen
(
pMeta
->
pUidIdx
,
&
pUidIdxc
,
NULL
);
tdbTbcMoveTo
(
pUidIdxc
,
&
uid
,
sizeof
(
uid
),
&
c
);
if
(
c
!=
0
)
{
tdbTbcClose
(
pUidIdxc
);
terrno
=
TSDB_CODE_TDB_TABLE_NOT_EXIST
;
metaError
(
"meta/table: invalide c: %"
PRId32
" update tb tag val failed."
,
c
);
return
-
1
;
}
...
...
@@ -1005,6 +1016,9 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
tdbTbcOpen
(
pMeta
->
pTbDb
,
&
pTbDbc
,
NULL
);
tdbTbcMoveTo
(
pTbDbc
,
&
((
STbDbKey
){.
uid
=
uid
,
.
version
=
oversion
}),
sizeof
(
STbDbKey
),
&
c
);
if
(
c
!=
0
)
{
tdbTbcClose
(
pUidIdxc
);
tdbTbcClose
(
pTbDbc
);
terrno
=
TSDB_CODE_TDB_TABLE_NOT_EXIST
;
metaError
(
"meta/table: invalide c: %"
PRId32
" update tb tag val failed."
,
c
);
return
-
1
;
}
...
...
@@ -1166,6 +1180,7 @@ static int metaUpdateTableOptions(SMeta *pMeta, int64_t version, SVAlterTbReq *p
tdbTbcOpen
(
pMeta
->
pUidIdx
,
&
pUidIdxc
,
NULL
);
tdbTbcMoveTo
(
pUidIdxc
,
&
uid
,
sizeof
(
uid
),
&
c
);
if
(
c
!=
0
)
{
tdbTbcClose
(
pUidIdxc
);
metaError
(
"meta/table: invalide c: %"
PRId32
" update tb options failed."
,
c
);
return
-
1
;
}
...
...
@@ -1179,6 +1194,8 @@ static int metaUpdateTableOptions(SMeta *pMeta, int64_t version, SVAlterTbReq *p
tdbTbcOpen
(
pMeta
->
pTbDb
,
&
pTbDbc
,
NULL
);
tdbTbcMoveTo
(
pTbDbc
,
&
((
STbDbKey
){.
uid
=
uid
,
.
version
=
oversion
}),
sizeof
(
STbDbKey
),
&
c
);
if
(
c
!=
0
)
{
tdbTbcClose
(
pUidIdxc
);
tdbTbcClose
(
pTbDbc
);
metaError
(
"meta/table: invalide c: %"
PRId32
" update tb options failed."
,
c
);
return
-
1
;
}
...
...
source/dnode/vnode/src/vnd/vnodeCfg.c
浏览文件 @
bcbf6726
...
...
@@ -262,9 +262,10 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) {
tjsonGetNumberValue
(
info
,
"nodePort"
,
pNode
->
nodePort
,
code
);
if
(
code
<
0
)
return
-
1
;
tjsonGetStringValue
(
info
,
"nodeFqdn"
,
pNode
->
nodeFqdn
);
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
info
,
"nodeId"
,
pNode
->
nodeId
,
code
);
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
info
,
"clusterId"
,
pNode
->
clusterId
,
code
);
if
(
code
<
0
)
return
-
1
;
vDebug
(
"vgId:%d, decode config, replica:%d ep:%s:%u dnode:%d"
,
pCfg
->
vgId
,
i
,
pNode
->
nodeFqdn
,
pNode
->
nodePort
,
pNode
->
nodeId
);
}
...
...
source/libs/function/src/tpercentile.c
浏览文件 @
bcbf6726
...
...
@@ -33,7 +33,14 @@ static SFilePage *loadDataFromFilePage(tMemBucket *pMemBucket, int32_t slotIdx)
(
SFilePage
*
)
taosMemoryCalloc
(
1
,
pMemBucket
->
bytes
*
pMemBucket
->
pSlots
[
slotIdx
].
info
.
size
+
sizeof
(
SFilePage
));
int32_t
groupId
=
getGroupId
(
pMemBucket
->
numOfSlots
,
slotIdx
,
pMemBucket
->
times
);
SArray
*
pIdList
=
*
(
SArray
**
)
taosHashGet
(
pMemBucket
->
groupPagesMap
,
&
groupId
,
sizeof
(
groupId
));
SArray
*
pIdList
;
void
*
p
=
taosHashGet
(
pMemBucket
->
groupPagesMap
,
&
groupId
,
sizeof
(
groupId
));
if
(
p
!=
NULL
)
{
pIdList
=
*
(
SArray
**
)
p
;
}
else
{
return
NULL
;
}
int32_t
offset
=
0
;
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pIdList
);
++
i
)
{
...
...
@@ -498,8 +505,17 @@ double getPercentileImpl(tMemBucket *pMemBucket, int32_t count, double fraction)
resetSlotInfo
(
pMemBucket
);
int32_t
groupId
=
getGroupId
(
pMemBucket
->
numOfSlots
,
i
,
pMemBucket
->
times
-
1
);
SArray
*
list
=
*
(
SArray
**
)
taosHashGet
(
pMemBucket
->
groupPagesMap
,
&
groupId
,
sizeof
(
groupId
));
ASSERT
(
list
!=
NULL
&&
list
->
size
>
0
);
SArray
*
list
;
void
*
p
=
taosHashGet
(
pMemBucket
->
groupPagesMap
,
&
groupId
,
sizeof
(
groupId
));
if
(
p
!=
NULL
)
{
list
=
*
(
SArray
**
)
p
;
if
(
list
==
NULL
||
list
->
size
<=
0
)
{
return
-
1
;
}
}
else
{
return
-
1
;
}
for
(
int32_t
f
=
0
;
f
<
list
->
size
;
++
f
)
{
int32_t
*
pageId
=
taosArrayGet
(
list
,
f
);
...
...
source/libs/tdb/src/db/tdbPager.c
浏览文件 @
bcbf6726
...
...
@@ -731,8 +731,8 @@ static int tdbPagerInitPage(SPager *pPager, SPage *pPage, int (*initPage)(SPage
int
ret
;
int
lcode
;
int
nLoops
;
i64
nRead
;
SPgno
pgno
;
i64
nRead
=
0
;
SPgno
pgno
=
0
;
int
init
=
0
;
lcode
=
TDB_TRY_LOCK_PAGE
(
pPage
);
...
...
source/os/src/osFile.c
浏览文件 @
bcbf6726
...
...
@@ -191,7 +191,7 @@ int32_t taosStatFile(const char *path, int64_t *size, int32_t *mtime) {
int32_t
code
=
_stati64
(
path
,
&
fileStat
);
#else
struct
stat
fileStat
;
int32_t
code
=
stat
(
path
,
&
fileStat
);
int32_t
code
=
stat
(
path
,
&
fileStat
);
#endif
if
(
code
<
0
)
{
return
code
;
...
...
@@ -232,7 +232,7 @@ int32_t taosDevInoFile(TdFilePtr pFile, int64_t *stDev, int64_t *stIno) {
#else
struct
stat
fileStat
;
int32_t
code
=
fstat
(
pFile
->
fd
,
&
fileStat
);
int32_t
code
=
fstat
(
pFile
->
fd
,
&
fileStat
);
if
(
code
<
0
)
{
printf
(
"taosFStatFile run fstat fail."
);
return
code
;
...
...
@@ -439,6 +439,9 @@ int64_t taosWriteFile(TdFilePtr pFile, const void *buf, int64_t count) {
taosThreadRwlockWrlock
(
&
(
pFile
->
rwlock
));
#endif
if
(
pFile
->
fd
<
0
)
{
#if FILE_WITH_LOCK
taosThreadRwlockUnlock
(
&
(
pFile
->
rwlock
));
#endif
return
0
;
}
...
...
@@ -543,7 +546,7 @@ int32_t taosFStatFile(TdFilePtr pFile, int64_t *size, int32_t *mtime) {
int32_t
taosLockFile
(
TdFilePtr
pFile
)
{
ASSERT
(
pFile
->
fd
>=
0
);
// Please check if you have closed the file.
if
(
pFile
->
fd
<
0
)
{
if
(
pFile
->
fd
<
0
)
{
return
-
1
;
}
#ifdef WINDOWS
...
...
@@ -570,13 +573,13 @@ int32_t taosLockFile(TdFilePtr pFile) {
int32_t
taosUnLockFile
(
TdFilePtr
pFile
)
{
ASSERT
(
pFile
->
fd
>=
0
);
if
(
pFile
->
fd
<
0
)
{
if
(
pFile
->
fd
<
0
)
{
return
0
;
}
#ifdef WINDOWS
BOOL
fSuccess
=
FALSE
;
OVERLAPPED
overlapped
=
{
0
};
HANDLE
hFile
=
(
HANDLE
)
_get_osfhandle
(
pFile
->
fd
);
BOOL
fSuccess
=
FALSE
;
OVERLAPPED
overlapped
=
{
0
};
HANDLE
hFile
=
(
HANDLE
)
_get_osfhandle
(
pFile
->
fd
);
fSuccess
=
UnlockFileEx
(
hFile
,
0
,
~
0
,
~
0
,
&
overlapped
);
if
(
!
fSuccess
)
{
...
...
@@ -592,7 +595,7 @@ int32_t taosFtruncateFile(TdFilePtr pFile, int64_t l_size) {
if
(
pFile
==
NULL
)
{
return
0
;
}
if
(
pFile
->
fd
<
0
)
{
if
(
pFile
->
fd
<
0
)
{
printf
(
"Ftruncate file error, fd arg was negative
\n
"
);
return
-
1
;
}
...
...
@@ -669,7 +672,7 @@ int64_t taosFSendFile(TdFilePtr pFileOut, TdFilePtr pFileIn, int64_t *offset, in
return
0
;
}
ASSERT
(
pFileIn
->
fd
>=
0
&&
pFileOut
->
fd
>=
0
);
if
(
pFileIn
->
fd
<
0
||
pFileOut
->
fd
<
0
)
{
if
(
pFileIn
->
fd
<
0
||
pFileOut
->
fd
<
0
)
{
return
0
;
}
...
...
@@ -829,7 +832,7 @@ int32_t taosEOFFile(TdFilePtr pFile) {
return
-
1
;
}
ASSERT
(
pFile
->
fp
!=
NULL
);
if
(
pFile
->
fp
==
NULL
)
{
if
(
pFile
->
fp
==
NULL
)
{
return
-
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录