Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d294014f
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看板
提交
d294014f
编写于
12月 24, 2021
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TS-983]<feature>:create subtable to specific vgroups by _taos_meta_sync_table_name_taos_
上级
d752761b
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
79 addition
and
3 deletion
+79
-3
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+7
-0
src/common/src/tglobal.c
src/common/src/tglobal.c
+15
-0
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+22
-1
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+34
-1
src/util/inc/tconfig.h
src/util/inc/tconfig.h
+1
-1
未找到文件。
src/common/inc/tglobal.h
浏览文件 @
d294014f
...
...
@@ -64,6 +64,7 @@ extern int32_t tsCompressMsgSize;
extern
int32_t
tsCompressColData
;
extern
int32_t
tsMaxNumOfDistinctResults
;
extern
char
tsTempDir
[];
extern
int32_t
tsMetaSyncOption
;
// query buffer management
extern
int32_t
tsQueryBufferSize
;
// maximum allowed usage buffer size in MB for each data node during query processing
...
...
@@ -223,6 +224,12 @@ extern int32_t debugFlag;
extern
int8_t
tsClientMerge
;
// informal
#define META_SYNC_TABLE_NAME "_taos_meta_sync_table_name_taos_"
#define META_SYNC_TABLE_NAME_LEN 32
extern
int32_t
tVgId
;
// informal
#ifdef TD_TSZ
// lossy
extern
char
lossyColumns
[];
...
...
src/common/src/tglobal.c
浏览文件 @
d294014f
...
...
@@ -65,6 +65,7 @@ char tsLocale[TSDB_LOCALE_LEN] = {0};
char
tsCharset
[
TSDB_LOCALE_LEN
]
=
{
0
};
// default encode string
int8_t
tsEnableCoreFile
=
0
;
int32_t
tsMaxBinaryDisplayWidth
=
30
;
int32_t
tsMetaSyncOption
=
0
;
/*
* denote if the server needs to compress response message at the application layer to client, including query rsp,
...
...
@@ -273,6 +274,10 @@ int32_t fsDebugFlag = 135;
int8_t
tsClientMerge
=
0
;
// informal
int32_t
tVgId
=
0
;
// vgroupd ID
// informal
#ifdef TD_TSZ
//
// lossy compress 6
...
...
@@ -1738,6 +1743,16 @@ static void doInitGlobalConfig(void) {
cfg
.
unitType
=
TAOS_CFG_UTYPE_MB
;
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"metaSyncOption"
;
cfg
.
ptr
=
&
tsMetaSyncOption
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
0
;
cfg
.
maxValue
=
1
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
#ifdef TD_TSZ
// lossy compress
cfg
.
option
=
"lossyColumns"
;
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
d294014f
...
...
@@ -1726,6 +1726,9 @@ int32_t mnodeRetrieveShowSuperTables(SShowObj *pShow, char *data, int32_t rows,
cols
++
;
numOfRows
++
;
mDebug
(
"stable: %s, uid: %"
PRIu64
,
prefix
,
pTable
->
uid
);
mnodeDecTableRef
(
pTable
);
}
...
...
@@ -2227,9 +2230,27 @@ static int32_t mnodeProcessCreateChildTableMsg(SMnodeMsg *pMsg) {
if
(
pMsg
->
pTable
==
NULL
)
{
SVgObj
*
pVgroup
=
NULL
;
int32_t
tid
=
0
;
if
(
tsMetaSyncOption
)
{
char
tbName
[
TSDB_TABLE_NAME_LEN
]
=
"
\0
"
;
strncpy
(
tbName
,
pCreate
->
tableName
,
TSDB_TABLE_NAME_LEN
);
char
*
pTbName
=
strtok
(
tbName
,
"."
);
if
(
pTbName
)
{
pTbName
=
strtok
(
NULL
,
"."
);
if
(
pTbName
)
{
pTbName
=
strtok
(
NULL
,
"."
);
if
(
pTbName
)
{
if
(
0
==
strncmp
(
META_SYNC_TABLE_NAME
,
pTbName
,
META_SYNC_TABLE_NAME_LEN
))
{
tVgId
=
atoi
(
pTbName
+
META_SYNC_TABLE_NAME_LEN
);
}
}
}
}
}
code
=
mnodeGetAvailableVgroup
(
pMsg
,
&
pVgroup
,
&
tid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
m
Debug
(
"msg:%p, app:%p table:%s, failed to get available vgroup, reason:%s"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
m
Error
(
"msg:%p, app:%p table:%s, failed to get available vgroup, reason:%s"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
pCreate
->
tableName
,
tstrerror
(
code
));
return
code
;
}
...
...
src/mnode/src/mnodeVgroup.c
浏览文件 @
d294014f
...
...
@@ -432,6 +432,39 @@ int32_t mnodeGetAvailableVgroup(SMnodeMsg *pMsg, SVgObj **ppVgroup, int32_t *pSi
SDbObj
*
pDb
=
pMsg
->
pDb
;
pthread_mutex_lock
(
&
pDb
->
mutex
);
if
(
tVgId
>
0
)
{
for
(
int32_t
v
=
0
;
v
<
pDb
->
numOfVgroups
;
++
v
)
{
SVgObj
*
pVgroup
=
pDb
->
vgList
[
v
];
if
(
pVgroup
==
NULL
)
{
mError
(
"db:%s, vgroup: %d is null"
,
pDb
->
name
,
v
);
pthread_mutex_unlock
(
&
pDb
->
mutex
);
return
TSDB_CODE_MND_APP_ERROR
;
}
if
(
pVgroup
->
vgId
!=
(
uint32_t
)
tVgId
)
{
// find the target vgId
continue
;
}
int32_t
sid
=
taosAllocateId
(
pVgroup
->
idPool
);
if
(
sid
<=
0
)
{
mError
(
"msg:%p, app:%p db:%s, no enough sid in vgId:%d"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
pDb
->
name
,
pVgroup
->
vgId
);
pthread_mutex_unlock
(
&
pDb
->
mutex
);
return
TSDB_CODE_MND_APP_ERROR
;
}
mDebug
(
"vgId:%d, alloc tid:%d"
,
pVgroup
->
vgId
,
sid
);
*
pSid
=
sid
;
*
ppVgroup
=
pVgroup
;
pDb
->
vgListIndex
=
v
;
pthread_mutex_unlock
(
&
pDb
->
mutex
);
return
TSDB_CODE_SUCCESS
;
}
pthread_mutex_unlock
(
&
pDb
->
mutex
);
mError
(
"db:%s, vgroup: %d not exist"
,
pDb
->
name
,
tVgId
);
return
TSDB_CODE_MND_APP_ERROR
;
}
for
(
int32_t
v
=
0
;
v
<
pDb
->
numOfVgroups
;
++
v
)
{
int
vgIndex
=
(
v
+
pDb
->
vgListIndex
)
%
pDb
->
numOfVgroups
;
SVgObj
*
pVgroup
=
pDb
->
vgList
[
vgIndex
];
...
...
src/util/inc/tconfig.h
浏览文件 @
d294014f
...
...
@@ -20,7 +20,7 @@
extern
"C"
{
#endif
#define TSDB_CFG_MAX_NUM 13
0
#define TSDB_CFG_MAX_NUM 13
1
#define TSDB_CFG_PRINT_LEN 23
#define TSDB_CFG_OPTION_LEN 24
#define TSDB_CFG_VALUE_LEN 41
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录