Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2d7ccc3b
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看板
提交
2d7ccc3b
编写于
4月 28, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: refactor db options
上级
3cc90a8c
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
176 addition
and
236 deletion
+176
-236
include/common/tmsg.h
include/common/tmsg.h
+20
-35
source/common/src/tmsg.c
source/common/src/tmsg.c
+40
-46
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+0
-1
source/dnode/mgmt/test/vnode/vnode.cpp
source/dnode/mgmt/test/vnode/vnode.cpp
+8
-8
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+4
-6
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+46
-56
source/dnode/mnode/impl/src/mndInfoSchema.c
source/dnode/mnode/impl/src/mndInfoSchema.c
+0
-1
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+4
-6
source/dnode/mnode/impl/test/db/db.cpp
source/dnode/mnode/impl/test/db/db.cpp
+13
-21
source/dnode/mnode/impl/test/sma/sma.cpp
source/dnode/mnode/impl/test/sma/sma.cpp
+4
-7
source/dnode/mnode/impl/test/stb/stb.cpp
source/dnode/mnode/impl/test/stb/stb.cpp
+4
-7
source/dnode/mnode/impl/test/topic/topic.cpp
source/dnode/mnode/impl/test/topic/topic.cpp
+4
-7
source/dnode/mnode/impl/test/user/user.cpp
source/dnode/mnode/impl/test/user/user.cpp
+4
-7
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+0
-1
source/dnode/vnode/src/vnd/vnodeCfg.c
source/dnode/vnode/src/vnd/vnodeCfg.c
+0
-3
source/dnode/vnode/test/tsdbSmaTest.cpp
source/dnode/vnode/test/tsdbSmaTest.cpp
+1
-1
source/libs/catalog/test/catalogTests.cpp
source/libs/catalog/test/catalogTests.cpp
+4
-7
source/libs/parser/src/parTokenizer.c
source/libs/parser/src/parTokenizer.c
+3
-0
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+17
-16
未找到文件。
include/common/tmsg.h
浏览文件 @
2d7ccc3b
...
...
@@ -535,10 +535,10 @@ typedef struct {
int32_t
buffer
;
// MB
int32_t
pageSize
;
int32_t
pages
;
int32_t
d
urationPerFile
;
// unit is minute
int32_t
d
uration
ToKeep0
;
int32_t
d
uration
ToKeep1
;
int32_t
d
uration
ToKeep2
;
int32_t
d
aysPerFile
;
int32_t
d
ays
ToKeep0
;
int32_t
d
ays
ToKeep1
;
int32_t
d
ays
ToKeep2
;
int32_t
minRows
;
int32_t
maxRows
;
int32_t
fsyncPeriod
;
...
...
@@ -549,21 +549,8 @@ typedef struct {
int8_t
strict
;
int8_t
cacheLastRow
;
int8_t
ignoreExist
;
int8_t
streamMode
;
int32_t
numOfRetensions
;
SArray
*
pRetensions
;
// SRetention
// deleted or changed
int32_t
daysPerFile
;
// durationPerFile
int32_t
daysToKeep0
;
// durationToKeep0
int32_t
daysToKeep1
;
// durationToKeep1
int32_t
daysToKeep2
;
// durationToKeep2
int32_t
cacheBlockSize
;
// MB
int32_t
totalBlocks
;
int32_t
commitTime
;
int32_t
ttl
;
int8_t
update
;
int8_t
singleSTable
;
// numOfStables
}
SCreateDbReq
;
int32_t
tSerializeSCreateDbReq
(
void
*
buf
,
int32_t
bufLen
,
SCreateDbReq
*
pReq
);
...
...
@@ -575,10 +562,10 @@ typedef struct {
int32_t
buffer
;
int32_t
pageSize
;
int32_t
pages
;
int32_t
d
uration
PerFile
;
int32_t
d
uration
ToKeep0
;
int32_t
d
uration
ToKeep1
;
int32_t
d
uration
ToKeep2
;
int32_t
d
ays
PerFile
;
int32_t
d
ays
ToKeep0
;
int32_t
d
ays
ToKeep1
;
int32_t
d
ays
ToKeep2
;
int32_t
fsyncPeriod
;
int8_t
walLevel
;
int8_t
strict
;
...
...
@@ -643,10 +630,10 @@ typedef struct {
int32_t
buffer
;
int32_t
pageSize
;
int32_t
pages
;
int32_t
d
uration
PerFile
;
int32_t
d
uration
ToKeep0
;
int32_t
d
uration
ToKeep1
;
int32_t
d
uration
ToKeep2
;
int32_t
d
ays
PerFile
;
int32_t
d
ays
ToKeep0
;
int32_t
d
ays
ToKeep1
;
int32_t
d
ays
ToKeep2
;
int32_t
minRows
;
int32_t
maxRows
;
int32_t
fsyncPeriod
;
...
...
@@ -656,7 +643,6 @@ typedef struct {
int8_t
replications
;
int8_t
strict
;
int8_t
cacheLastRow
;
int8_t
streamMode
;
int32_t
numOfRetensions
;
SArray
*
pRetensions
;
}
SDbCfgRsp
;
...
...
@@ -860,10 +846,10 @@ typedef struct {
int32_t
buffer
;
int32_t
pageSize
;
int32_t
pages
;
int32_t
d
uration
PerFile
;
int32_t
d
uration
ToKeep0
;
int32_t
d
uration
ToKeep1
;
int32_t
d
uration
ToKeep2
;
int32_t
d
ays
PerFile
;
int32_t
d
ays
ToKeep0
;
int32_t
d
ays
ToKeep1
;
int32_t
d
ays
ToKeep2
;
int32_t
minRows
;
int32_t
maxRows
;
int32_t
fsyncPeriod
;
...
...
@@ -877,7 +863,6 @@ typedef struct {
int8_t
cacheLastRow
;
int8_t
replica
;
int8_t
selfIndex
;
int8_t
streamMode
;
SReplica
replicas
[
TSDB_MAX_REPLICA
];
int32_t
numOfRetensions
;
SArray
*
pRetensions
;
// SRetention
...
...
@@ -910,10 +895,10 @@ typedef struct {
int32_t
buffer
;
int32_t
pageSize
;
int32_t
pages
;
int32_t
d
uration
PerFile
;
int32_t
d
uration
ToKeep0
;
int32_t
d
uration
ToKeep1
;
int32_t
d
uration
ToKeep2
;
int32_t
d
ays
PerFile
;
int32_t
d
ays
ToKeep0
;
int32_t
d
ays
ToKeep1
;
int32_t
d
ays
ToKeep2
;
int32_t
fsyncPeriod
;
int8_t
walLevel
;
int8_t
strict
;
...
...
source/common/src/tmsg.c
浏览文件 @
2d7ccc3b
...
...
@@ -1680,10 +1680,10 @@ int32_t tSerializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq) {
if
(
tEncodeI32
(
&
encoder
,
pReq
->
buffer
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
pageSize
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
pages
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
PerFile
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
ToKeep0
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
ToKeep1
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
ToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
PerFile
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
ToKeep0
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
ToKeep1
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
ToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
minRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
fsyncPeriod
)
<
0
)
return
-
1
;
...
...
@@ -1694,7 +1694,6 @@ int32_t tSerializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq) {
if
(
tEncodeI8
(
&
encoder
,
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
cacheLastRow
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
ignoreExist
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
streamMode
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
numOfRetensions
)
<
0
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
pReq
->
numOfRetensions
;
++
i
)
{
SRetention
*
pRetension
=
taosArrayGet
(
pReq
->
pRetensions
,
i
);
...
...
@@ -1721,10 +1720,10 @@ int32_t tDeserializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq)
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
buffer
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
pageSize
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
pages
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
PerFile
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
ToKeep0
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
ToKeep1
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
ToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
PerFile
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
ToKeep0
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
ToKeep1
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
ToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
minRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
fsyncPeriod
)
<
0
)
return
-
1
;
...
...
@@ -1735,7 +1734,6 @@ int32_t tDeserializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq)
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
cacheLastRow
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
ignoreExist
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
streamMode
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
numOfRetensions
)
<
0
)
return
-
1
;
pReq
->
pRetensions
=
taosArrayInit
(
pReq
->
numOfRetensions
,
sizeof
(
SRetention
));
if
(
pReq
->
pRetensions
==
NULL
)
{
...
...
@@ -1775,10 +1773,10 @@ int32_t tSerializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) {
if
(
tEncodeI32
(
&
encoder
,
pReq
->
buffer
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
pageSize
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
pages
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
PerFile
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
ToKeep0
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
ToKeep1
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
ToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
PerFile
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
ToKeep0
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
ToKeep1
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
ToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
fsyncPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
strict
)
<
0
)
return
-
1
;
...
...
@@ -1800,10 +1798,10 @@ int32_t tDeserializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) {
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
buffer
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
pageSize
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
pages
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
PerFile
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
ToKeep0
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
ToKeep1
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
ToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
PerFile
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
ToKeep0
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
ToKeep1
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
ToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
fsyncPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
strict
)
<
0
)
return
-
1
;
...
...
@@ -2159,10 +2157,10 @@ int32_t tSerializeSDbCfgRsp(void *buf, int32_t bufLen, const SDbCfgRsp *pRsp) {
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
buffer
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
pageSize
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
pages
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
d
uration
PerFile
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
d
uration
ToKeep0
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
d
uration
ToKeep1
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
d
uration
ToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
d
ays
PerFile
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
d
ays
ToKeep0
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
d
ays
ToKeep1
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
d
ays
ToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
minRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
maxRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
fsyncPeriod
)
<
0
)
return
-
1
;
...
...
@@ -2172,7 +2170,6 @@ int32_t tSerializeSDbCfgRsp(void *buf, int32_t bufLen, const SDbCfgRsp *pRsp) {
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
replications
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
strict
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
cacheLastRow
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
streamMode
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
numOfRetensions
)
<
0
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
pRsp
->
numOfRetensions
;
++
i
)
{
SRetention
*
pRetension
=
taosArrayGet
(
pRsp
->
pRetensions
,
i
);
...
...
@@ -2198,10 +2195,10 @@ int32_t tDeserializeSDbCfgRsp(void *buf, int32_t bufLen, SDbCfgRsp *pRsp) {
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
buffer
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
pageSize
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
pages
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
d
uration
PerFile
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
d
uration
ToKeep0
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
d
uration
ToKeep1
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
d
uration
ToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
d
ays
PerFile
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
d
ays
ToKeep0
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
d
ays
ToKeep1
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
d
ays
ToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
minRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
maxRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
fsyncPeriod
)
<
0
)
return
-
1
;
...
...
@@ -2211,7 +2208,6 @@ int32_t tDeserializeSDbCfgRsp(void *buf, int32_t bufLen, SDbCfgRsp *pRsp) {
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
replications
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
strict
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
cacheLastRow
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
streamMode
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
numOfRetensions
)
<
0
)
return
-
1
;
pRsp
->
pRetensions
=
taosArrayInit
(
pRsp
->
numOfRetensions
,
sizeof
(
SRetention
));
if
(
pRsp
->
pRetensions
==
NULL
)
{
...
...
@@ -2815,10 +2811,10 @@ int32_t tSerializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *pR
if
(
tEncodeI32
(
&
encoder
,
pReq
->
buffer
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
pageSize
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
pages
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
PerFile
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
ToKeep0
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
ToKeep1
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
ToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
PerFile
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
ToKeep0
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
ToKeep1
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
ToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
minRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
fsyncPeriod
)
<
0
)
return
-
1
;
...
...
@@ -2832,7 +2828,6 @@ int32_t tSerializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *pR
if
(
tEncodeI8
(
&
encoder
,
pReq
->
cacheLastRow
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
replica
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
selfIndex
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
streamMode
)
<
0
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
TSDB_MAX_REPLICA
;
++
i
)
{
SReplica
*
pReplica
=
&
pReq
->
replicas
[
i
];
if
(
tEncodeSReplica
(
&
encoder
,
pReplica
)
<
0
)
return
-
1
;
...
...
@@ -2866,10 +2861,10 @@ int32_t tDeserializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
buffer
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
pageSize
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
pages
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
PerFile
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
ToKeep0
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
ToKeep1
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
ToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
PerFile
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
ToKeep0
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
ToKeep1
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
ToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
minRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
fsyncPeriod
)
<
0
)
return
-
1
;
...
...
@@ -2883,7 +2878,6 @@ int32_t tDeserializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
cacheLastRow
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
replica
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
selfIndex
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
streamMode
)
<
0
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
TSDB_MAX_REPLICA
;
++
i
)
{
SReplica
*
pReplica
=
&
pReq
->
replicas
[
i
];
if
(
tDecodeSReplica
(
&
decoder
,
pReplica
)
<
0
)
return
-
1
;
...
...
@@ -2986,10 +2980,10 @@ int32_t tSerializeSAlterVnodeReq(void *buf, int32_t bufLen, SAlterVnodeReq *pReq
if
(
tEncodeI32
(
&
encoder
,
pReq
->
buffer
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
pageSize
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
pages
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
PerFile
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
ToKeep0
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
ToKeep1
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
uration
ToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
PerFile
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
ToKeep0
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
ToKeep1
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
d
ays
ToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
fsyncPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
strict
)
<
0
)
return
-
1
;
...
...
@@ -3017,10 +3011,10 @@ int32_t tDeserializeSAlterVnodeReq(void *buf, int32_t bufLen, SAlterVnodeReq *pR
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
buffer
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
pageSize
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
pages
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
PerFile
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
ToKeep0
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
ToKeep1
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
uration
ToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
PerFile
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
ToKeep0
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
ToKeep1
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
d
ays
ToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
fsyncPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
strict
)
<
0
)
return
-
1
;
...
...
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
浏览文件 @
2d7ccc3b
...
...
@@ -107,7 +107,6 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) {
pCfg
->
vgId
=
pCreate
->
vgId
;
strcpy
(
pCfg
->
dbname
,
pCreate
->
db
);
pCfg
->
streamMode
=
pCreate
->
streamMode
;
pCfg
->
isWeak
=
true
;
pCfg
->
tsdbCfg
.
days
=
10
;
pCfg
->
tsdbCfg
.
keep2
=
3650
;
...
...
source/dnode/mgmt/test/vnode/vnode.cpp
浏览文件 @
2d7ccc3b
...
...
@@ -33,10 +33,10 @@ TEST_F(DndTestVnode, 01_Create_Vnode) {
strcpy
(
createReq
.
db
,
"1.d1"
);
createReq
.
dbUid
=
9527
;
createReq
.
vgVersion
=
1
;
createReq
.
d
uration
PerFile
=
10
;
createReq
.
d
uration
ToKeep0
=
3650
;
createReq
.
d
uration
ToKeep1
=
3650
;
createReq
.
d
uration
ToKeep2
=
3650
;
createReq
.
d
ays
PerFile
=
10
;
createReq
.
d
ays
ToKeep0
=
3650
;
createReq
.
d
ays
ToKeep1
=
3650
;
createReq
.
d
ays
ToKeep2
=
3650
;
createReq
.
minRows
=
100
;
createReq
.
minRows
=
4096
;
createReq
.
fsyncPeriod
=
3000
;
...
...
@@ -72,10 +72,10 @@ TEST_F(DndTestVnode, 02_Alter_Vnode) {
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
SAlterVnodeReq
alterReq
=
{
0
};
alterReq
.
vgVersion
=
2
;
alterReq
.
d
uration
PerFile
=
10
;
alterReq
.
d
uration
ToKeep0
=
3650
;
alterReq
.
d
uration
ToKeep1
=
3650
;
alterReq
.
d
uration
ToKeep2
=
3650
;
alterReq
.
d
ays
PerFile
=
10
;
alterReq
.
d
ays
ToKeep0
=
3650
;
alterReq
.
d
ays
ToKeep1
=
3650
;
alterReq
.
d
ays
ToKeep2
=
3650
;
alterReq
.
fsyncPeriod
=
3000
;
alterReq
.
walLevel
=
1
;
alterReq
.
replica
=
1
;
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
2d7ccc3b
...
...
@@ -261,10 +261,10 @@ typedef struct {
int32_t
buffer
;
int32_t
pageSize
;
int32_t
pages
;
int32_t
d
uration
PerFile
;
int32_t
d
uration
ToKeep0
;
int32_t
d
uration
ToKeep1
;
int32_t
d
uration
ToKeep2
;
int32_t
d
ays
PerFile
;
int32_t
d
ays
ToKeep0
;
int32_t
d
ays
ToKeep1
;
int32_t
d
ays
ToKeep2
;
int32_t
minRows
;
int32_t
maxRows
;
int32_t
fsyncPeriod
;
...
...
@@ -274,7 +274,6 @@ typedef struct {
int8_t
replications
;
int8_t
strict
;
int8_t
cacheLastRow
;
int8_t
streamMode
;
int8_t
hashMethod
;
// default is 1
int32_t
numOfRetensions
;
SArray
*
pRetensions
;
...
...
@@ -314,7 +313,6 @@ typedef struct {
int64_t
pointsWritten
;
int8_t
compact
;
int8_t
replica
;
int8_t
streamMode
;
SVnodeGid
vnodeGid
[
TSDB_MAX_REPLICA
];
}
SVgObj
;
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
2d7ccc3b
...
...
@@ -88,10 +88,10 @@ static SSdbRaw *mndDbActionEncode(SDbObj *pDb) {
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
buffer
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
pageSize
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
pages
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
d
uration
PerFile
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
d
uration
ToKeep0
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
d
uration
ToKeep1
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
d
uration
ToKeep2
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
d
ays
PerFile
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
d
ays
ToKeep0
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
d
ays
ToKeep1
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
d
ays
ToKeep2
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
minRows
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
maxRows
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
fsyncPeriod
,
_OVER
)
...
...
@@ -101,7 +101,6 @@ static SSdbRaw *mndDbActionEncode(SDbObj *pDb) {
SDB_SET_INT8
(
pRaw
,
dataPos
,
pDb
->
cfg
.
replications
,
_OVER
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pDb
->
cfg
.
strict
,
_OVER
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pDb
->
cfg
.
cacheLastRow
,
_OVER
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pDb
->
cfg
.
streamMode
,
_OVER
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pDb
->
cfg
.
hashMethod
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
numOfRetensions
,
_OVER
)
for
(
int32_t
i
=
0
;
i
<
pDb
->
cfg
.
numOfRetensions
;
++
i
)
{
...
...
@@ -160,10 +159,10 @@ static SSdbRow *mndDbActionDecode(SSdbRaw *pRaw) {
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
buffer
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
pageSize
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
pages
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
d
uration
PerFile
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
d
uration
ToKeep0
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
d
uration
ToKeep1
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
d
uration
ToKeep2
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
d
ays
PerFile
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
d
ays
ToKeep0
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
d
ays
ToKeep1
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
d
ays
ToKeep2
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
minRows
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
maxRows
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
fsyncPeriod
,
_OVER
)
...
...
@@ -173,7 +172,6 @@ static SSdbRow *mndDbActionDecode(SSdbRaw *pRaw) {
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
replications
,
_OVER
)
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
strict
,
_OVER
)
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
cacheLastRow
,
_OVER
)
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
streamMode
,
_OVER
)
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
hashMethod
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
numOfRetensions
,
_OVER
)
if
(
pDb
->
cfg
.
numOfRetensions
>
0
)
{
...
...
@@ -264,10 +262,10 @@ static int32_t mndCheckDbName(const char *dbName, SUserObj *pUser) {
static
int32_t
mndCheckDbCfg
(
SMnode
*
pMnode
,
SDbCfg
*
pCfg
)
{
if
(
pCfg
->
numOfVgroups
<
TSDB_MIN_VNODES_PER_DB
||
pCfg
->
numOfVgroups
>
TSDB_MAX_VNODES_PER_DB
)
return
-
1
;
/*
if (pCfg->
cacheBlockSize < TSDB_MIN_CACHE_BLOCK_SIZE || pCfg->cacheBlockSize > TSDB_MAX_CACHE_BLOCK_SIZ
E) return -1;
if (pCfg->
totalBlocks < TSDB_MIN_TOTAL_BLOCKS || pCfg->totalBlocks > TSDB_MAX_TOTAL_BLOCKS
) return -1;
*/
if
(
pCfg
->
numOfStables
<
TSDB_DB_STREAM_MODE_OFF
||
pCfg
->
numOfStables
>
TSDB_DB_STREAM_MODE_ON
)
return
-
1
;
if
(
pCfg
->
buffer
<
TSDB_MIN_BUFFER_PER_VNODE
||
pCfg
->
buffer
>
TSDB_MAX_BUFFER_PER_VNOD
E
)
return
-
1
;
if
(
pCfg
->
pageSize
<
TSDB_MIN_PAGESIZE_PER_VNODE
||
pCfg
->
pageSize
>
TSDB_MAX_PAGESIZE_PER_VNODE
)
return
-
1
;
if
(
pCfg
->
pages
<
TSDB_MIN_PAGES_PER_VNODE
||
pCfg
->
pages
>
TSDB_MAX_PAGES_PER_VNODE
)
return
-
1
;
if
(
pCfg
->
daysPerFile
<
TSDB_MIN_DAYS_PER_FILE
||
pCfg
->
daysPerFile
>
TSDB_MAX_DAYS_PER_FILE
)
return
-
1
;
if
(
pCfg
->
daysToKeep0
<
TSDB_MIN_KEEP
||
pCfg
->
daysToKeep0
>
TSDB_MAX_KEEP
)
return
-
1
;
if
(
pCfg
->
daysToKeep1
<
TSDB_MIN_KEEP
||
pCfg
->
daysToKeep1
>
TSDB_MAX_KEEP
)
return
-
1
;
...
...
@@ -279,7 +277,6 @@ static int32_t mndCheckDbCfg(SMnode *pMnode, SDbCfg *pCfg) {
if
(
pCfg
->
maxRows
<
TSDB_MIN_MAXROWS_FBLOCK
||
pCfg
->
maxRows
>
TSDB_MAX_MAXROWS_FBLOCK
)
return
-
1
;
if
(
pCfg
->
minRows
>
pCfg
->
maxRows
)
return
-
1
;
if
(
pCfg
->
fsyncPeriod
<
TSDB_MIN_FSYNC_PERIOD
||
pCfg
->
fsyncPeriod
>
TSDB_MAX_FSYNC_PERIOD
)
return
-
1
;
// if (pCfg->ttl < TSDB_MIN_TABLE_TTL) return -1;
if
(
pCfg
->
walLevel
<
TSDB_MIN_WAL_LEVEL
||
pCfg
->
walLevel
>
TSDB_MAX_WAL_LEVEL
)
return
-
1
;
if
(
pCfg
->
precision
<
TSDB_MIN_PRECISION
&&
pCfg
->
precision
>
TSDB_MAX_PRECISION
)
return
-
1
;
if
(
pCfg
->
compression
<
TSDB_MIN_COMP_LEVEL
||
pCfg
->
compression
>
TSDB_MAX_COMP_LEVEL
)
return
-
1
;
...
...
@@ -288,32 +285,29 @@ static int32_t mndCheckDbCfg(SMnode *pMnode, SDbCfg *pCfg) {
if
(
pCfg
->
strict
<
TSDB_DB_STRICT_OFF
||
pCfg
->
strict
>
TSDB_DB_STRICT_ON
)
return
-
1
;
if
(
pCfg
->
strict
>
pCfg
->
replications
)
return
-
1
;
if
(
pCfg
->
cacheLastRow
<
TSDB_MIN_DB_CACHE_LAST_ROW
||
pCfg
->
cacheLastRow
>
TSDB_MAX_DB_CACHE_LAST_ROW
)
return
-
1
;
if
(
pCfg
->
streamMode
<
TSDB_DB_STREAM_MODE_OFF
||
pCfg
->
streamMode
>
TSDB_DB_STREAM_MODE_ON
)
return
-
1
;
if
(
pCfg
->
hashMethod
!=
1
)
return
-
1
;
return
TSDB_CODE_SUCCESS
;
}
static
void
mndSetDefaultDbCfg
(
SDbCfg
*
pCfg
)
{
if
(
pCfg
->
numOfVgroups
<
0
)
pCfg
->
numOfVgroups
=
TSDB_DEFAULT_VN_PER_DB
;
if
(
pCfg
->
numOfStables
<
0
)
pCfg
->
numOfStables
=
TSDB_DEFAULT_
STBS_PER_DB
;
if
(
pCfg
->
buffer
<
0
)
pCfg
->
buffer
=
TSDB_DEFAULT_BUFFER_
SIZ
E
;
if
(
pCfg
->
pageSize
<
0
)
pCfg
->
pageSize
=
TSDB_DEFAULT_PAGE
_SIZ
E
;
if
(
pCfg
->
pages
<
0
)
pCfg
->
pages
=
TSDB_
DEFAULT_TOTAL_PAGES
;
if
(
pCfg
->
d
urationPerFile
<
0
)
pCfg
->
duration
PerFile
=
TSDB_DEFAULT_DURATION_PER_FILE
;
if
(
pCfg
->
d
urationToKeep0
<
0
)
pCfg
->
duration
ToKeep0
=
TSDB_DEFAULT_KEEP
;
if
(
pCfg
->
d
urationToKeep1
<
0
)
pCfg
->
durationToKeep1
=
pCfg
->
duration
ToKeep0
;
if
(
pCfg
->
d
urationToKeep2
<
0
)
pCfg
->
durationToKeep2
=
pCfg
->
duration
ToKeep1
;
if
(
pCfg
->
numOfStables
<
0
)
pCfg
->
numOfStables
=
TSDB_DEFAULT_
DB_SINGLE_STABLE
;
if
(
pCfg
->
buffer
<
0
)
pCfg
->
buffer
=
TSDB_DEFAULT_BUFFER_
PER_VNOD
E
;
if
(
pCfg
->
pageSize
<
0
)
pCfg
->
pageSize
=
TSDB_DEFAULT_PAGE
S_PER_VNOD
E
;
if
(
pCfg
->
pages
<
0
)
pCfg
->
pages
=
TSDB_
MAX_PAGESIZE_PER_VNODE
;
if
(
pCfg
->
d
aysPerFile
<
0
)
pCfg
->
days
PerFile
=
TSDB_DEFAULT_DURATION_PER_FILE
;
if
(
pCfg
->
d
aysToKeep0
<
0
)
pCfg
->
days
ToKeep0
=
TSDB_DEFAULT_KEEP
;
if
(
pCfg
->
d
aysToKeep1
<
0
)
pCfg
->
daysToKeep1
=
pCfg
->
days
ToKeep0
;
if
(
pCfg
->
d
aysToKeep2
<
0
)
pCfg
->
daysToKeep2
=
pCfg
->
days
ToKeep1
;
if
(
pCfg
->
minRows
<
0
)
pCfg
->
minRows
=
TSDB_DEFAULT_MINROWS_FBLOCK
;
if
(
pCfg
->
maxRows
<
0
)
pCfg
->
maxRows
=
TSDB_DEFAULT_MAXROWS_FBLOCK
;
if
(
pCfg
->
fsyncPeriod
<
0
)
pCfg
->
fsyncPeriod
=
TSDB_DEFAULT_FSYNC_PERIOD
;
if
(
pCfg
->
ttl
<
0
)
pCfg
->
ttl
=
TSDB_DEFAULT_TABLE_TTL
;
if
(
pCfg
->
walLevel
<
0
)
pCfg
->
walLevel
=
TSDB_DEFAULT_WAL_LEVEL
;
if
(
pCfg
->
precision
<
0
)
pCfg
->
precision
=
TSDB_DEFAULT_PRECISION
;
if
(
pCfg
->
compression
<
0
)
pCfg
->
compression
=
TSDB_DEFAULT_COMP_LEVEL
;
if
(
pCfg
->
replications
<
0
)
pCfg
->
replications
=
TSDB_DEFAULT_DB_REPLICA
;
if
(
pCfg
->
strict
<
0
)
pCfg
->
strict
=
TSDB_DEFAULT_DB_STRICT
;
if
(
pCfg
->
cacheLastRow
<
0
)
pCfg
->
cacheLastRow
=
TSDB_DEFAULT_CACHE_LAST_ROW
;
if
(
pCfg
->
streamMode
<
0
)
pCfg
->
streamMode
=
TSDB_DEFAULT_DB_STREAM_MODE
;
if
(
pCfg
->
numOfRetensions
<
0
)
pCfg
->
numOfRetensions
=
0
;
}
...
...
@@ -443,10 +437,10 @@ static int32_t mndCreateDb(SMnode *pMnode, SNodeMsg *pReq, SCreateDbReq *pCreate
.
buffer
=
pCreate
->
buffer
,
.
pageSize
=
pCreate
->
pageSize
,
.
pages
=
pCreate
->
pages
,
.
d
urationPerFile
=
pCreate
->
duration
PerFile
,
.
d
urationToKeep0
=
pCreate
->
duration
ToKeep0
,
.
d
urationToKeep1
=
pCreate
->
duration
ToKeep1
,
.
d
urationToKeep2
=
pCreate
->
duration
ToKeep2
,
.
d
aysPerFile
=
pCreate
->
days
PerFile
,
.
d
aysToKeep0
=
pCreate
->
days
ToKeep0
,
.
d
aysToKeep1
=
pCreate
->
days
ToKeep1
,
.
d
aysToKeep2
=
pCreate
->
days
ToKeep2
,
.
minRows
=
pCreate
->
minRows
,
.
maxRows
=
pCreate
->
maxRows
,
.
fsyncPeriod
=
pCreate
->
fsyncPeriod
,
...
...
@@ -456,7 +450,6 @@ static int32_t mndCreateDb(SMnode *pMnode, SNodeMsg *pReq, SCreateDbReq *pCreate
.
replications
=
pCreate
->
replications
,
.
strict
=
pCreate
->
strict
,
.
cacheLastRow
=
pCreate
->
cacheLastRow
,
.
streamMode
=
pCreate
->
streamMode
,
.
hashMethod
=
1
,
};
...
...
@@ -575,23 +568,23 @@ static int32_t mndSetDbCfgFromAlterDbReq(SDbObj *pDb, SAlterDbReq *pAlter) {
terrno
=
0
;
}
if
(
pAlter
->
d
urationPerFile
>=
0
&&
pAlter
->
durationPerFile
!=
pDb
->
cfg
.
duration
PerFile
)
{
pDb
->
cfg
.
d
urationPerFile
=
pAlter
->
duration
PerFile
;
if
(
pAlter
->
d
aysPerFile
>=
0
&&
pAlter
->
daysPerFile
!=
pDb
->
cfg
.
days
PerFile
)
{
pDb
->
cfg
.
d
aysPerFile
=
pAlter
->
days
PerFile
;
terrno
=
0
;
}
if
(
pAlter
->
d
urationToKeep0
>=
0
&&
pAlter
->
durationToKeep0
!=
pDb
->
cfg
.
duration
ToKeep0
)
{
pDb
->
cfg
.
d
urationToKeep0
=
pAlter
->
duration
ToKeep0
;
if
(
pAlter
->
d
aysToKeep0
>=
0
&&
pAlter
->
daysToKeep0
!=
pDb
->
cfg
.
days
ToKeep0
)
{
pDb
->
cfg
.
d
aysToKeep0
=
pAlter
->
days
ToKeep0
;
terrno
=
0
;
}
if
(
pAlter
->
d
urationToKeep1
>=
0
&&
pAlter
->
durationToKeep1
!=
pDb
->
cfg
.
duration
ToKeep1
)
{
pDb
->
cfg
.
d
urationToKeep1
=
pAlter
->
duration
ToKeep1
;
if
(
pAlter
->
d
aysToKeep1
>=
0
&&
pAlter
->
daysToKeep1
!=
pDb
->
cfg
.
days
ToKeep1
)
{
pDb
->
cfg
.
d
aysToKeep1
=
pAlter
->
days
ToKeep1
;
terrno
=
0
;
}
if
(
pAlter
->
d
urationToKeep2
>=
0
&&
pAlter
->
durationToKeep2
!=
pDb
->
cfg
.
duration
ToKeep2
)
{
pDb
->
cfg
.
d
urationToKeep2
=
pAlter
->
duration
ToKeep2
;
if
(
pAlter
->
d
aysToKeep2
>=
0
&&
pAlter
->
daysToKeep2
!=
pDb
->
cfg
.
days
ToKeep2
)
{
pDb
->
cfg
.
d
aysToKeep2
=
pAlter
->
days
ToKeep2
;
terrno
=
0
;
}
...
...
@@ -647,10 +640,10 @@ void *mndBuildAlterVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVgO
alterReq
.
buffer
=
pDb
->
cfg
.
buffer
;
alterReq
.
pages
=
pDb
->
cfg
.
pages
;
alterReq
.
pageSize
=
pDb
->
cfg
.
pageSize
;
alterReq
.
d
urationPerFile
=
pDb
->
cfg
.
duration
PerFile
;
alterReq
.
d
urationToKeep0
=
pDb
->
cfg
.
duration
ToKeep0
;
alterReq
.
d
urationToKeep1
=
pDb
->
cfg
.
duration
ToKeep1
;
alterReq
.
d
urationToKeep2
=
pDb
->
cfg
.
duration
ToKeep2
;
alterReq
.
d
aysPerFile
=
pDb
->
cfg
.
days
PerFile
;
alterReq
.
d
aysToKeep0
=
pDb
->
cfg
.
days
ToKeep0
;
alterReq
.
d
aysToKeep1
=
pDb
->
cfg
.
days
ToKeep1
;
alterReq
.
d
aysToKeep2
=
pDb
->
cfg
.
days
ToKeep2
;
alterReq
.
fsyncPeriod
=
pDb
->
cfg
.
fsyncPeriod
;
alterReq
.
walLevel
=
pDb
->
cfg
.
walLevel
;
alterReq
.
strict
=
pDb
->
cfg
.
strict
;
...
...
@@ -848,10 +841,10 @@ static int32_t mndProcessGetDbCfgReq(SNodeMsg *pReq) {
cfgRsp
.
buffer
=
pDb
->
cfg
.
buffer
;
cfgRsp
.
pageSize
=
pDb
->
cfg
.
pageSize
;
cfgRsp
.
pages
=
pDb
->
cfg
.
pages
;
cfgRsp
.
d
urationPerFile
=
pDb
->
cfg
.
duration
PerFile
;
cfgRsp
.
d
urationToKeep0
=
pDb
->
cfg
.
duration
ToKeep0
;
cfgRsp
.
d
urationToKeep1
=
pDb
->
cfg
.
duration
ToKeep1
;
cfgRsp
.
d
urationToKeep2
=
pDb
->
cfg
.
duration
ToKeep2
;
cfgRsp
.
d
aysPerFile
=
pDb
->
cfg
.
days
PerFile
;
cfgRsp
.
d
aysToKeep0
=
pDb
->
cfg
.
days
ToKeep0
;
cfgRsp
.
d
aysToKeep1
=
pDb
->
cfg
.
days
ToKeep1
;
cfgRsp
.
d
aysToKeep2
=
pDb
->
cfg
.
days
ToKeep2
;
cfgRsp
.
minRows
=
pDb
->
cfg
.
minRows
;
cfgRsp
.
maxRows
=
pDb
->
cfg
.
maxRows
;
cfgRsp
.
fsyncPeriod
=
pDb
->
cfg
.
fsyncPeriod
;
...
...
@@ -861,7 +854,6 @@ static int32_t mndProcessGetDbCfgReq(SNodeMsg *pReq) {
cfgRsp
.
replications
=
pDb
->
cfg
.
replications
;
cfgRsp
.
strict
=
pDb
->
cfg
.
strict
;
cfgRsp
.
cacheLastRow
=
pDb
->
cfg
.
cacheLastRow
;
cfgRsp
.
streamMode
=
pDb
->
cfg
.
streamMode
;
cfgRsp
.
numOfRetensions
=
pDb
->
cfg
.
numOfRetensions
;
cfgRsp
.
pRetensions
=
pDb
->
cfg
.
pRetensions
;
...
...
@@ -1443,16 +1435,16 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
b
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
d
uration
PerFile
,
false
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
d
ays
PerFile
,
false
);
char
tmp
[
128
]
=
{
0
};
int32_t
len
=
0
;
if
(
pDb
->
cfg
.
d
urationToKeep0
>
pDb
->
cfg
.
durationToKeep1
||
pDb
->
cfg
.
durationToKeep0
>
pDb
->
cfg
.
duration
ToKeep2
)
{
len
=
sprintf
(
&
tmp
[
VARSTR_HEADER_SIZE
],
"%d,%d,%d"
,
pDb
->
cfg
.
d
urationToKeep1
,
pDb
->
cfg
.
duration
ToKeep2
,
pDb
->
cfg
.
d
uration
ToKeep0
);
if
(
pDb
->
cfg
.
d
aysToKeep0
>
pDb
->
cfg
.
daysToKeep1
||
pDb
->
cfg
.
daysToKeep0
>
pDb
->
cfg
.
days
ToKeep2
)
{
len
=
sprintf
(
&
tmp
[
VARSTR_HEADER_SIZE
],
"%d,%d,%d"
,
pDb
->
cfg
.
d
aysToKeep1
,
pDb
->
cfg
.
days
ToKeep2
,
pDb
->
cfg
.
d
ays
ToKeep0
);
}
else
{
len
=
sprintf
(
&
tmp
[
VARSTR_HEADER_SIZE
],
"%d,%d,%d"
,
pDb
->
cfg
.
d
urationToKeep0
,
pDb
->
cfg
.
duration
ToKeep1
,
pDb
->
cfg
.
d
uration
ToKeep2
);
len
=
sprintf
(
&
tmp
[
VARSTR_HEADER_SIZE
],
"%d,%d,%d"
,
pDb
->
cfg
.
d
aysToKeep0
,
pDb
->
cfg
.
days
ToKeep1
,
pDb
->
cfg
.
d
ays
ToKeep2
);
}
varDataSetLen
(
tmp
,
len
);
...
...
@@ -1509,8 +1501,6 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
numOfStables
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
streamMode
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
b
,
false
);
...
...
source/dnode/mnode/impl/src/mndInfoSchema.c
浏览文件 @
2d7ccc3b
...
...
@@ -89,7 +89,6 @@ static const SInfosTableSchema userDBSchema[] = {
{.
name
=
"cachelast"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"precision"
,
.
bytes
=
2
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"single_stable"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"stream_mode"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"status"
,
.
bytes
=
10
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
// {.name = "update", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT}, // disable update
};
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
2d7ccc3b
...
...
@@ -194,10 +194,10 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg
createReq
.
buffer
=
pDb
->
cfg
.
buffer
;
createReq
.
pageSize
=
pDb
->
cfg
.
pageSize
;
createReq
.
pages
=
pDb
->
cfg
.
pages
;
createReq
.
d
urationPerFile
=
pDb
->
cfg
.
duration
PerFile
;
createReq
.
d
urationToKeep0
=
pDb
->
cfg
.
duration
ToKeep0
;
createReq
.
d
urationToKeep1
=
pDb
->
cfg
.
duration
ToKeep1
;
createReq
.
d
urationToKeep2
=
pDb
->
cfg
.
duration
ToKeep2
;
createReq
.
d
aysPerFile
=
pDb
->
cfg
.
days
PerFile
;
createReq
.
d
aysToKeep0
=
pDb
->
cfg
.
days
ToKeep0
;
createReq
.
d
aysToKeep1
=
pDb
->
cfg
.
days
ToKeep1
;
createReq
.
d
aysToKeep2
=
pDb
->
cfg
.
days
ToKeep2
;
createReq
.
minRows
=
pDb
->
cfg
.
minRows
;
createReq
.
maxRows
=
pDb
->
cfg
.
maxRows
;
createReq
.
fsyncPeriod
=
pDb
->
cfg
.
fsyncPeriod
;
...
...
@@ -208,7 +208,6 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg
createReq
.
cacheLastRow
=
pDb
->
cfg
.
cacheLastRow
;
createReq
.
replica
=
pVgroup
->
replica
;
createReq
.
selfIndex
=
-
1
;
createReq
.
streamMode
=
pVgroup
->
streamMode
;
createReq
.
hashBegin
=
pVgroup
->
hashBegin
;
createReq
.
hashEnd
=
pVgroup
->
hashEnd
;
createReq
.
hashMethod
=
pDb
->
cfg
.
hashMethod
;
...
...
@@ -398,7 +397,6 @@ int32_t mndAllocVgroup(SMnode *pMnode, SDbObj *pDb, SVgObj **ppVgroups) {
pVgroup
->
createdTime
=
taosGetTimestampMs
();
pVgroup
->
updateTime
=
pVgroups
->
createdTime
;
pVgroup
->
version
=
1
;
pVgroup
->
streamMode
=
pDb
->
cfg
.
streamMode
;
pVgroup
->
hashBegin
=
hashMin
+
hashInterval
*
v
;
if
(
v
==
pDb
->
cfg
.
numOfVgroups
-
1
)
{
pVgroup
->
hashEnd
=
hashMax
;
...
...
source/dnode/mnode/impl/test/db/db.cpp
浏览文件 @
2d7ccc3b
...
...
@@ -38,25 +38,21 @@ TEST_F(MndTestDb, 02_Create_Alter_Drop_Db) {
createReq
.
buffer
=
-
1
;
createReq
.
pageSize
=
-
1
;
createReq
.
pages
=
-
1
;
createReq
.
d
uration
PerFile
=
1000
;
createReq
.
d
uration
ToKeep0
=
3650
;
createReq
.
d
uration
ToKeep1
=
3650
;
createReq
.
d
uration
ToKeep2
=
3650
;
createReq
.
d
ays
PerFile
=
1000
;
createReq
.
d
ays
ToKeep0
=
3650
;
createReq
.
d
ays
ToKeep1
=
3650
;
createReq
.
d
ays
ToKeep2
=
3650
;
createReq
.
minRows
=
100
;
createReq
.
maxRows
=
4096
;
createReq
.
commitTime
=
3600
;
createReq
.
fsyncPeriod
=
3000
;
createReq
.
ttl
=
1
;
createReq
.
walLevel
=
1
;
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
replications
=
1
;
createReq
.
strict
=
1
;
createReq
.
update
=
0
;
createReq
.
cacheLastRow
=
0
;
createReq
.
ignoreExist
=
1
;
createReq
.
streamMode
=
0
;
createReq
.
singleSTable
=
0
;
createReq
.
numOfStables
=
0
;
createReq
.
numOfRetensions
=
0
;
int32_t
contLen
=
tSerializeSCreateDbReq
(
NULL
,
0
,
&
createReq
);
...
...
@@ -78,9 +74,9 @@ TEST_F(MndTestDb, 02_Create_Alter_Drop_Db) {
SAlterDbReq
alterdbReq
=
{
0
};
strcpy
(
alterdbReq
.
db
,
"1.d1"
);
alterdbReq
.
buffer
=
12
;
alterdbReq
.
d
uration
ToKeep0
=
300
;
alterdbReq
.
d
uration
ToKeep1
=
400
;
alterdbReq
.
d
uration
ToKeep2
=
500
;
alterdbReq
.
d
ays
ToKeep0
=
300
;
alterdbReq
.
d
ays
ToKeep1
=
400
;
alterdbReq
.
d
ays
ToKeep2
=
500
;
alterdbReq
.
fsyncPeriod
=
4000
;
alterdbReq
.
walLevel
=
2
;
alterdbReq
.
strict
=
2
;
...
...
@@ -133,25 +129,21 @@ TEST_F(MndTestDb, 03_Create_Use_Restart_Use_Db) {
createReq
.
buffer
=
-
1
;
createReq
.
pageSize
=
-
1
;
createReq
.
pages
=
-
1
;
createReq
.
d
uration
PerFile
=
1000
;
createReq
.
d
uration
ToKeep0
=
3650
;
createReq
.
d
uration
ToKeep1
=
3650
;
createReq
.
d
uration
ToKeep2
=
3650
;
createReq
.
d
ays
PerFile
=
1000
;
createReq
.
d
ays
ToKeep0
=
3650
;
createReq
.
d
ays
ToKeep1
=
3650
;
createReq
.
d
ays
ToKeep2
=
3650
;
createReq
.
minRows
=
100
;
createReq
.
maxRows
=
4096
;
createReq
.
commitTime
=
3600
;
createReq
.
fsyncPeriod
=
3000
;
createReq
.
ttl
=
1
;
createReq
.
walLevel
=
1
;
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
replications
=
1
;
createReq
.
strict
=
1
;
createReq
.
update
=
0
;
createReq
.
cacheLastRow
=
0
;
createReq
.
ignoreExist
=
1
;
createReq
.
streamMode
=
0
;
createReq
.
singleSTable
=
0
;
createReq
.
numOfStables
=
0
;
createReq
.
numOfRetensions
=
0
;
int32_t
contLen
=
tSerializeSCreateDbReq
(
NULL
,
0
,
&
createReq
);
...
...
source/dnode/mnode/impl/test/sma/sma.cpp
浏览文件 @
2d7ccc3b
...
...
@@ -43,22 +43,19 @@ void* MndTestSma::BuildCreateDbReq(const char* dbname, int32_t* pContLen) {
createReq
.
buffer
=
-
1
;
createReq
.
pageSize
=
-
1
;
createReq
.
pages
=
-
1
;
createReq
.
d
uration
PerFile
=
10
*
1440
;
createReq
.
d
uration
ToKeep0
=
3650
*
1440
;
createReq
.
d
uration
ToKeep1
=
3650
*
1440
;
createReq
.
d
uration
ToKeep2
=
3650
*
1440
;
createReq
.
d
ays
PerFile
=
10
*
1440
;
createReq
.
d
ays
ToKeep0
=
3650
*
1440
;
createReq
.
d
ays
ToKeep1
=
3650
*
1440
;
createReq
.
d
ays
ToKeep2
=
3650
*
1440
;
createReq
.
minRows
=
100
;
createReq
.
maxRows
=
4096
;
createReq
.
commitTime
=
3600
;
createReq
.
fsyncPeriod
=
3000
;
createReq
.
walLevel
=
1
;
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
replications
=
1
;
createReq
.
strict
=
1
;
createReq
.
update
=
0
;
createReq
.
cacheLastRow
=
0
;
createReq
.
ttl
=
1
;
createReq
.
ignoreExist
=
1
;
int32_t
contLen
=
tSerializeSCreateDbReq
(
NULL
,
0
,
&
createReq
);
...
...
source/dnode/mnode/impl/test/stb/stb.cpp
浏览文件 @
2d7ccc3b
...
...
@@ -44,22 +44,19 @@ void* MndTestStb::BuildCreateDbReq(const char* dbname, int32_t* pContLen) {
createReq
.
buffer
=
-
1
;
createReq
.
pageSize
=
-
1
;
createReq
.
pages
=
-
1
;
createReq
.
d
uration
PerFile
=
1000
;
createReq
.
d
uration
ToKeep0
=
3650
;
createReq
.
d
uration
ToKeep1
=
3650
;
createReq
.
d
uration
ToKeep2
=
3650
;
createReq
.
d
ays
PerFile
=
1000
;
createReq
.
d
ays
ToKeep0
=
3650
;
createReq
.
d
ays
ToKeep1
=
3650
;
createReq
.
d
ays
ToKeep2
=
3650
;
createReq
.
minRows
=
100
;
createReq
.
maxRows
=
4096
;
createReq
.
commitTime
=
3600
;
createReq
.
fsyncPeriod
=
3000
;
createReq
.
walLevel
=
1
;
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
replications
=
1
;
createReq
.
strict
=
1
;
createReq
.
update
=
0
;
createReq
.
cacheLastRow
=
0
;
createReq
.
ttl
=
1
;
createReq
.
ignoreExist
=
1
;
int32_t
contLen
=
tSerializeSCreateDbReq
(
NULL
,
0
,
&
createReq
);
...
...
source/dnode/mnode/impl/test/topic/topic.cpp
浏览文件 @
2d7ccc3b
...
...
@@ -36,22 +36,19 @@ void* MndTestTopic::BuildCreateDbReq(const char* dbname, int32_t* pContLen) {
createReq
.
buffer
=
-
1
;
createReq
.
pageSize
=
-
1
;
createReq
.
pages
=
-
1
;
createReq
.
d
uration
PerFile
=
10
*
1440
;
createReq
.
d
uration
ToKeep0
=
3650
*
1440
;
createReq
.
d
uration
ToKeep1
=
3650
*
1440
;
createReq
.
d
uration
ToKeep2
=
3650
*
1440
;
createReq
.
d
ays
PerFile
=
10
*
1440
;
createReq
.
d
ays
ToKeep0
=
3650
*
1440
;
createReq
.
d
ays
ToKeep1
=
3650
*
1440
;
createReq
.
d
ays
ToKeep2
=
3650
*
1440
;
createReq
.
minRows
=
100
;
createReq
.
maxRows
=
4096
;
createReq
.
commitTime
=
3600
;
createReq
.
fsyncPeriod
=
3000
;
createReq
.
walLevel
=
1
;
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
replications
=
1
;
createReq
.
strict
=
1
;
createReq
.
update
=
0
;
createReq
.
cacheLastRow
=
0
;
createReq
.
ttl
=
1
;
createReq
.
ignoreExist
=
1
;
int32_t
contLen
=
tSerializeSCreateDbReq
(
NULL
,
0
,
&
createReq
);
...
...
source/dnode/mnode/impl/test/user/user.cpp
浏览文件 @
2d7ccc3b
...
...
@@ -289,22 +289,19 @@ TEST_F(MndTestUser, 03_Alter_User) {
createReq
.
buffer
=
-
1
;
createReq
.
pageSize
=
-
1
;
createReq
.
pages
=
-
1
;
createReq
.
d
uration
PerFile
=
10
*
1440
;
createReq
.
d
uration
ToKeep0
=
3650
*
1440
;
createReq
.
d
uration
ToKeep1
=
3650
*
1440
;
createReq
.
d
uration
ToKeep2
=
3650
*
1440
;
createReq
.
d
ays
PerFile
=
10
*
1440
;
createReq
.
d
ays
ToKeep0
=
3650
*
1440
;
createReq
.
d
ays
ToKeep1
=
3650
*
1440
;
createReq
.
d
ays
ToKeep2
=
3650
*
1440
;
createReq
.
minRows
=
100
;
createReq
.
maxRows
=
4096
;
createReq
.
commitTime
=
3600
;
createReq
.
fsyncPeriod
=
3000
;
createReq
.
walLevel
=
1
;
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
replications
=
1
;
createReq
.
strict
=
1
;
createReq
.
update
=
0
;
createReq
.
cacheLastRow
=
0
;
createReq
.
ttl
=
1
;
createReq
.
ignoreExist
=
1
;
int32_t
contLen
=
tSerializeSCreateDbReq
(
NULL
,
0
,
&
createReq
);
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
2d7ccc3b
...
...
@@ -157,7 +157,6 @@ struct SVnodeCfg {
int32_t
szCache
;
uint64_t
szBuf
;
bool
isHeap
;
int8_t
streamMode
;
bool
isWeak
;
STsdbCfg
tsdbCfg
;
SWalCfg
walCfg
;
...
...
source/dnode/vnode/src/vnd/vnodeCfg.c
浏览文件 @
2d7ccc3b
...
...
@@ -23,7 +23,6 @@ const SVnodeCfg vnodeCfgDefault = {
.
szCache
=
256
,
.
szBuf
=
96
*
1024
*
1024
,
.
isHeap
=
false
,
.
streamMode
=
0
,
.
isWeak
=
0
,
.
tsdbCfg
=
{.
precision
=
TSDB_TIME_PRECISION_MILLI
,
.
update
=
0
,
...
...
@@ -56,7 +55,6 @@ int vnodeEncodeConfig(const void *pObj, SJson *pJson) {
if
(
tjsonAddIntegerToObject
(
pJson
,
"szCache"
,
pCfg
->
szCache
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"szBuf"
,
pCfg
->
szBuf
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"isHeap"
,
pCfg
->
isHeap
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"streamMode"
,
pCfg
->
streamMode
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"isWeak"
,
pCfg
->
isWeak
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"precision"
,
pCfg
->
tsdbCfg
.
precision
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"update"
,
pCfg
->
tsdbCfg
.
update
)
<
0
)
return
-
1
;
...
...
@@ -104,7 +102,6 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) {
if
(
tjsonGetNumberValue
(
pJson
,
"szCache"
,
pCfg
->
szCache
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"szBuf"
,
pCfg
->
szBuf
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"isHeap"
,
pCfg
->
isHeap
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"streamMode"
,
pCfg
->
streamMode
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"isWeak"
,
pCfg
->
isWeak
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"precision"
,
pCfg
->
tsdbCfg
.
precision
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"update"
,
pCfg
->
tsdbCfg
.
update
)
<
0
)
return
-
1
;
...
...
source/dnode/vnode/test/tsdbSmaTest.cpp
浏览文件 @
2d7ccc3b
...
...
@@ -342,7 +342,7 @@ TEST(testCase, tSma_Data_Insert_Query_Test) {
pTsdb
->
pMeta
=
pMeta
;
pTsdb
->
vgId
=
2
;
pTsdb
->
config
.
d
uration
PerFile
=
10
;
// default days is 10
pTsdb
->
config
.
d
ays
PerFile
=
10
;
// default days is 10
pTsdb
->
config
.
keep1
=
30
;
pTsdb
->
config
.
keep2
=
90
;
pTsdb
->
config
.
keep
=
365
;
...
...
source/libs/catalog/test/catalogTests.cpp
浏览文件 @
2d7ccc3b
...
...
@@ -100,22 +100,19 @@ void sendCreateDbMsg(void *shandle, SEpSet *pEpSet) {
createReq
.
buffer
=
-
1
;
createReq
.
pageSize
=
-
1
;
createReq
.
pages
=
-
1
;
createReq
.
d
uration
PerFile
=
10
;
createReq
.
d
uration
ToKeep0
=
3650
;
createReq
.
d
uration
ToKeep1
=
3650
;
createReq
.
d
uration
ToKeep2
=
3650
;
createReq
.
d
ays
PerFile
=
10
;
createReq
.
d
ays
ToKeep0
=
3650
;
createReq
.
d
ays
ToKeep1
=
3650
;
createReq
.
d
ays
ToKeep2
=
3650
;
createReq
.
minRows
=
100
;
createReq
.
maxRows
=
4096
;
createReq
.
commitTime
=
3600
;
createReq
.
fsyncPeriod
=
3000
;
createReq
.
walLevel
=
1
;
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
replications
=
1
;
createReq
.
strict
=
1
;
createReq
.
update
=
0
;
createReq
.
cacheLastRow
=
0
;
createReq
.
ttl
=
1
;
createReq
.
ignoreExist
=
1
;
int32_t
contLen
=
tSerializeSCreateDbReq
(
NULL
,
0
,
&
createReq
);
...
...
source/libs/parser/src/parTokenizer.c
浏览文件 @
2d7ccc3b
...
...
@@ -47,6 +47,7 @@ static SKeyword keywordTable[] = {
{
"BNODE"
,
TK_BNODE
},
{
"BNODES"
,
TK_BNODES
},
{
"BOOL"
,
TK_BOOL
},
{
"BUFFER"
,
TK_BUFFER
},
{
"BUFSIZE"
,
TK_BUFSIZE
},
{
"BY"
,
TK_BY
},
{
"CACHE"
,
TK_CACHE
},
...
...
@@ -132,6 +133,8 @@ static SKeyword keywordTable[] = {
{
"OUTPUTTYPE"
,
TK_OUTPUTTYPE
},
{
"PARTITION"
,
TK_PARTITION
},
{
"PASS"
,
TK_PASS
},
{
"PAGES"
,
TK_PAGES
},
{
"PAGESIZE"
,
TK_PAGESIZE
},
{
"PORT"
,
TK_PORT
},
{
"PPS"
,
TK_PPS
},
{
"PRECISION"
,
TK_PRECISION
},
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
2d7ccc3b
...
...
@@ -1539,26 +1539,24 @@ static int32_t buildCreateDbReq(STranslateContext* pCxt, SCreateDatabaseStmt* pS
tNameSetDbName
(
&
name
,
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
dbName
,
strlen
(
pStmt
->
dbName
));
tNameGetFullDbName
(
&
name
,
pReq
->
db
);
pReq
->
numOfVgroups
=
pStmt
->
pOptions
->
numOfVgroups
;
pReq
->
numOfStables
=
pStmt
->
pOptions
->
singleStable
;
pReq
->
buffer
=
pStmt
->
pOptions
->
buffer
;
pReq
->
pageSize
=
pStmt
->
pOptions
->
pagesize
;
pReq
->
pages
=
pStmt
->
pOptions
->
pages
;
pReq
->
daysPerFile
=
pStmt
->
pOptions
->
daysPerFile
;
pReq
->
daysToKeep0
=
pStmt
->
pOptions
->
keep
[
0
];
pReq
->
daysToKeep1
=
pStmt
->
pOptions
->
keep
[
1
];
pReq
->
daysToKeep2
=
pStmt
->
pOptions
->
keep
[
2
];
pReq
->
minRows
=
pStmt
->
pOptions
->
minRowsPerBlock
;
pReq
->
maxRows
=
pStmt
->
pOptions
->
maxRowsPerBlock
;
pReq
->
commitTime
=
-
1
;
pReq
->
fsyncPeriod
=
pStmt
->
pOptions
->
fsyncPeriod
;
pReq
->
walLevel
=
pStmt
->
pOptions
->
walLevel
;
pReq
->
precision
=
pStmt
->
pOptions
->
precision
;
pReq
->
compression
=
pStmt
->
pOptions
->
compressionLevel
;
pReq
->
replications
=
pStmt
->
pOptions
->
replica
;
pReq
->
update
=
-
1
;
pReq
->
strict
=
pStmt
->
pOptions
->
strict
;
pReq
->
cacheLastRow
=
pStmt
->
pOptions
->
cachelast
;
pReq
->
ignoreExist
=
pStmt
->
ignoreExists
;
pReq
->
singleSTable
=
pStmt
->
pOptions
->
singleStable
;
pReq
->
strict
=
pStmt
->
pOptions
->
strict
;
// pStmt->pOptions->buffer;
// pStmt->pOptions->pages;
// pStmt->pOptions->pagesize;
return
buildCreateDbRetentions
(
pStmt
->
pOptions
->
pRetentions
,
pReq
);
}
...
...
@@ -1690,7 +1688,7 @@ static int32_t checkOptionsDependency(STranslateContext* pCxt, const char* pDbNa
daysPerFile
=
(
-
1
==
daysPerFile
?
dbCfg
.
daysPerFile
:
daysPerFile
);
daysToKeep0
=
(
-
1
==
daysToKeep0
?
dbCfg
.
daysToKeep0
:
daysToKeep0
);
}
if
(
d
urationPerFile
>
duration
ToKeep0
)
{
if
(
d
aysPerFile
>
days
ToKeep0
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_DAYS_VALUE
);
}
return
TSDB_CODE_SUCCESS
;
...
...
@@ -1698,7 +1696,8 @@ static int32_t checkOptionsDependency(STranslateContext* pCxt, const char* pDbNa
static
int32_t
checkDatabaseOptions
(
STranslateContext
*
pCxt
,
const
char
*
pDbName
,
SDatabaseOptions
*
pOptions
,
bool
alter
)
{
int32_t
code
=
checkRangeOption
(
pCxt
,
"buffer"
,
pOptions
->
buffer
,
TSDB_MIN_BUFFER_PER_VNODE
,
INT32_MAX
);
int32_t
code
=
checkRangeOption
(
pCxt
,
"buffer"
,
pOptions
->
buffer
,
TSDB_MIN_BUFFER_PER_VNODE
,
TSDB_MAX_BUFFER_PER_VNODE
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkRangeOption
(
pCxt
,
"cacheLast"
,
pOptions
->
cachelast
,
TSDB_MIN_DB_CACHE_LAST_ROW
,
TSDB_MAX_DB_CACHE_LAST_ROW
);
...
...
@@ -1724,7 +1723,7 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName
code
=
checkDbKeepOption
(
pCxt
,
pOptions
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkRangeOption
(
pCxt
,
"pages"
,
pOptions
->
pages
,
TSDB_MIN_PAGES_PER_VNODE
,
INT32_MAX
);
code
=
checkRangeOption
(
pCxt
,
"pages"
,
pOptions
->
pages
,
TSDB_MIN_PAGES_PER_VNODE
,
TSDB_MAX_PAGES_PER_VNODE
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkRangeOption
(
pCxt
,
"pagesize"
,
pOptions
->
pagesize
,
TSDB_MIN_PAGESIZE_PER_VNODE
,
...
...
@@ -1810,16 +1809,18 @@ static void buildAlterDbReq(STranslateContext* pCxt, SAlterDatabaseStmt* pStmt,
SName
name
=
{
0
};
tNameSetDbName
(
&
name
,
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
dbName
,
strlen
(
pStmt
->
dbName
));
tNameGetFullDbName
(
&
name
,
pReq
->
db
);
// pStmt->pOptions->buffer
pReq
->
cacheLastRow
=
pStmt
->
pOptions
->
cachelast
;
pReq
->
fsyncPeriod
=
pStmt
->
pOptions
->
fsyncPeriod
;
pReq
->
buffer
=
pStmt
->
pOptions
->
buffer
;
pReq
->
pageSize
=
-
1
;
pReq
->
pages
=
pStmt
->
pOptions
->
pages
;
pReq
->
daysPerFile
=
-
1
;
pReq
->
daysToKeep0
=
pStmt
->
pOptions
->
keep
[
0
];
pReq
->
daysToKeep1
=
pStmt
->
pOptions
->
keep
[
1
];
pReq
->
daysToKeep2
=
pStmt
->
pOptions
->
keep
[
2
];
// pStmt->pOptions->pages
pReq
->
replications
=
pStmt
->
pOptions
->
replica
;
pReq
->
strict
=
pStmt
->
pOptions
->
strict
;
pReq
->
fsyncPeriod
=
pStmt
->
pOptions
->
fsyncPeriod
;
pReq
->
walLevel
=
pStmt
->
pOptions
->
walLevel
;
pReq
->
strict
=
pStmt
->
pOptions
->
strict
;
pReq
->
cacheLastRow
=
pStmt
->
pOptions
->
cachelast
;
pReq
->
replications
=
pStmt
->
pOptions
->
replica
;
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录