Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
09e6462c
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看板
提交
09e6462c
编写于
3月 03, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature/qnode
上级
15ed48c3
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
812 addition
and
136 deletion
+812
-136
include/common/tmsg.h
include/common/tmsg.h
+4
-0
source/common/src/tmsg.c
source/common/src/tmsg.c
+6
-0
source/dnode/mgmt/impl/src/dndVnodes.c
source/dnode/mgmt/impl/src/dndVnodes.c
+3
-0
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+3
-0
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+3
-0
source/dnode/vnode/src/vnd/vnodeMain.c
source/dnode/vnode/src/vnd/vnodeMain.c
+3
-0
source/libs/catalog/inc/catalogInt.h
source/libs/catalog/inc/catalogInt.h
+28
-13
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+213
-92
source/libs/catalog/test/catalogTests.cpp
source/libs/catalog/test/catalogTests.cpp
+549
-31
未找到文件。
include/common/tmsg.h
浏览文件 @
09e6462c
...
@@ -739,6 +739,9 @@ typedef struct {
...
@@ -739,6 +739,9 @@ typedef struct {
int32_t
maxRows
;
int32_t
maxRows
;
int32_t
commitTime
;
int32_t
commitTime
;
int32_t
fsyncPeriod
;
int32_t
fsyncPeriod
;
uint32_t
hashBegin
;
uint32_t
hashEnd
;
int8_t
hashMethod
;
int8_t
walLevel
;
int8_t
walLevel
;
int8_t
precision
;
int8_t
precision
;
int8_t
compression
;
int8_t
compression
;
...
@@ -749,6 +752,7 @@ typedef struct {
...
@@ -749,6 +752,7 @@ typedef struct {
int8_t
selfIndex
;
int8_t
selfIndex
;
int8_t
streamMode
;
int8_t
streamMode
;
SReplica
replicas
[
TSDB_MAX_REPLICA
];
SReplica
replicas
[
TSDB_MAX_REPLICA
];
}
SCreateVnodeReq
,
SAlterVnodeReq
;
}
SCreateVnodeReq
,
SAlterVnodeReq
;
int32_t
tSerializeSCreateVnodeReq
(
void
*
buf
,
int32_t
bufLen
,
SCreateVnodeReq
*
pReq
);
int32_t
tSerializeSCreateVnodeReq
(
void
*
buf
,
int32_t
bufLen
,
SCreateVnodeReq
*
pReq
);
...
...
source/common/src/tmsg.c
浏览文件 @
09e6462c
...
@@ -2112,6 +2112,9 @@ int32_t tSerializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *pR
...
@@ -2112,6 +2112,9 @@ int32_t tSerializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *pR
if
(
tEncodeI32
(
&
encoder
,
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
commitTime
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
commitTime
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
fsyncPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
fsyncPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeU32
(
&
encoder
,
pReq
->
hashBegin
)
<
0
)
return
-
1
;
if
(
tEncodeU32
(
&
encoder
,
pReq
->
hashEnd
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
hashMethod
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
precision
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
precision
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
compression
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
compression
)
<
0
)
return
-
1
;
...
@@ -2152,6 +2155,9 @@ int32_t tDeserializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *
...
@@ -2152,6 +2155,9 @@ int32_t tDeserializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
commitTime
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
commitTime
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
fsyncPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
fsyncPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeU32
(
&
decoder
,
&
pReq
->
hashBegin
)
<
0
)
return
-
1
;
if
(
tDecodeU32
(
&
decoder
,
&
pReq
->
hashEnd
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
hashMethod
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
precision
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
precision
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
compression
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
compression
)
<
0
)
return
-
1
;
...
...
source/dnode/mgmt/impl/src/dndVnodes.c
浏览文件 @
09e6462c
...
@@ -523,6 +523,9 @@ static void dndGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) {
...
@@ -523,6 +523,9 @@ static void dndGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) {
pCfg
->
walCfg
.
rollPeriod
=
128
;
pCfg
->
walCfg
.
rollPeriod
=
128
;
pCfg
->
walCfg
.
segSize
=
128
;
pCfg
->
walCfg
.
segSize
=
128
;
pCfg
->
walCfg
.
vgId
=
pCreate
->
vgId
;
pCfg
->
walCfg
.
vgId
=
pCreate
->
vgId
;
pCfg
->
hashBegin
=
pCreate
->
hashBegin
;
pCfg
->
hashEnd
=
pCreate
->
hashEnd
;
pCfg
->
hashMethod
=
pCreate
->
hashMethod
;
}
}
static
void
dndGenerateWrapperCfg
(
SDnode
*
pDnode
,
SCreateVnodeReq
*
pCreate
,
SWrapperCfg
*
pCfg
)
{
static
void
dndGenerateWrapperCfg
(
SDnode
*
pDnode
,
SCreateVnodeReq
*
pCreate
,
SWrapperCfg
*
pCfg
)
{
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
09e6462c
...
@@ -215,6 +215,9 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg
...
@@ -215,6 +215,9 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg
createReq
.
replica
=
pVgroup
->
replica
;
createReq
.
replica
=
pVgroup
->
replica
;
createReq
.
selfIndex
=
-
1
;
createReq
.
selfIndex
=
-
1
;
createReq
.
streamMode
=
pVgroup
->
streamMode
;
createReq
.
streamMode
=
pVgroup
->
streamMode
;
createReq
.
hashBegin
=
pVgroup
->
hashBegin
;
createReq
.
hashEnd
=
pVgroup
->
hashEnd
;
createReq
.
hashMethod
=
pDb
->
hashMethod
;
for
(
int32_t
v
=
0
;
v
<
pVgroup
->
replica
;
++
v
)
{
for
(
int32_t
v
=
0
;
v
<
pVgroup
->
replica
;
++
v
)
{
SReplica
*
pReplica
=
&
createReq
.
replicas
[
v
];
SReplica
*
pReplica
=
&
createReq
.
replicas
[
v
];
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
09e6462c
...
@@ -57,6 +57,9 @@ typedef struct {
...
@@ -57,6 +57,9 @@ typedef struct {
SMetaCfg
metaCfg
;
SMetaCfg
metaCfg
;
STqCfg
tqCfg
;
STqCfg
tqCfg
;
SWalCfg
walCfg
;
SWalCfg
walCfg
;
uint32_t
hashBegin
;
uint32_t
hashEnd
;
int8_t
hashMethod
;
}
SVnodeCfg
;
}
SVnodeCfg
;
typedef
struct
{
typedef
struct
{
...
...
source/dnode/vnode/src/vnd/vnodeMain.c
浏览文件 @
09e6462c
...
@@ -30,6 +30,9 @@ SVnode *vnodeOpen(const char *path, const SVnodeCfg *pVnodeCfg) {
...
@@ -30,6 +30,9 @@ SVnode *vnodeOpen(const char *path, const SVnodeCfg *pVnodeCfg) {
cfg
.
pDnode
=
pVnodeCfg
->
pDnode
;
cfg
.
pDnode
=
pVnodeCfg
->
pDnode
;
cfg
.
pTfs
=
pVnodeCfg
->
pTfs
;
cfg
.
pTfs
=
pVnodeCfg
->
pTfs
;
cfg
.
dbId
=
pVnodeCfg
->
dbId
;
cfg
.
dbId
=
pVnodeCfg
->
dbId
;
cfg
.
hashBegin
=
pVnodeCfg
->
hashBegin
;
cfg
.
hashEnd
=
pVnodeCfg
->
hashEnd
;
cfg
.
hashMethod
=
pVnodeCfg
->
hashMethod
;
}
}
// Validate options
// Validate options
...
...
source/libs/catalog/inc/catalogInt.h
浏览文件 @
09e6462c
...
@@ -60,6 +60,7 @@ typedef struct SCtgDebug {
...
@@ -60,6 +60,7 @@ typedef struct SCtgDebug {
bool
lockDebug
;
bool
lockDebug
;
bool
cacheDebug
;
bool
cacheDebug
;
bool
apiDebug
;
bool
apiDebug
;
bool
metaDebug
;
uint32_t
showCachePeriodSec
;
uint32_t
showCachePeriodSec
;
}
SCtgDebug
;
}
SCtgDebug
;
...
@@ -119,6 +120,10 @@ typedef struct SCatalogStat {
...
@@ -119,6 +120,10 @@ typedef struct SCatalogStat {
SCtgCacheStat
cache
;
SCtgCacheStat
cache
;
}
SCatalogStat
;
}
SCatalogStat
;
typedef
struct
SCtgUpdateMsgHeader
{
SCatalog
*
pCtg
;
}
SCtgUpdateMsgHeader
;
typedef
struct
SCtgUpdateVgMsg
{
typedef
struct
SCtgUpdateVgMsg
{
SCatalog
*
pCtg
;
SCatalog
*
pCtg
;
char
dbFName
[
TSDB_DB_FNAME_LEN
];
char
dbFName
[
TSDB_DB_FNAME_LEN
];
...
@@ -145,6 +150,14 @@ typedef struct SCtgRemoveStbMsg {
...
@@ -145,6 +150,14 @@ typedef struct SCtgRemoveStbMsg {
uint64_t
suid
;
uint64_t
suid
;
}
SCtgRemoveStbMsg
;
}
SCtgRemoveStbMsg
;
typedef
struct
SCtgRemoveTblMsg
{
SCatalog
*
pCtg
;
char
dbFName
[
TSDB_DB_FNAME_LEN
];
char
tbName
[
TSDB_TABLE_NAME_LEN
];
uint64_t
dbId
;
}
SCtgRemoveTblMsg
;
typedef
struct
SCtgMetaAction
{
typedef
struct
SCtgMetaAction
{
int32_t
act
;
int32_t
act
;
void
*
data
;
void
*
data
;
...
@@ -189,19 +202,21 @@ typedef struct SCtgAction {
...
@@ -189,19 +202,21 @@ typedef struct SCtgAction {
#define CTG_IS_META_TABLE(type) ((type) == META_TYPE_TABLE)
#define CTG_IS_META_TABLE(type) ((type) == META_TYPE_TABLE)
#define CTG_IS_META_BOTH(type) ((type) == META_TYPE_BOTH_TABLE)
#define CTG_IS_META_BOTH(type) ((type) == META_TYPE_BOTH_TABLE)
#define CTG_FLAG_STB 0x1
#define CTG_FLAG_STB 0x1
#define CTG_FLAG_NOT_STB 0x2
#define CTG_FLAG_NOT_STB 0x2
#define CTG_FLAG_UNKNOWN_STB 0x4
#define CTG_FLAG_UNKNOWN_STB 0x4
#define CTG_FLAG_INF_DB 0x8
#define CTG_FLAG_INF_DB 0x8
#define CTG_FLAG_FORCE_UPDATE 0x10
#define CTG_IS_STB(_flag) ((_flag) & CTG_FLAG_STB)
#define CTG_IS_NOT_STB(_flag) ((_flag) & CTG_FLAG_NOT_STB)
#define CTG_FLAG_IS_STB(_flag) ((_flag) & CTG_FLAG_STB)
#define CTG_IS_UNKNOWN_STB(_flag) ((_flag) & CTG_FLAG_UNKNOWN_STB)
#define CTG_FLAG_IS_NOT_STB(_flag) ((_flag) & CTG_FLAG_NOT_STB)
#define CTG_IS_INF_DB(_flag) ((_flag) & CTG_FLAG_INF_DB)
#define CTG_FLAG_IS_UNKNOWN_STB(_flag) ((_flag) & CTG_FLAG_UNKNOWN_STB)
#define CTG_SET_INF_DB(_flag) ((_flag) |= CTG_FLAG_INF_DB)
#define CTG_FLAG_IS_INF_DB(_flag) ((_flag) & CTG_FLAG_INF_DB)
#define CTG_SET_STB(_flag, tbType) do { (_flag) |= ((tbType) == TSDB_SUPER_TABLE) ? CTG_FLAG_STB : ((tbType) > TSDB_SUPER_TABLE ? CTG_FLAG_NOT_STB : CTG_FLAG_UNKNOWN_STB); } while (0)
#define CTG_FLAG_IS_FORCE_UPDATE(_flag) ((_flag) & CTG_FLAG_FORCE_UPDATE)
#define CTG_GEN_STB_FLAG(_isStb) ((_isStb) == 1) ? CTG_FLAG_STB : ((_isStb) == 0 ? CTG_FLAG_NOT_STB : CTG_FLAG_UNKNOWN_STB)
#define CTG_FLAG_SET_INF_DB(_flag) ((_flag) |= CTG_FLAG_INF_DB)
#define CTG_TBTYPE_MATCH(_flag, tbType) (CTG_IS_UNKNOWN_STB(_flag) || (CTG_IS_STB(_flag) && (tbType) == TSDB_SUPER_TABLE) || (CTG_IS_NOT_STB(_flag) && (tbType) != TSDB_SUPER_TABLE))
#define CTG_FLAG_SET_STB(_flag, tbType) do { (_flag) |= ((tbType) == TSDB_SUPER_TABLE) ? CTG_FLAG_STB : ((tbType) > TSDB_SUPER_TABLE ? CTG_FLAG_NOT_STB : CTG_FLAG_UNKNOWN_STB); } while (0)
#define CTG_FLAG_MAKE_STB(_isStb) (((_isStb) == 1) ? CTG_FLAG_STB : ((_isStb) == 0 ? CTG_FLAG_NOT_STB : CTG_FLAG_UNKNOWN_STB))
#define CTG_FLAG_MATCH_STB(_flag, tbType) (CTG_FLAG_IS_UNKNOWN_STB(_flag) || (CTG_FLAG_IS_STB(_flag) && (tbType) == TSDB_SUPER_TABLE) || (CTG_FLAG_IS_NOT_STB(_flag) && (tbType) != TSDB_SUPER_TABLE))
#define CTG_IS_INF_DBNAME(_dbname) ((*(_dbname) == 'i') && (0 == strcmp(_dbname, TSDB_INFORMATION_SCHEMA_DB)))
#define CTG_IS_INF_DBNAME(_dbname) ((*(_dbname) == 'i') && (0 == strcmp(_dbname, TSDB_INFORMATION_SCHEMA_DB)))
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
09e6462c
此差异已折叠。
点击以展开。
source/libs/catalog/test/catalogTests.cpp
浏览文件 @
09e6462c
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录