Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1b98943d
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,发现更多精彩内容 >>
提交
1b98943d
编写于
2月 07, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature/qnode
上级
e532baee
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
394 addition
and
234 deletion
+394
-234
include/libs/catalog/catalog.h
include/libs/catalog/catalog.h
+1
-1
include/libs/qcom/query.h
include/libs/qcom/query.h
+1
-0
include/util/taoserror.h
include/util/taoserror.h
+1
-0
source/client/src/clientHb.c
source/client/src/clientHb.c
+1
-2
source/libs/catalog/inc/catalogInt.h
source/libs/catalog/inc/catalogInt.h
+10
-3
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+376
-224
source/libs/catalog/test/catalogTests.cpp
source/libs/catalog/test/catalogTests.cpp
+2
-3
source/libs/qcom/src/querymsg.c
source/libs/qcom/src/querymsg.c
+1
-1
source/util/src/terror.c
source/util/src/terror.c
+1
-0
未找到文件。
include/libs/catalog/catalog.h
浏览文件 @
1b98943d
...
...
@@ -99,7 +99,7 @@ int32_t catalogGetDBVgroupVersion(struct SCatalog* pCatalog, const char* dbName,
*/
int32_t
catalogGetDBVgroup
(
struct
SCatalog
*
pCatalog
,
void
*
pTransporter
,
const
SEpSet
*
pMgmtEps
,
const
char
*
pDBName
,
bool
forceUpdate
,
SArray
**
pVgroupList
);
int32_t
catalogUpdateDBVgroup
(
struct
SCatalog
*
pCatalog
,
const
char
*
dbName
,
SDBVgroupInfo
*
dbInfo
);
int32_t
catalogUpdateDBVgroup
(
struct
SCatalog
*
pCatalog
,
const
char
*
dbName
,
uint64_t
dbId
,
SDBVgroupInfo
*
dbInfo
);
int32_t
catalogRemoveDB
(
struct
SCatalog
*
pCatalog
,
const
char
*
dbName
,
uint64_t
dbId
);
...
...
include/libs/qcom/query.h
浏览文件 @
1b98943d
...
...
@@ -89,6 +89,7 @@ typedef struct SDBVgroupInfo {
typedef
struct
SUseDbOutput
{
char
db
[
TSDB_DB_FNAME_LEN
];
uint64_t
dbId
;
SDBVgroupInfo
*
dbVgroup
;
}
SUseDbOutput
;
...
...
include/util/taoserror.h
浏览文件 @
1b98943d
无法预览此类型文件
source/client/src/clientHb.c
浏览文件 @
1b98943d
...
...
@@ -44,7 +44,6 @@ static int32_t hbProcessDBInfoRsp(void *value, int32_t valueLen, struct SCatalog
code
=
catalogRemoveDB
(
pCatalog
,
rsp
->
db
,
rsp
->
uid
);
}
else
{
SDBVgroupInfo
vgInfo
=
{
0
};
vgInfo
.
dbId
=
rsp
->
uid
;
vgInfo
.
vgVersion
=
rsp
->
vgVersion
;
vgInfo
.
hashMethod
=
rsp
->
hashMethod
;
vgInfo
.
vgHash
=
taosHashInit
(
rsp
->
vgNum
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
true
,
HASH_ENTRY_LOCK
);
...
...
@@ -69,7 +68,7 @@ static int32_t hbProcessDBInfoRsp(void *value, int32_t valueLen, struct SCatalog
}
}
code
=
catalogUpdateDBVgroup
(
pCatalog
,
rsp
->
db
,
&
vgInfo
);
code
=
catalogUpdateDBVgroup
(
pCatalog
,
rsp
->
db
,
rsp
->
uid
,
&
vgInfo
);
if
(
code
)
{
taosHashCleanup
(
vgInfo
.
vgHash
);
}
...
...
source/libs/catalog/inc/catalogInt.h
浏览文件 @
1b98943d
...
...
@@ -48,18 +48,22 @@ enum {
};
typedef
struct
SCtgDebug
{
int32_t
lockDebug
;
bool
lockDebug
;
bool
cacheDebug
;
uint32_t
showCachePeriodSec
;
}
SCtgDebug
;
typedef
struct
SCtgTbMetaCache
{
SRWLatch
stbLock
;
SHashObj
*
cache
;
//key:tbname, value:STableMeta
SRWLatch
metaLock
;
// RC between cache destroy and all other operations
SHashObj
*
metaCache
;
//key:tbname, value:STableMeta
SHashObj
*
stbCache
;
//key:suid, value:STableMeta*
}
SCtgTbMetaCache
;
typedef
struct
SCtgDBCache
{
SRWLatch
vgLock
;
uint64_t
dbId
;
int8_t
deleted
;
SDBVgroupInfo
*
vgInfo
;
SCtgTbMetaCache
tbCache
;
...
...
@@ -136,7 +140,8 @@ typedef uint32_t (*tableNameHashFp)(const char *, uint32_t);
#define CTG_RET(c) do { int32_t _code = c; if (_code != TSDB_CODE_SUCCESS) { terrno = _code; } return _code; } while (0)
#define CTG_ERR_JRET(c) do { code = c; if (code != TSDB_CODE_SUCCESS) { terrno = code; goto _return; } } while (0)
#define CTG_LOCK_DEBUG(...) do { if (gCTGDebug.lockDebug) { qDebug(__VA_ARGS__); } } while (0)
#define CTG_LOCK_DEBUG(...) do { if (gCTGDebug.lockDebug) { ctgDebug(__VA_ARGS__); } } while (0)
#define CTG_CACHE_DEBUG(...) do { if (gCTGDebug.cacheDebug) { ctgDebug(__VA_ARGS__); } } while (0)
#define TD_RWLATCH_WRITE_FLAG_COPY 0x40000000
...
...
@@ -173,6 +178,8 @@ typedef uint32_t (*tableNameHashFp)(const char *, uint32_t);
} while (0)
#ifdef __cplusplus
}
#endif
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
1b98943d
此差异已折叠。
点击以展开。
source/libs/catalog/test/catalogTests.cpp
浏览文件 @
1b98943d
...
...
@@ -185,7 +185,6 @@ void ctgTestBuildDBVgroup(SDBVgroupInfo **pdbVgroup) {
ctgTestCurrentVgVersion
=
dbVgroup
->
vgVersion
;
dbVgroup
->
hashMethod
=
0
;
dbVgroup
->
dbId
=
ctgTestDbId
;
dbVgroup
->
vgHash
=
taosHashInit
(
ctgTestVgNum
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
true
,
HASH_ENTRY_LOCK
);
vgNum
=
ctgTestGetVgNumFromVgVersion
(
dbVgroup
->
vgVersion
);
...
...
@@ -600,7 +599,7 @@ void *ctgTestSetDbVgroupThread(void *param) {
while
(
!
ctgTestStop
)
{
ctgTestBuildDBVgroup
(
&
dbVgroup
);
code
=
catalogUpdateDBVgroup
(
pCtg
,
ctgTestDbname
,
dbVgroup
);
code
=
catalogUpdateDBVgroup
(
pCtg
,
ctgTestDbname
,
ctgTestDbId
,
dbVgroup
);
if
(
code
)
{
assert
(
0
);
}
...
...
@@ -1109,7 +1108,7 @@ TEST(dbVgroup, getSetDbVgroupCase) {
taosArrayDestroy
(
vgList
);
ctgTestBuildDBVgroup
(
&
dbVgroup
);
code
=
catalogUpdateDBVgroup
(
pCtg
,
ctgTestDbname
,
dbVgroup
);
code
=
catalogUpdateDBVgroup
(
pCtg
,
ctgTestDbname
,
ctgTestDbId
,
dbVgroup
);
ASSERT_EQ
(
code
,
0
);
code
=
catalogGetTableHashVgroup
(
pCtg
,
mockPointer
,
(
const
SEpSet
*
)
mockPointer
,
&
n
,
&
vgInfo
);
...
...
source/libs/qcom/src/querymsg.c
浏览文件 @
1b98943d
...
...
@@ -119,9 +119,9 @@ int32_t queryProcessUseDBRsp(void* output, char *msg, int32_t msgSize) {
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
pOut
->
dbId
=
pRsp
->
uid
;
pOut
->
dbVgroup
->
vgVersion
=
pRsp
->
vgVersion
;
pOut
->
dbVgroup
->
hashMethod
=
pRsp
->
hashMethod
;
pOut
->
dbVgroup
->
dbId
=
pRsp
->
uid
;
pOut
->
dbVgroup
->
vgHash
=
taosHashInit
(
pRsp
->
vgNum
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
true
,
HASH_ENTRY_LOCK
);
if
(
NULL
==
pOut
->
dbVgroup
->
vgHash
)
{
qError
(
"taosHashInit %d failed"
,
pRsp
->
vgNum
);
...
...
source/util/src/terror.c
浏览文件 @
1b98943d
...
...
@@ -418,6 +418,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_CTG_INVALID_INPUT, "invalid catalog input
TAOS_DEFINE_ERROR
(
TSDB_CODE_CTG_NOT_READY
,
"catalog is not ready"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_CTG_MEM_ERROR
,
"catalog memory error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_CTG_SYS_ERROR
,
"catalog system error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_CTG_DB_DROPPED
,
"Database is dropped"
)
//scheduler
TAOS_DEFINE_ERROR
(
TSDB_CODE_SCH_STATUS_ERROR
,
"scheduler status error"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录