Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ce7fbaa6
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看板
未验证
提交
ce7fbaa6
编写于
10月 26, 2022
作者:
D
dapan1121
提交者:
GitHub
10月 26, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17632 from taosdata/fix/TD-19492
fix: fix scheduler status error
上级
9415ecb4
2b278c16
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
94 addition
and
82 deletion
+94
-82
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+1
-1
source/libs/catalog/src/ctgCache.c
source/libs/catalog/src/ctgCache.c
+13
-7
source/libs/catalog/test/CMakeLists.txt
source/libs/catalog/test/CMakeLists.txt
+4
-4
source/libs/catalog/test/catalogTests.cpp
source/libs/catalog/test/catalogTests.cpp
+68
-65
source/libs/scheduler/inc/schInt.h
source/libs/scheduler/inc/schInt.h
+2
-2
source/libs/scheduler/src/schRemote.c
source/libs/scheduler/src/schRemote.c
+4
-2
source/libs/scheduler/src/schTask.c
source/libs/scheduler/src/schTask.c
+1
-0
source/util/src/thash.c
source/util/src/thash.c
+1
-1
未找到文件。
source/libs/catalog/src/catalog.c
浏览文件 @
ce7fbaa6
...
...
@@ -570,7 +570,7 @@ int32_t catalogInit(SCatalogCfg* cfg) {
CTG_ERR_RET
(
TSDB_CODE_CTG_INVALID_INPUT
);
}
atomic_store_8
((
int8_t
*
)
&
gCtgMgmt
.
exit
,
false
);
memset
(
&
gCtgMgmt
,
0
,
sizeof
(
gCtgMgmt
)
);
if
(
cfg
)
{
memcpy
(
&
gCtgMgmt
.
cfg
,
cfg
,
sizeof
(
*
cfg
));
...
...
source/libs/catalog/src/ctgCache.c
浏览文件 @
ce7fbaa6
...
...
@@ -72,7 +72,10 @@ void ctgRUnlockVgInfo(SCtgDBCache *dbCache) { CTG_UNLOCK(CTG_READ, &dbCache->vgC
void
ctgWUnlockVgInfo
(
SCtgDBCache
*
dbCache
)
{
CTG_UNLOCK
(
CTG_WRITE
,
&
dbCache
->
vgCache
.
vgLock
);
}
void
ctgReleaseDBCache
(
SCatalog
*
pCtg
,
SCtgDBCache
*
dbCache
)
{
CTG_UNLOCK
(
CTG_READ
,
&
dbCache
->
dbLock
);
}
void
ctgReleaseDBCache
(
SCatalog
*
pCtg
,
SCtgDBCache
*
dbCache
)
{
CTG_UNLOCK
(
CTG_READ
,
&
dbCache
->
dbLock
);
taosHashRelease
(
pCtg
->
dbCache
,
dbCache
);
}
int32_t
ctgAcquireDBCacheImpl
(
SCatalog
*
pCtg
,
const
char
*
dbFName
,
SCtgDBCache
**
pCache
,
bool
acquire
)
{
char
*
p
=
strchr
(
dbFName
,
'.'
);
...
...
@@ -80,7 +83,14 @@ int32_t ctgAcquireDBCacheImpl(SCatalog *pCtg, const char *dbFName, SCtgDBCache *
dbFName
=
p
+
1
;
}
SCtgDBCache
*
dbCache
=
(
SCtgDBCache
*
)
taosHashGet
(
pCtg
->
dbCache
,
dbFName
,
strlen
(
dbFName
));
SCtgDBCache
*
dbCache
=
NULL
;
if
(
acquire
)
{
dbCache
=
(
SCtgDBCache
*
)
taosHashAcquire
(
pCtg
->
dbCache
,
dbFName
,
strlen
(
dbFName
));
}
else
{
dbCache
=
(
SCtgDBCache
*
)
taosHashGet
(
pCtg
->
dbCache
,
dbFName
,
strlen
(
dbFName
));
}
if
(
NULL
==
dbCache
)
{
*
pCache
=
NULL
;
ctgDebug
(
"db not in cache, dbFName:%s"
,
dbFName
);
...
...
@@ -1356,7 +1366,6 @@ int32_t ctgWriteTbMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFNam
SCtgTbCache
*
pCache
=
taosHashGet
(
dbCache
->
tbCache
,
tbName
,
strlen
(
tbName
));
STableMeta
*
orig
=
(
pCache
?
pCache
->
pMeta
:
NULL
);
int8_t
origType
=
0
;
uint64_t
origSuid
=
0
;
if
(
orig
)
{
origType
=
orig
->
tableType
;
...
...
@@ -1375,8 +1384,6 @@ int32_t ctgWriteTbMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFNam
CTG_CACHE_STAT_DEC
(
numOfStb
,
1
);
ctgDebug
(
"stb removed from stbCache, dbFName:%s, stb:%s, suid:0x%"
PRIx64
,
dbFName
,
tbName
,
orig
->
suid
);
}
origSuid
=
orig
->
suid
;
}
}
...
...
@@ -1408,8 +1415,7 @@ int32_t ctgWriteTbMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFNam
return
TSDB_CODE_SUCCESS
;
}
if
(
origSuid
!=
meta
->
suid
&&
taosHashPut
(
dbCache
->
stbCache
,
&
meta
->
suid
,
sizeof
(
meta
->
suid
),
tbName
,
strlen
(
tbName
)
+
1
)
!=
0
)
{
if
(
taosHashPut
(
dbCache
->
stbCache
,
&
meta
->
suid
,
sizeof
(
meta
->
suid
),
tbName
,
strlen
(
tbName
)
+
1
)
!=
0
)
{
ctgError
(
"taosHashPut to stable cache failed, suid:0x%"
PRIx64
,
meta
->
suid
);
CTG_ERR_RET
(
TSDB_CODE_OUT_OF_MEMORY
);
}
...
...
source/libs/catalog/test/CMakeLists.txt
浏览文件 @
ce7fbaa6
...
...
@@ -18,8 +18,8 @@ IF(NOT TD_DARWIN)
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/libs/catalog/inc"
)
#
add_test(
#
NAME catalogTest
#
COMMAND catalogTest
#
)
#add_test(
# NAME catalogTest
# COMMAND catalogTest
#)
ENDIF
()
source/libs/catalog/test/catalogTests.cpp
浏览文件 @
ce7fbaa6
...
...
@@ -142,6 +142,7 @@ void ctgTestInitLogFile() {
ctgdEnableDebug
(
"api"
);
ctgdEnableDebug
(
"meta"
);
ctgdEnableDebug
(
"cache"
);
ctgdEnableDebug
(
"lock"
);
if
(
taosInitLog
(
defaultLogFileNamePrefix
,
maxLogFileNum
)
<
0
)
{
printf
(
"failed to open log file in directory:%s
\n
"
,
tsLogDir
);
...
...
@@ -254,8 +255,8 @@ void ctgTestBuildSTableMetaRsp(STableMetaRsp *rspMsg) {
rspMsg
->
tableType
=
TSDB_SUPER_TABLE
;
rspMsg
->
sversion
=
ctgTestSVersion
+
1
;
rspMsg
->
tversion
=
ctgTestTVersion
+
1
;
rspMsg
->
suid
=
ctgTestSuid
+
1
;
rspMsg
->
tuid
=
ctgTestSuid
+
1
;
rspMsg
->
suid
=
ctgTestSuid
;
rspMsg
->
tuid
=
ctgTestSuid
;
rspMsg
->
vgId
=
1
;
rspMsg
->
pSchemas
=
(
SSchema
*
)
taosMemoryCalloc
(
rspMsg
->
numOfTags
+
rspMsg
->
numOfColumns
,
sizeof
(
SSchema
));
...
...
@@ -423,7 +424,7 @@ void ctgTestRspSTableMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg
metaRsp
.
sversion
=
ctgTestSVersion
;
metaRsp
.
tversion
=
ctgTestTVersion
;
metaRsp
.
suid
=
ctgTestSuid
;
metaRsp
.
tuid
=
ctgTestSuid
+
+
;
metaRsp
.
tuid
=
ctgTestSuid
+
1
;
metaRsp
.
vgId
=
0
;
metaRsp
.
pSchemas
=
(
SSchema
*
)
taosMemoryMalloc
((
metaRsp
.
numOfTags
+
metaRsp
.
numOfColumns
)
*
sizeof
(
SSchema
));
...
...
@@ -773,13 +774,15 @@ void ctgTestSetRspDbVgroupsAndMultiSuperMeta() {
void
*
ctgTestGetDbVgroupThread
(
void
*
param
)
{
struct
SCatalog
*
pCtg
=
(
struct
SCatalog
*
)
param
;
int32_t
code
=
0
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SArray
*
vgList
=
NULL
;
int32_t
n
=
0
;
while
(
!
ctgTestStop
)
{
code
=
catalogGetDBVgList
(
pCtg
,
mockPointer
,
ctgTestDbname
,
&
vgList
);
if
(
code
)
{
printf
(
"code:%x
\n
"
,
code
);
assert
(
0
);
}
...
...
@@ -863,7 +866,7 @@ void *ctgTestGetCtableMetaThread(void *param) {
while
(
!
ctgTestStop
)
{
code
=
ctgReadTbMetaFromCache
(
pCtg
,
&
ctx
,
&
tbMeta
);
if
(
code
||
!
inCache
)
{
if
(
code
||
NULL
==
tbMeta
)
{
assert
(
0
);
}
...
...
@@ -917,12 +920,12 @@ void *ctgTestSetCtableMetaThread(void *param) {
return
NULL
;
}
#if 1
TEST
(
tableMeta
,
normalTable
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SVgroupInfo
vgInfo
=
{
0
};
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
ctgTestInitLogFile
();
...
...
@@ -1028,7 +1031,8 @@ TEST(tableMeta, normalTable) {
TEST
(
tableMeta
,
childTableCase
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
vgInfo
=
{
0
};
ctgTestInitLogFile
();
...
...
@@ -1136,7 +1140,8 @@ TEST(tableMeta, childTableCase) {
TEST
(
tableMeta
,
superTableCase
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
vgInfo
=
{
0
};
ctgTestSetRspDbVgroupsAndSuperMeta
();
...
...
@@ -1161,8 +1166,8 @@ TEST(tableMeta, superTableCase) {
ASSERT_EQ
(
tableMeta
->
tableType
,
TSDB_SUPER_TABLE
);
ASSERT_EQ
(
tableMeta
->
sversion
,
ctgTestSVersion
);
ASSERT_EQ
(
tableMeta
->
tversion
,
ctgTestTVersion
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
-
1
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
-
1
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfColumns
,
ctgTestColNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfTags
,
ctgTestTagNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
precision
,
1
);
...
...
@@ -1257,7 +1262,8 @@ TEST(tableMeta, superTableCase) {
TEST
(
tableMeta
,
rmStbMeta
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
vgInfo
=
{
0
};
ctgTestInitLogFile
();
...
...
@@ -1284,8 +1290,8 @@ TEST(tableMeta, rmStbMeta) {
ASSERT_EQ
(
tableMeta
->
tableType
,
TSDB_SUPER_TABLE
);
ASSERT_EQ
(
tableMeta
->
sversion
,
ctgTestSVersion
);
ASSERT_EQ
(
tableMeta
->
tversion
,
ctgTestTVersion
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
-
1
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
-
1
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfColumns
,
ctgTestColNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfTags
,
ctgTestTagNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
precision
,
1
);
...
...
@@ -1300,7 +1306,7 @@ TEST(tableMeta, rmStbMeta) {
}
}
code
=
catalogRemoveStbMeta
(
pCtg
,
"1.db1"
,
ctgTestDbId
,
ctgTestSTablename
,
ctgTestSuid
-
1
);
code
=
catalogRemoveStbMeta
(
pCtg
,
"1.db1"
,
ctgTestDbId
,
ctgTestSTablename
,
ctgTestSuid
);
ASSERT_EQ
(
code
,
0
);
while
(
true
)
{
...
...
@@ -1325,7 +1331,8 @@ TEST(tableMeta, rmStbMeta) {
TEST
(
tableMeta
,
updateStbMeta
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
vgInfo
=
{
0
};
ctgTestInitLogFile
();
...
...
@@ -1352,8 +1359,8 @@ TEST(tableMeta, updateStbMeta) {
ASSERT_EQ
(
tableMeta
->
tableType
,
TSDB_SUPER_TABLE
);
ASSERT_EQ
(
tableMeta
->
sversion
,
ctgTestSVersion
);
ASSERT_EQ
(
tableMeta
->
tversion
,
ctgTestTVersion
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
-
1
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
-
1
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfColumns
,
ctgTestColNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfTags
,
ctgTestTagNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
precision
,
1
);
...
...
@@ -1399,8 +1406,8 @@ TEST(tableMeta, updateStbMeta) {
ASSERT_EQ
(
tableMeta
->
tableType
,
TSDB_SUPER_TABLE
);
ASSERT_EQ
(
tableMeta
->
sversion
,
ctgTestSVersion
+
1
);
ASSERT_EQ
(
tableMeta
->
tversion
,
ctgTestTVersion
+
1
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
+
1
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
+
1
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfColumns
,
ctgTestColNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfTags
,
ctgTestTagNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
precision
,
1
+
1
);
...
...
@@ -1414,7 +1421,8 @@ TEST(tableMeta, updateStbMeta) {
TEST
(
refreshGetMeta
,
normal2normal
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
vgInfo
=
{
0
};
SArray
*
vgList
=
NULL
;
...
...
@@ -1493,7 +1501,8 @@ TEST(refreshGetMeta, normal2normal) {
TEST
(
refreshGetMeta
,
normal2notexist
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
vgInfo
=
{
0
};
SArray
*
vgList
=
NULL
;
...
...
@@ -1563,7 +1572,8 @@ TEST(refreshGetMeta, normal2notexist) {
TEST
(
refreshGetMeta
,
normal2child
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
vgInfo
=
{
0
};
SArray
*
vgList
=
NULL
;
...
...
@@ -1644,9 +1654,11 @@ TEST(refreshGetMeta, normal2child) {
ctgTestCurrentSTableName
=
NULL
;
}
TEST
(
refreshGetMeta
,
stable2child
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
vgInfo
=
{
0
};
SArray
*
vgList
=
NULL
;
...
...
@@ -1699,8 +1711,8 @@ TEST(refreshGetMeta, stable2child) {
ASSERT_EQ
(
tableMeta
->
tableType
,
TSDB_SUPER_TABLE
);
ASSERT_EQ
(
tableMeta
->
sversion
,
ctgTestSVersion
);
ASSERT_EQ
(
tableMeta
->
tversion
,
ctgTestTVersion
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
-
1
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
-
1
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfColumns
,
ctgTestColNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfTags
,
ctgTestTagNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
precision
,
1
);
...
...
@@ -1732,7 +1744,8 @@ TEST(refreshGetMeta, stable2child) {
TEST
(
refreshGetMeta
,
stable2stable
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
vgInfo
=
{
0
};
SArray
*
vgList
=
NULL
;
...
...
@@ -1784,8 +1797,8 @@ TEST(refreshGetMeta, stable2stable) {
ASSERT_EQ
(
tableMeta
->
tableType
,
TSDB_SUPER_TABLE
);
ASSERT_EQ
(
tableMeta
->
sversion
,
ctgTestSVersion
);
ASSERT_EQ
(
tableMeta
->
tversion
,
ctgTestTVersion
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
-
1
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
-
1
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfColumns
,
ctgTestColNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfTags
,
ctgTestTagNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
precision
,
1
);
...
...
@@ -1802,8 +1815,8 @@ TEST(refreshGetMeta, stable2stable) {
ASSERT_EQ
(
tableMeta
->
tableType
,
TSDB_SUPER_TABLE
);
ASSERT_EQ
(
tableMeta
->
sversion
,
ctgTestSVersion
);
ASSERT_EQ
(
tableMeta
->
tversion
,
ctgTestTVersion
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
-
1
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
-
1
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfColumns
,
ctgTestColNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfTags
,
ctgTestTagNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
precision
,
1
);
...
...
@@ -1818,7 +1831,8 @@ TEST(refreshGetMeta, stable2stable) {
TEST
(
refreshGetMeta
,
child2stable
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
vgInfo
=
{
0
};
SArray
*
vgList
=
NULL
;
...
...
@@ -1888,8 +1902,8 @@ TEST(refreshGetMeta, child2stable) {
ASSERT_EQ
(
tableMeta
->
tableType
,
TSDB_SUPER_TABLE
);
ASSERT_EQ
(
tableMeta
->
sversion
,
ctgTestSVersion
);
ASSERT_EQ
(
tableMeta
->
tversion
,
ctgTestTVersion
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
-
1
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
-
1
);
ASSERT_EQ
(
tableMeta
->
uid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
suid
,
ctgTestSuid
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfColumns
,
ctgTestColNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
numOfTags
,
ctgTestTagNum
);
ASSERT_EQ
(
tableMeta
->
tableInfo
.
precision
,
1
);
...
...
@@ -1904,7 +1918,8 @@ TEST(refreshGetMeta, child2stable) {
TEST
(
tableDistVgroup
,
normalTable
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
*
vgInfo
=
NULL
;
SArray
*
vgList
=
NULL
;
...
...
@@ -1933,11 +1948,7 @@ TEST(tableDistVgroup, normalTable) {
strcpy
(
n
.
tname
,
ctgTestTablename
);
code
=
catalogGetTableDistVgInfo
(
pCtg
,
mockPointer
,
&
n
,
&
vgList
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
taosArrayGetSize
((
const
SArray
*
)
vgList
),
1
);
vgInfo
=
(
SVgroupInfo
*
)
taosArrayGet
(
vgList
,
0
);
ASSERT_EQ
(
vgInfo
->
vgId
,
8
);
ASSERT_EQ
(
vgInfo
->
epSet
.
numOfEps
,
3
);
ASSERT_TRUE
(
code
!=
0
);
catalogDestroy
();
memset
(
&
gCtgMgmt
,
0
,
sizeof
(
gCtgMgmt
));
...
...
@@ -1945,7 +1956,8 @@ TEST(tableDistVgroup, normalTable) {
TEST
(
tableDistVgroup
,
childTableCase
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
*
vgInfo
=
NULL
;
SArray
*
vgList
=
NULL
;
...
...
@@ -1975,11 +1987,7 @@ TEST(tableDistVgroup, childTableCase) {
strcpy
(
n
.
tname
,
ctgTestCTablename
);
code
=
catalogGetTableDistVgInfo
(
pCtg
,
mockPointer
,
&
n
,
&
vgList
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
taosArrayGetSize
((
const
SArray
*
)
vgList
),
1
);
vgInfo
=
(
SVgroupInfo
*
)
taosArrayGet
(
vgList
,
0
);
ASSERT_EQ
(
vgInfo
->
vgId
,
9
);
ASSERT_EQ
(
vgInfo
->
epSet
.
numOfEps
,
4
);
ASSERT_TRUE
(
code
!=
0
);
catalogDestroy
();
memset
(
&
gCtgMgmt
,
0
,
sizeof
(
gCtgMgmt
));
...
...
@@ -1987,7 +1995,8 @@ TEST(tableDistVgroup, childTableCase) {
TEST
(
tableDistVgroup
,
superTableCase
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
*
vgInfo
=
NULL
;
SArray
*
vgList
=
NULL
;
...
...
@@ -2034,7 +2043,8 @@ TEST(tableDistVgroup, superTableCase) {
TEST
(
dbVgroup
,
getSetDbVgroupCase
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
vgInfo
=
{
0
};
SVgroupInfo
*
pvgInfo
=
NULL
;
SDBVgInfo
*
dbVgroup
=
NULL
;
...
...
@@ -2082,12 +2092,7 @@ TEST(dbVgroup, getSetDbVgroupCase) {
ASSERT_EQ
(
vgInfo
.
epSet
.
numOfEps
,
3
);
code
=
catalogGetTableDistVgInfo
(
pCtg
,
mockPointer
,
&
n
,
&
vgList
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
taosArrayGetSize
((
const
SArray
*
)
vgList
),
1
);
pvgInfo
=
(
SVgroupInfo
*
)
taosArrayGet
(
vgList
,
0
);
ASSERT_EQ
(
pvgInfo
->
vgId
,
8
);
ASSERT_EQ
(
pvgInfo
->
epSet
.
numOfEps
,
3
);
taosArrayDestroy
(
vgList
);
ASSERT_TRUE
(
code
!=
0
);
ctgTestBuildDBVgroup
(
&
dbVgroup
);
code
=
catalogUpdateDBVgInfo
(
pCtg
,
ctgTestDbname
,
ctgTestDbId
,
dbVgroup
);
...
...
@@ -2109,12 +2114,7 @@ TEST(dbVgroup, getSetDbVgroupCase) {
ASSERT_EQ
(
vgInfo
.
epSet
.
numOfEps
,
2
);
code
=
catalogGetTableDistVgInfo
(
pCtg
,
mockPointer
,
&
n
,
&
vgList
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
taosArrayGetSize
((
const
SArray
*
)
vgList
),
1
);
pvgInfo
=
(
SVgroupInfo
*
)
taosArrayGet
(
vgList
,
0
);
ASSERT_EQ
(
pvgInfo
->
vgId
,
8
);
ASSERT_EQ
(
pvgInfo
->
epSet
.
numOfEps
,
3
);
taosArrayDestroy
(
vgList
);
ASSERT_TRUE
(
code
!=
0
);
catalogDestroy
();
memset
(
&
gCtgMgmt
,
0
,
sizeof
(
gCtgMgmt
));
...
...
@@ -2122,7 +2122,8 @@ TEST(dbVgroup, getSetDbVgroupCase) {
TEST
(
multiThread
,
getSetRmSameDbVgroup
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
vgInfo
=
{
0
};
SVgroupInfo
*
pvgInfo
=
NULL
;
SDBVgInfo
dbVgroup
=
{
0
};
...
...
@@ -2174,7 +2175,8 @@ TEST(multiThread, getSetRmSameDbVgroup) {
TEST
(
multiThread
,
getSetRmDiffDbVgroup
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
vgInfo
=
{
0
};
SVgroupInfo
*
pvgInfo
=
NULL
;
SDBVgInfo
dbVgroup
=
{
0
};
...
...
@@ -2226,7 +2228,8 @@ TEST(multiThread, getSetRmDiffDbVgroup) {
TEST
(
multiThread
,
ctableMeta
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
vgInfo
=
{
0
};
SVgroupInfo
*
pvgInfo
=
NULL
;
SDBVgInfo
dbVgroup
=
{
0
};
...
...
@@ -2277,7 +2280,8 @@ TEST(multiThread, ctableMeta) {
TEST
(
rentTest
,
allRent
)
{
struct
SCatalog
*
pCtg
=
NULL
;
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
0x1
;
SRequestConnInfo
connInfo
=
{
0
};
SRequestConnInfo
*
mockPointer
=
(
SRequestConnInfo
*
)
&
connInfo
;
SVgroupInfo
vgInfo
=
{
0
};
SVgroupInfo
*
pvgInfo
=
NULL
;
SDBVgInfo
dbVgroup
=
{
0
};
...
...
@@ -2352,7 +2356,6 @@ TEST(rentTest, allRent) {
memset
(
&
gCtgMgmt
,
0
,
sizeof
(
gCtgMgmt
));
}
#endif
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
...
...
source/libs/scheduler/inc/schInt.h
浏览文件 @
ce7fbaa6
...
...
@@ -57,8 +57,8 @@ typedef enum {
#define SCHEDULE_DEFAULT_POLICY SCH_LOAD_SEQ
#define SCHEDULE_DEFAULT_MAX_NODE_NUM 20
#define SCH_DEFAULT_TASK_TIMEOUT_USEC
1
0000000
#define SCH_MAX_TASK_TIMEOUT_USEC
6
0000000
#define SCH_DEFAULT_TASK_TIMEOUT_USEC
6
0000000
#define SCH_MAX_TASK_TIMEOUT_USEC
30
0000000
#define SCH_DEFAULT_MAX_RETRY_NUM 6
#define SCH_MIN_AYSNC_EXEC_NUM 3
...
...
source/libs/scheduler/src/schRemote.c
浏览文件 @
ce7fbaa6
...
...
@@ -145,8 +145,10 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa
int32_t
msgType
=
pMsg
->
msgType
;
bool
dropExecNode
=
(
msgType
==
TDMT_SCH_LINK_BROKEN
||
SCH_NETWORK_ERR
(
rspCode
));
SCH_ERR_JRET
(
schUpdateTaskHandle
(
pJob
,
pTask
,
dropExecNode
,
pMsg
->
handle
,
execId
));
if
(
SCH_IS_QUERY_JOB
(
pJob
))
{
SCH_ERR_JRET
(
schUpdateTaskHandle
(
pJob
,
pTask
,
dropExecNode
,
pMsg
->
handle
,
execId
));
}
SCH_ERR_JRET
(
schValidateRspMsgType
(
pJob
,
pTask
,
msgType
));
int32_t
reqType
=
IsReq
(
pMsg
)
?
pMsg
->
msgType
:
(
pMsg
->
msgType
-
1
);
...
...
source/libs/scheduler/src/schTask.c
浏览文件 @
ce7fbaa6
...
...
@@ -127,6 +127,7 @@ int32_t schDropTaskExecNode(SSchJob *pJob, SSchTask *pTask, void *handle, int32_
if
(
taosHashRemove
(
pTask
->
execNodes
,
&
execId
,
sizeof
(
execId
)))
{
SCH_TASK_DLOG
(
"execId %d already not in execNodeList"
,
execId
);
SCH_ERR_RET
(
TSDB_CODE_SCH_IGNORE_ERROR
);
}
else
{
SCH_TASK_DLOG
(
"execId %d removed from execNodeList"
,
execId
);
}
...
...
source/util/src/thash.c
浏览文件 @
ce7fbaa6
...
...
@@ -798,7 +798,7 @@ static void *taosHashReleaseNode(SHashObj *pHashObj, void *p, int *slot) {
}
void
*
taosHashIterate
(
SHashObj
*
pHashObj
,
void
*
p
)
{
if
(
pHashObj
==
NULL
)
return
NULL
;
if
(
pHashObj
==
NULL
||
pHashObj
->
size
==
0
)
return
NULL
;
int
slot
=
0
;
char
*
data
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录