Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e4b6fa74
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看板
提交
e4b6fa74
编写于
7月 26, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: add wal option to show database command
上级
3c460faa
变更
18
显示空白变更内容
内联
并排
Showing
18 changed file
with
98 addition
and
77 deletion
+98
-77
include/common/tmsg.h
include/common/tmsg.h
+7
-7
source/common/src/systable.c
source/common/src/systable.c
+9
-7
source/common/src/tmsg.c
source/common/src/tmsg.c
+14
-14
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+1
-1
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+1
-1
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+40
-25
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+2
-2
source/dnode/mnode/impl/test/db/db.cpp
source/dnode/mnode/impl/test/db/db.cpp
+3
-3
source/dnode/mnode/impl/test/sma/sma.cpp
source/dnode/mnode/impl/test/sma/sma.cpp
+1
-1
source/dnode/mnode/impl/test/stb/stb.cpp
source/dnode/mnode/impl/test/stb/stb.cpp
+1
-1
source/dnode/mnode/impl/test/topic/topic.cpp
source/dnode/mnode/impl/test/topic/topic.cpp
+1
-1
source/dnode/mnode/impl/test/user/user.cpp
source/dnode/mnode/impl/test/user/user.cpp
+1
-1
source/libs/catalog/test/catalogTests.cpp
source/libs/catalog/test/catalogTests.cpp
+1
-1
source/libs/command/src/command.c
source/libs/command/src/command.c
+1
-1
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+2
-2
source/libs/parser/test/parAlterToBalanceTest.cpp
source/libs/parser/test/parAlterToBalanceTest.cpp
+3
-3
source/libs/parser/test/parInitialCTest.cpp
source/libs/parser/test/parInitialCTest.cpp
+3
-3
tests/test/c/sdbDump.c
tests/test/c/sdbDump.c
+7
-3
未找到文件。
include/common/tmsg.h
浏览文件 @
e4b6fa74
...
@@ -737,7 +737,7 @@ typedef struct {
...
@@ -737,7 +737,7 @@ typedef struct {
int32_t
daysToKeep2
;
int32_t
daysToKeep2
;
int32_t
minRows
;
int32_t
minRows
;
int32_t
maxRows
;
int32_t
maxRows
;
int32_t
f
syncPeriod
;
int32_t
walF
syncPeriod
;
int8_t
walLevel
;
int8_t
walLevel
;
int8_t
precision
;
// time resolution
int8_t
precision
;
// time resolution
int8_t
compression
;
int8_t
compression
;
...
@@ -749,9 +749,9 @@ typedef struct {
...
@@ -749,9 +749,9 @@ typedef struct {
int32_t
numOfRetensions
;
int32_t
numOfRetensions
;
SArray
*
pRetensions
;
// SRetention
SArray
*
pRetensions
;
// SRetention
int32_t
walRetentionPeriod
;
int32_t
walRetentionPeriod
;
int
32
_t
walRetentionSize
;
int
64
_t
walRetentionSize
;
int32_t
walRollPeriod
;
int32_t
walRollPeriod
;
int
32
_t
walSegmentSize
;
int
64
_t
walSegmentSize
;
}
SCreateDbReq
;
}
SCreateDbReq
;
int32_t
tSerializeSCreateDbReq
(
void
*
buf
,
int32_t
bufLen
,
SCreateDbReq
*
pReq
);
int32_t
tSerializeSCreateDbReq
(
void
*
buf
,
int32_t
bufLen
,
SCreateDbReq
*
pReq
);
...
@@ -768,7 +768,7 @@ typedef struct {
...
@@ -768,7 +768,7 @@ typedef struct {
int32_t
daysToKeep0
;
int32_t
daysToKeep0
;
int32_t
daysToKeep1
;
int32_t
daysToKeep1
;
int32_t
daysToKeep2
;
int32_t
daysToKeep2
;
int32_t
f
syncPeriod
;
int32_t
walF
syncPeriod
;
int8_t
walLevel
;
int8_t
walLevel
;
int8_t
strict
;
int8_t
strict
;
int8_t
cacheLast
;
int8_t
cacheLast
;
...
@@ -859,7 +859,7 @@ typedef struct {
...
@@ -859,7 +859,7 @@ typedef struct {
int32_t
daysToKeep2
;
int32_t
daysToKeep2
;
int32_t
minRows
;
int32_t
minRows
;
int32_t
maxRows
;
int32_t
maxRows
;
int32_t
f
syncPeriod
;
int32_t
walF
syncPeriod
;
int8_t
walLevel
;
int8_t
walLevel
;
int8_t
precision
;
int8_t
precision
;
int8_t
compression
;
int8_t
compression
;
...
@@ -1137,7 +1137,7 @@ typedef struct {
...
@@ -1137,7 +1137,7 @@ typedef struct {
int32_t
daysToKeep2
;
int32_t
daysToKeep2
;
int32_t
minRows
;
int32_t
minRows
;
int32_t
maxRows
;
int32_t
maxRows
;
int32_t
f
syncPeriod
;
int32_t
walF
syncPeriod
;
uint32_t
hashBegin
;
uint32_t
hashBegin
;
uint32_t
hashEnd
;
uint32_t
hashEnd
;
int8_t
hashMethod
;
int8_t
hashMethod
;
...
@@ -1192,7 +1192,7 @@ typedef struct {
...
@@ -1192,7 +1192,7 @@ typedef struct {
int32_t
daysToKeep0
;
int32_t
daysToKeep0
;
int32_t
daysToKeep1
;
int32_t
daysToKeep1
;
int32_t
daysToKeep2
;
int32_t
daysToKeep2
;
int32_t
f
syncPeriod
;
int32_t
walF
syncPeriod
;
int8_t
walLevel
;
int8_t
walLevel
;
int8_t
strict
;
int8_t
strict
;
int8_t
cacheLast
;
int8_t
cacheLast
;
...
...
source/common/src/systable.c
浏览文件 @
e4b6fa74
...
@@ -84,17 +84,19 @@ static const SSysDbTableSchema userDBSchema[] = {
...
@@ -84,17 +84,19 @@ static const SSysDbTableSchema userDBSchema[] = {
{.
name
=
"pages"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"pages"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"minrows"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"minrows"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"maxrows"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"maxrows"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"wal"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"fsync"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"comp"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"comp"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"cacheModel"
,
.
bytes
=
TSDB_CACHE_MODEL_STR_LEN
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"precision"
,
.
bytes
=
2
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"precision"
,
.
bytes
=
2
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"single_stable"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_BOOL
},
{.
name
=
"status"
,
.
bytes
=
10
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"status"
,
.
bytes
=
10
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
// {.name = "schemaless", .bytes = 1, .type = TSDB_DATA_TYPE_BOOL},
{.
name
=
"retention"
,
.
bytes
=
60
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"retention"
,
.
bytes
=
60
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"single_stable"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_BOOL
},
// {.name = "update", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT}, // disable update
{.
name
=
"cache_model"
,
.
bytes
=
TSDB_CACHE_MODEL_STR_LEN
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"cache_size"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"wal_level"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"wal_fsync_period"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"wal_retention_period"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"wal_retention_size"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_BIGINT
},
{.
name
=
"wal_roll_period"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"wal_seg_size"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_BIGINT
},
};
};
static
const
SSysDbTableSchema
userFuncSchema
[]
=
{
static
const
SSysDbTableSchema
userFuncSchema
[]
=
{
...
...
source/common/src/tmsg.c
浏览文件 @
e4b6fa74
...
@@ -2010,7 +2010,7 @@ int32_t tSerializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq) {
...
@@ -2010,7 +2010,7 @@ int32_t tSerializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq) {
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
minRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
minRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
f
syncPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
walF
syncPeriod
)
<
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
;
...
@@ -2019,9 +2019,9 @@ int32_t tSerializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq) {
...
@@ -2019,9 +2019,9 @@ int32_t tSerializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq) {
if
(
tEncodeI8
(
&
encoder
,
pReq
->
cacheLast
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
cacheLast
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
schemaless
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
schemaless
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
walRetentionPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
walRetentionPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI
32
(
&
encoder
,
pReq
->
walRetentionSize
)
<
0
)
return
-
1
;
if
(
tEncodeI
64
(
&
encoder
,
pReq
->
walRetentionSize
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
walRollPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
walRollPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI
32
(
&
encoder
,
pReq
->
walSegmentSize
)
<
0
)
return
-
1
;
if
(
tEncodeI
64
(
&
encoder
,
pReq
->
walSegmentSize
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
ignoreExist
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
ignoreExist
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
numOfRetensions
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
numOfRetensions
)
<
0
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
pReq
->
numOfRetensions
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pReq
->
numOfRetensions
;
++
i
)
{
...
@@ -2056,7 +2056,7 @@ int32_t tDeserializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq)
...
@@ -2056,7 +2056,7 @@ int32_t tDeserializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq)
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
minRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
minRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
f
syncPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
walF
syncPeriod
)
<
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
;
...
@@ -2065,9 +2065,9 @@ int32_t tDeserializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq)
...
@@ -2065,9 +2065,9 @@ int32_t tDeserializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq)
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
cacheLast
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
cacheLast
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
schemaless
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
schemaless
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
walRetentionPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
walRetentionPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI
32
(
&
decoder
,
&
pReq
->
walRetentionSize
)
<
0
)
return
-
1
;
if
(
tDecodeI
64
(
&
decoder
,
&
pReq
->
walRetentionSize
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
walRollPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
walRollPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI
32
(
&
decoder
,
&
pReq
->
walSegmentSize
)
<
0
)
return
-
1
;
if
(
tDecodeI
64
(
&
decoder
,
&
pReq
->
walSegmentSize
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
ignoreExist
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
ignoreExist
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
numOfRetensions
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
numOfRetensions
)
<
0
)
return
-
1
;
pReq
->
pRetensions
=
taosArrayInit
(
pReq
->
numOfRetensions
,
sizeof
(
SRetention
));
pReq
->
pRetensions
=
taosArrayInit
(
pReq
->
numOfRetensions
,
sizeof
(
SRetention
));
...
@@ -2113,7 +2113,7 @@ int32_t tSerializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) {
...
@@ -2113,7 +2113,7 @@ int32_t tSerializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) {
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep0
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep0
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep1
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep1
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
f
syncPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
walF
syncPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
cacheLast
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
cacheLast
)
<
0
)
return
-
1
;
...
@@ -2139,7 +2139,7 @@ int32_t tDeserializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) {
...
@@ -2139,7 +2139,7 @@ int32_t tDeserializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) {
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep0
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep0
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep1
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep1
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
f
syncPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
walF
syncPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
cacheLast
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
cacheLast
)
<
0
)
return
-
1
;
...
@@ -2748,7 +2748,7 @@ int32_t tSerializeSDbCfgRsp(void *buf, int32_t bufLen, const SDbCfgRsp *pRsp) {
...
@@ -2748,7 +2748,7 @@ int32_t tSerializeSDbCfgRsp(void *buf, int32_t bufLen, const SDbCfgRsp *pRsp) {
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
minRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
minRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
maxRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
maxRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
f
syncPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
walF
syncPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
walLevel
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
walLevel
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
precision
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
precision
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
compression
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
compression
)
<
0
)
return
-
1
;
...
@@ -2787,7 +2787,7 @@ int32_t tDeserializeSDbCfgRsp(void *buf, int32_t bufLen, SDbCfgRsp *pRsp) {
...
@@ -2787,7 +2787,7 @@ int32_t tDeserializeSDbCfgRsp(void *buf, int32_t bufLen, SDbCfgRsp *pRsp) {
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
minRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
minRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
maxRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
maxRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
f
syncPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
walF
syncPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
walLevel
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
walLevel
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
precision
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
precision
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
compression
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
compression
)
<
0
)
return
-
1
;
...
@@ -3720,7 +3720,7 @@ int32_t tSerializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *pR
...
@@ -3720,7 +3720,7 @@ int32_t tSerializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *pR
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
minRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
minRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
f
syncPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
walF
syncPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeU32
(
&
encoder
,
pReq
->
hashBegin
)
<
0
)
return
-
1
;
if
(
tEncodeU32
(
&
encoder
,
pReq
->
hashBegin
)
<
0
)
return
-
1
;
if
(
tEncodeU32
(
&
encoder
,
pReq
->
hashEnd
)
<
0
)
return
-
1
;
if
(
tEncodeU32
(
&
encoder
,
pReq
->
hashEnd
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
hashMethod
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
hashMethod
)
<
0
)
return
-
1
;
...
@@ -3782,7 +3782,7 @@ int32_t tDeserializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *
...
@@ -3782,7 +3782,7 @@ int32_t tDeserializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
minRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
minRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
maxRows
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
f
syncPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
walF
syncPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeU32
(
&
decoder
,
&
pReq
->
hashBegin
)
<
0
)
return
-
1
;
if
(
tDecodeU32
(
&
decoder
,
&
pReq
->
hashBegin
)
<
0
)
return
-
1
;
if
(
tDecodeU32
(
&
decoder
,
&
pReq
->
hashEnd
)
<
0
)
return
-
1
;
if
(
tDecodeU32
(
&
decoder
,
&
pReq
->
hashEnd
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
hashMethod
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
hashMethod
)
<
0
)
return
-
1
;
...
@@ -3910,7 +3910,7 @@ int32_t tSerializeSAlterVnodeReq(void *buf, int32_t bufLen, SAlterVnodeReq *pReq
...
@@ -3910,7 +3910,7 @@ int32_t tSerializeSAlterVnodeReq(void *buf, int32_t bufLen, SAlterVnodeReq *pReq
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep0
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep0
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep1
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep1
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
f
syncPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
walF
syncPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
cacheLast
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
cacheLast
)
<
0
)
return
-
1
;
...
@@ -3941,7 +3941,7 @@ int32_t tDeserializeSAlterVnodeReq(void *buf, int32_t bufLen, SAlterVnodeReq *pR
...
@@ -3941,7 +3941,7 @@ int32_t tDeserializeSAlterVnodeReq(void *buf, int32_t bufLen, SAlterVnodeReq *pR
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep0
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep0
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep1
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep1
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
f
syncPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
walF
syncPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
cacheLast
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
cacheLast
)
<
0
)
return
-
1
;
...
...
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
浏览文件 @
e4b6fa74
...
@@ -160,7 +160,7 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) {
...
@@ -160,7 +160,7 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) {
}
}
pCfg
->
walCfg
.
vgId
=
pCreate
->
vgId
;
pCfg
->
walCfg
.
vgId
=
pCreate
->
vgId
;
pCfg
->
walCfg
.
fsyncPeriod
=
pCreate
->
f
syncPeriod
;
pCfg
->
walCfg
.
fsyncPeriod
=
pCreate
->
walF
syncPeriod
;
pCfg
->
walCfg
.
retentionPeriod
=
pCreate
->
walRetentionPeriod
;
pCfg
->
walCfg
.
retentionPeriod
=
pCreate
->
walRetentionPeriod
;
pCfg
->
walCfg
.
rollPeriod
=
pCreate
->
walRollPeriod
;
pCfg
->
walCfg
.
rollPeriod
=
pCreate
->
walRollPeriod
;
pCfg
->
walCfg
.
retentionSize
=
pCreate
->
walRetentionSize
;
pCfg
->
walCfg
.
retentionSize
=
pCreate
->
walRetentionSize
;
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
e4b6fa74
...
@@ -294,7 +294,7 @@ typedef struct {
...
@@ -294,7 +294,7 @@ typedef struct {
int32_t
daysToKeep2
;
int32_t
daysToKeep2
;
int32_t
minRows
;
int32_t
minRows
;
int32_t
maxRows
;
int32_t
maxRows
;
int32_t
f
syncPeriod
;
int32_t
walF
syncPeriod
;
int8_t
walLevel
;
int8_t
walLevel
;
int8_t
precision
;
int8_t
precision
;
int8_t
compression
;
int8_t
compression
;
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
e4b6fa74
...
@@ -102,7 +102,7 @@ static SSdbRaw *mndDbActionEncode(SDbObj *pDb) {
...
@@ -102,7 +102,7 @@ static SSdbRaw *mndDbActionEncode(SDbObj *pDb) {
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
daysToKeep2
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
daysToKeep2
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
minRows
,
_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
.
maxRows
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
f
syncPeriod
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
walF
syncPeriod
,
_OVER
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pDb
->
cfg
.
walLevel
,
_OVER
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pDb
->
cfg
.
walLevel
,
_OVER
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pDb
->
cfg
.
precision
,
_OVER
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pDb
->
cfg
.
precision
,
_OVER
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pDb
->
cfg
.
compression
,
_OVER
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pDb
->
cfg
.
compression
,
_OVER
)
...
@@ -179,7 +179,7 @@ static SSdbRow *mndDbActionDecode(SSdbRaw *pRaw) {
...
@@ -179,7 +179,7 @@ static SSdbRow *mndDbActionDecode(SSdbRaw *pRaw) {
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
daysToKeep2
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
daysToKeep2
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
minRows
,
_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
.
maxRows
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
f
syncPeriod
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
walF
syncPeriod
,
_OVER
)
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
walLevel
,
_OVER
)
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
walLevel
,
_OVER
)
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
precision
,
_OVER
)
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
precision
,
_OVER
)
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
compression
,
_OVER
)
SDB_GET_INT8
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
compression
,
_OVER
)
...
@@ -249,7 +249,7 @@ static int32_t mndDbActionUpdate(SSdb *pSdb, SDbObj *pOld, SDbObj *pNew) {
...
@@ -249,7 +249,7 @@ static int32_t mndDbActionUpdate(SSdb *pSdb, SDbObj *pOld, SDbObj *pNew) {
pOld
->
cfg
.
daysToKeep0
=
pNew
->
cfg
.
daysToKeep0
;
pOld
->
cfg
.
daysToKeep0
=
pNew
->
cfg
.
daysToKeep0
;
pOld
->
cfg
.
daysToKeep1
=
pNew
->
cfg
.
daysToKeep1
;
pOld
->
cfg
.
daysToKeep1
=
pNew
->
cfg
.
daysToKeep1
;
pOld
->
cfg
.
daysToKeep2
=
pNew
->
cfg
.
daysToKeep2
;
pOld
->
cfg
.
daysToKeep2
=
pNew
->
cfg
.
daysToKeep2
;
pOld
->
cfg
.
fsyncPeriod
=
pNew
->
cfg
.
f
syncPeriod
;
pOld
->
cfg
.
walFsyncPeriod
=
pNew
->
cfg
.
walF
syncPeriod
;
pOld
->
cfg
.
walLevel
=
pNew
->
cfg
.
walLevel
;
pOld
->
cfg
.
walLevel
=
pNew
->
cfg
.
walLevel
;
pOld
->
cfg
.
strict
=
pNew
->
cfg
.
strict
;
pOld
->
cfg
.
strict
=
pNew
->
cfg
.
strict
;
pOld
->
cfg
.
cacheLast
=
pNew
->
cfg
.
cacheLast
;
pOld
->
cfg
.
cacheLast
=
pNew
->
cfg
.
cacheLast
;
...
@@ -312,7 +312,7 @@ static int32_t mndCheckDbCfg(SMnode *pMnode, SDbCfg *pCfg) {
...
@@ -312,7 +312,7 @@ static int32_t mndCheckDbCfg(SMnode *pMnode, SDbCfg *pCfg) {
if
(
pCfg
->
minRows
<
TSDB_MIN_MINROWS_FBLOCK
||
pCfg
->
minRows
>
TSDB_MAX_MINROWS_FBLOCK
)
return
-
1
;
if
(
pCfg
->
minRows
<
TSDB_MIN_MINROWS_FBLOCK
||
pCfg
->
minRows
>
TSDB_MAX_MINROWS_FBLOCK
)
return
-
1
;
if
(
pCfg
->
maxRows
<
TSDB_MIN_MAXROWS_FBLOCK
||
pCfg
->
maxRows
>
TSDB_MAX_MAXROWS_FBLOCK
)
return
-
1
;
if
(
pCfg
->
maxRows
<
TSDB_MIN_MAXROWS_FBLOCK
||
pCfg
->
maxRows
>
TSDB_MAX_MAXROWS_FBLOCK
)
return
-
1
;
if
(
pCfg
->
minRows
>
pCfg
->
maxRows
)
return
-
1
;
if
(
pCfg
->
minRows
>
pCfg
->
maxRows
)
return
-
1
;
if
(
pCfg
->
fsyncPeriod
<
TSDB_MIN_FSYNC_PERIOD
||
pCfg
->
f
syncPeriod
>
TSDB_MAX_FSYNC_PERIOD
)
return
-
1
;
if
(
pCfg
->
walFsyncPeriod
<
TSDB_MIN_FSYNC_PERIOD
||
pCfg
->
walF
syncPeriod
>
TSDB_MAX_FSYNC_PERIOD
)
return
-
1
;
if
(
pCfg
->
walLevel
<
TSDB_MIN_WAL_LEVEL
||
pCfg
->
walLevel
>
TSDB_MAX_WAL_LEVEL
)
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
->
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
;
if
(
pCfg
->
compression
<
TSDB_MIN_COMP_LEVEL
||
pCfg
->
compression
>
TSDB_MAX_COMP_LEVEL
)
return
-
1
;
...
@@ -347,7 +347,7 @@ static void mndSetDefaultDbCfg(SDbCfg *pCfg) {
...
@@ -347,7 +347,7 @@ static void mndSetDefaultDbCfg(SDbCfg *pCfg) {
if
(
pCfg
->
daysToKeep2
<
0
)
pCfg
->
daysToKeep2
=
pCfg
->
daysToKeep1
;
if
(
pCfg
->
daysToKeep2
<
0
)
pCfg
->
daysToKeep2
=
pCfg
->
daysToKeep1
;
if
(
pCfg
->
minRows
<
0
)
pCfg
->
minRows
=
TSDB_DEFAULT_MINROWS_FBLOCK
;
if
(
pCfg
->
minRows
<
0
)
pCfg
->
minRows
=
TSDB_DEFAULT_MINROWS_FBLOCK
;
if
(
pCfg
->
maxRows
<
0
)
pCfg
->
maxRows
=
TSDB_DEFAULT_MAXROWS_FBLOCK
;
if
(
pCfg
->
maxRows
<
0
)
pCfg
->
maxRows
=
TSDB_DEFAULT_MAXROWS_FBLOCK
;
if
(
pCfg
->
fsyncPeriod
<
0
)
pCfg
->
f
syncPeriod
=
TSDB_DEFAULT_FSYNC_PERIOD
;
if
(
pCfg
->
walFsyncPeriod
<
0
)
pCfg
->
walF
syncPeriod
=
TSDB_DEFAULT_FSYNC_PERIOD
;
if
(
pCfg
->
walLevel
<
0
)
pCfg
->
walLevel
=
TSDB_DEFAULT_WAL_LEVEL
;
if
(
pCfg
->
walLevel
<
0
)
pCfg
->
walLevel
=
TSDB_DEFAULT_WAL_LEVEL
;
if
(
pCfg
->
precision
<
0
)
pCfg
->
precision
=
TSDB_DEFAULT_PRECISION
;
if
(
pCfg
->
precision
<
0
)
pCfg
->
precision
=
TSDB_DEFAULT_PRECISION
;
if
(
pCfg
->
compression
<
0
)
pCfg
->
compression
=
TSDB_DEFAULT_COMP_LEVEL
;
if
(
pCfg
->
compression
<
0
)
pCfg
->
compression
=
TSDB_DEFAULT_COMP_LEVEL
;
...
@@ -466,7 +466,7 @@ static int32_t mndCreateDb(SMnode *pMnode, SRpcMsg *pReq, SCreateDbReq *pCreate,
...
@@ -466,7 +466,7 @@ static int32_t mndCreateDb(SMnode *pMnode, SRpcMsg *pReq, SCreateDbReq *pCreate,
.
daysToKeep2
=
pCreate
->
daysToKeep2
,
.
daysToKeep2
=
pCreate
->
daysToKeep2
,
.
minRows
=
pCreate
->
minRows
,
.
minRows
=
pCreate
->
minRows
,
.
maxRows
=
pCreate
->
maxRows
,
.
maxRows
=
pCreate
->
maxRows
,
.
fsyncPeriod
=
pCreate
->
f
syncPeriod
,
.
walFsyncPeriod
=
pCreate
->
walF
syncPeriod
,
.
walLevel
=
pCreate
->
walLevel
,
.
walLevel
=
pCreate
->
walLevel
,
.
precision
=
pCreate
->
precision
,
.
precision
=
pCreate
->
precision
,
.
compression
=
pCreate
->
compression
,
.
compression
=
pCreate
->
compression
,
...
@@ -642,8 +642,8 @@ static int32_t mndSetDbCfgFromAlterDbReq(SDbObj *pDb, SAlterDbReq *pAlter) {
...
@@ -642,8 +642,8 @@ static int32_t mndSetDbCfgFromAlterDbReq(SDbObj *pDb, SAlterDbReq *pAlter) {
terrno
=
0
;
terrno
=
0
;
}
}
if
(
pAlter
->
fsyncPeriod
>=
0
&&
pAlter
->
fsyncPeriod
!=
pDb
->
cfg
.
f
syncPeriod
)
{
if
(
pAlter
->
walFsyncPeriod
>=
0
&&
pAlter
->
walFsyncPeriod
!=
pDb
->
cfg
.
walF
syncPeriod
)
{
pDb
->
cfg
.
fsyncPeriod
=
pAlter
->
f
syncPeriod
;
pDb
->
cfg
.
walFsyncPeriod
=
pAlter
->
walF
syncPeriod
;
terrno
=
0
;
terrno
=
0
;
}
}
...
@@ -833,7 +833,7 @@ static int32_t mndProcessGetDbCfgReq(SRpcMsg *pReq) {
...
@@ -833,7 +833,7 @@ static int32_t mndProcessGetDbCfgReq(SRpcMsg *pReq) {
cfgRsp
.
daysToKeep2
=
pDb
->
cfg
.
daysToKeep2
;
cfgRsp
.
daysToKeep2
=
pDb
->
cfg
.
daysToKeep2
;
cfgRsp
.
minRows
=
pDb
->
cfg
.
minRows
;
cfgRsp
.
minRows
=
pDb
->
cfg
.
minRows
;
cfgRsp
.
maxRows
=
pDb
->
cfg
.
maxRows
;
cfgRsp
.
maxRows
=
pDb
->
cfg
.
maxRows
;
cfgRsp
.
fsyncPeriod
=
pDb
->
cfg
.
f
syncPeriod
;
cfgRsp
.
walFsyncPeriod
=
pDb
->
cfg
.
walF
syncPeriod
;
cfgRsp
.
walLevel
=
pDb
->
cfg
.
walLevel
;
cfgRsp
.
walLevel
=
pDb
->
cfg
.
walLevel
;
cfgRsp
.
precision
=
pDb
->
cfg
.
precision
;
cfgRsp
.
precision
=
pDb
->
cfg
.
precision
;
cfgRsp
.
compression
=
pDb
->
cfg
.
compression
;
cfgRsp
.
compression
=
pDb
->
cfg
.
compression
;
...
@@ -1521,7 +1521,7 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
...
@@ -1521,7 +1521,7 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
colDataAppend
(
pColInfo
,
rows
,
buf
,
false
);
colDataAppend
(
pColInfo
,
rows
,
buf
,
false
);
}
else
if
(
i
==
3
)
{
}
else
if
(
i
==
3
)
{
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
numOfTables
,
false
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
numOfTables
,
false
);
}
else
if
(
i
==
20
)
{
}
else
if
(
i
==
15
)
{
colDataAppend
(
pColInfo
,
rows
,
statusVstr
,
false
);
colDataAppend
(
pColInfo
,
rows
,
statusVstr
,
false
);
}
else
{
}
else
{
colDataAppendNULL
(
pColInfo
,
rows
);
colDataAppendNULL
(
pColInfo
,
rows
);
...
@@ -1582,21 +1582,9 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
...
@@ -1582,21 +1582,9 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
maxRows
,
false
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
maxRows
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
walLevel
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
fsyncPeriod
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
compression
,
false
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
compression
,
false
);
const
char
*
cacheModelStr
=
getCacheModelStr
(
pDb
->
cfg
.
cacheLast
);
char
cacheModelVstr
[
24
]
=
{
0
};
STR_WITH_SIZE_TO_VARSTR
(
cacheModelVstr
,
cacheModelStr
,
strlen
(
cacheModelStr
));
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
cacheModelVstr
,
false
);
const
char
*
precStr
=
NULL
;
const
char
*
precStr
=
NULL
;
switch
(
pDb
->
cfg
.
precision
)
{
switch
(
pDb
->
cfg
.
precision
)
{
case
TSDB_TIME_PRECISION_MILLI
:
case
TSDB_TIME_PRECISION_MILLI
:
...
@@ -1617,9 +1605,6 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
...
@@ -1617,9 +1605,6 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
precVstr
,
false
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
precVstr
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
numOfStables
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
statusVstr
,
false
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
statusVstr
,
false
);
...
@@ -1631,6 +1616,36 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
...
@@ -1631,6 +1616,36 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
rentensionVstr
,
false
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
rentensionVstr
,
false
);
taosMemoryFree
(
rentensionVstr
);
taosMemoryFree
(
rentensionVstr
);
}
}
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
numOfStables
,
false
);
const
char
*
cacheModelStr
=
getCacheModelStr
(
pDb
->
cfg
.
cacheLast
);
char
cacheModelVstr
[
24
]
=
{
0
};
STR_WITH_SIZE_TO_VARSTR
(
cacheModelVstr
,
cacheModelStr
,
strlen
(
cacheModelStr
));
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
cacheModelVstr
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
cacheLastSize
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
walLevel
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
walFsyncPeriod
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
walRetentionPeriod
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
walRollPeriod
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
walRetentionSize
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
walSegmentSize
,
false
);
}
}
taosMemoryFree
(
buf
);
taosMemoryFree
(
buf
);
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
e4b6fa74
...
@@ -214,7 +214,7 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg
...
@@ -214,7 +214,7 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg
createReq
.
daysToKeep2
=
pDb
->
cfg
.
daysToKeep2
;
createReq
.
daysToKeep2
=
pDb
->
cfg
.
daysToKeep2
;
createReq
.
minRows
=
pDb
->
cfg
.
minRows
;
createReq
.
minRows
=
pDb
->
cfg
.
minRows
;
createReq
.
maxRows
=
pDb
->
cfg
.
maxRows
;
createReq
.
maxRows
=
pDb
->
cfg
.
maxRows
;
createReq
.
fsyncPeriod
=
pDb
->
cfg
.
f
syncPeriod
;
createReq
.
walFsyncPeriod
=
pDb
->
cfg
.
walF
syncPeriod
;
createReq
.
walLevel
=
pDb
->
cfg
.
walLevel
;
createReq
.
walLevel
=
pDb
->
cfg
.
walLevel
;
createReq
.
precision
=
pDb
->
cfg
.
precision
;
createReq
.
precision
=
pDb
->
cfg
.
precision
;
createReq
.
compression
=
pDb
->
cfg
.
compression
;
createReq
.
compression
=
pDb
->
cfg
.
compression
;
...
@@ -286,7 +286,7 @@ void *mndBuildAlterVnodeReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup, int32_
...
@@ -286,7 +286,7 @@ void *mndBuildAlterVnodeReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup, int32_
alterReq
.
daysToKeep0
=
pDb
->
cfg
.
daysToKeep0
;
alterReq
.
daysToKeep0
=
pDb
->
cfg
.
daysToKeep0
;
alterReq
.
daysToKeep1
=
pDb
->
cfg
.
daysToKeep1
;
alterReq
.
daysToKeep1
=
pDb
->
cfg
.
daysToKeep1
;
alterReq
.
daysToKeep2
=
pDb
->
cfg
.
daysToKeep2
;
alterReq
.
daysToKeep2
=
pDb
->
cfg
.
daysToKeep2
;
alterReq
.
fsyncPeriod
=
pDb
->
cfg
.
f
syncPeriod
;
alterReq
.
walFsyncPeriod
=
pDb
->
cfg
.
walF
syncPeriod
;
alterReq
.
walLevel
=
pDb
->
cfg
.
walLevel
;
alterReq
.
walLevel
=
pDb
->
cfg
.
walLevel
;
alterReq
.
strict
=
pDb
->
cfg
.
strict
;
alterReq
.
strict
=
pDb
->
cfg
.
strict
;
alterReq
.
cacheLast
=
pDb
->
cfg
.
cacheLast
;
alterReq
.
cacheLast
=
pDb
->
cfg
.
cacheLast
;
...
...
source/dnode/mnode/impl/test/db/db.cpp
浏览文件 @
e4b6fa74
...
@@ -44,7 +44,7 @@ TEST_F(MndTestDb, 02_Create_Alter_Drop_Db) {
...
@@ -44,7 +44,7 @@ TEST_F(MndTestDb, 02_Create_Alter_Drop_Db) {
createReq
.
daysToKeep2
=
3650
;
createReq
.
daysToKeep2
=
3650
;
createReq
.
minRows
=
100
;
createReq
.
minRows
=
100
;
createReq
.
maxRows
=
4096
;
createReq
.
maxRows
=
4096
;
createReq
.
f
syncPeriod
=
3000
;
createReq
.
walF
syncPeriod
=
3000
;
createReq
.
walLevel
=
1
;
createReq
.
walLevel
=
1
;
createReq
.
precision
=
0
;
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
compression
=
2
;
...
@@ -81,7 +81,7 @@ TEST_F(MndTestDb, 02_Create_Alter_Drop_Db) {
...
@@ -81,7 +81,7 @@ TEST_F(MndTestDb, 02_Create_Alter_Drop_Db) {
alterdbReq
.
daysToKeep0
=
-
1
;
alterdbReq
.
daysToKeep0
=
-
1
;
alterdbReq
.
daysToKeep1
=
-
1
;
alterdbReq
.
daysToKeep1
=
-
1
;
alterdbReq
.
daysToKeep2
=
-
1
;
alterdbReq
.
daysToKeep2
=
-
1
;
alterdbReq
.
f
syncPeriod
=
4000
;
alterdbReq
.
walF
syncPeriod
=
4000
;
alterdbReq
.
walLevel
=
2
;
alterdbReq
.
walLevel
=
2
;
alterdbReq
.
strict
=
1
;
alterdbReq
.
strict
=
1
;
alterdbReq
.
cacheLast
=
1
;
alterdbReq
.
cacheLast
=
1
;
...
@@ -140,7 +140,7 @@ TEST_F(MndTestDb, 03_Create_Use_Restart_Use_Db) {
...
@@ -140,7 +140,7 @@ TEST_F(MndTestDb, 03_Create_Use_Restart_Use_Db) {
createReq
.
daysToKeep2
=
3650
;
createReq
.
daysToKeep2
=
3650
;
createReq
.
minRows
=
100
;
createReq
.
minRows
=
100
;
createReq
.
maxRows
=
4096
;
createReq
.
maxRows
=
4096
;
createReq
.
f
syncPeriod
=
3000
;
createReq
.
walF
syncPeriod
=
3000
;
createReq
.
walLevel
=
1
;
createReq
.
walLevel
=
1
;
createReq
.
precision
=
0
;
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
compression
=
2
;
...
...
source/dnode/mnode/impl/test/sma/sma.cpp
浏览文件 @
e4b6fa74
...
@@ -49,7 +49,7 @@ void* MndTestSma::BuildCreateDbReq(const char* dbname, int32_t* pContLen) {
...
@@ -49,7 +49,7 @@ void* MndTestSma::BuildCreateDbReq(const char* dbname, int32_t* pContLen) {
createReq
.
daysToKeep2
=
3650
*
1440
;
createReq
.
daysToKeep2
=
3650
*
1440
;
createReq
.
minRows
=
100
;
createReq
.
minRows
=
100
;
createReq
.
maxRows
=
4096
;
createReq
.
maxRows
=
4096
;
createReq
.
f
syncPeriod
=
3000
;
createReq
.
walF
syncPeriod
=
3000
;
createReq
.
walLevel
=
1
;
createReq
.
walLevel
=
1
;
createReq
.
precision
=
0
;
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
compression
=
2
;
...
...
source/dnode/mnode/impl/test/stb/stb.cpp
浏览文件 @
e4b6fa74
...
@@ -50,7 +50,7 @@ void* MndTestStb::BuildCreateDbReq(const char* dbname, int32_t* pContLen) {
...
@@ -50,7 +50,7 @@ void* MndTestStb::BuildCreateDbReq(const char* dbname, int32_t* pContLen) {
createReq
.
daysToKeep2
=
3650
;
createReq
.
daysToKeep2
=
3650
;
createReq
.
minRows
=
100
;
createReq
.
minRows
=
100
;
createReq
.
maxRows
=
4096
;
createReq
.
maxRows
=
4096
;
createReq
.
f
syncPeriod
=
3000
;
createReq
.
walF
syncPeriod
=
3000
;
createReq
.
walLevel
=
1
;
createReq
.
walLevel
=
1
;
createReq
.
precision
=
0
;
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
compression
=
2
;
...
...
source/dnode/mnode/impl/test/topic/topic.cpp
浏览文件 @
e4b6fa74
...
@@ -42,7 +42,7 @@ void* MndTestTopic::BuildCreateDbReq(const char* dbname, int32_t* pContLen) {
...
@@ -42,7 +42,7 @@ void* MndTestTopic::BuildCreateDbReq(const char* dbname, int32_t* pContLen) {
createReq
.
daysToKeep2
=
3650
*
1440
;
createReq
.
daysToKeep2
=
3650
*
1440
;
createReq
.
minRows
=
100
;
createReq
.
minRows
=
100
;
createReq
.
maxRows
=
4096
;
createReq
.
maxRows
=
4096
;
createReq
.
f
syncPeriod
=
3000
;
createReq
.
walF
syncPeriod
=
3000
;
createReq
.
walLevel
=
1
;
createReq
.
walLevel
=
1
;
createReq
.
precision
=
0
;
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
compression
=
2
;
...
...
source/dnode/mnode/impl/test/user/user.cpp
浏览文件 @
e4b6fa74
...
@@ -309,7 +309,7 @@ TEST_F(MndTestUser, 03_Alter_User) {
...
@@ -309,7 +309,7 @@ TEST_F(MndTestUser, 03_Alter_User) {
createReq
.
daysToKeep2
=
3650
*
1440
;
createReq
.
daysToKeep2
=
3650
*
1440
;
createReq
.
minRows
=
100
;
createReq
.
minRows
=
100
;
createReq
.
maxRows
=
4096
;
createReq
.
maxRows
=
4096
;
createReq
.
f
syncPeriod
=
3000
;
createReq
.
walF
syncPeriod
=
3000
;
createReq
.
walLevel
=
1
;
createReq
.
walLevel
=
1
;
createReq
.
precision
=
0
;
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
compression
=
2
;
...
...
source/libs/catalog/test/catalogTests.cpp
浏览文件 @
e4b6fa74
...
@@ -103,7 +103,7 @@ void sendCreateDbMsg(void *shandle, SEpSet *pEpSet) {
...
@@ -103,7 +103,7 @@ void sendCreateDbMsg(void *shandle, SEpSet *pEpSet) {
createReq
.
daysToKeep2
=
3650
;
createReq
.
daysToKeep2
=
3650
;
createReq
.
minRows
=
100
;
createReq
.
minRows
=
100
;
createReq
.
maxRows
=
4096
;
createReq
.
maxRows
=
4096
;
createReq
.
f
syncPeriod
=
3000
;
createReq
.
walF
syncPeriod
=
3000
;
createReq
.
walLevel
=
1
;
createReq
.
walLevel
=
1
;
createReq
.
precision
=
0
;
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
compression
=
2
;
...
...
source/libs/command/src/command.c
浏览文件 @
e4b6fa74
...
@@ -225,7 +225,7 @@ static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbFName, S
...
@@ -225,7 +225,7 @@ static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbFName, S
"CREATE DATABASE `%s` BUFFER %d CACHEMODEL %d COMP %d DURATION %dm "
"CREATE DATABASE `%s` BUFFER %d CACHEMODEL %d COMP %d DURATION %dm "
"FSYNC %d MAXROWS %d MINROWS %d KEEP %dm,%dm,%dm PAGES %d PAGESIZE %d PRECISION '%s' REPLICA %d "
"FSYNC %d MAXROWS %d MINROWS %d KEEP %dm,%dm,%dm PAGES %d PAGESIZE %d PRECISION '%s' REPLICA %d "
"STRICT %d WAL %d VGROUPS %d SINGLE_STABLE %d"
,
"STRICT %d WAL %d VGROUPS %d SINGLE_STABLE %d"
,
dbFName
,
pCfg
->
buffer
,
pCfg
->
cacheLast
,
pCfg
->
compression
,
pCfg
->
daysPerFile
,
pCfg
->
f
syncPeriod
,
dbFName
,
pCfg
->
buffer
,
pCfg
->
cacheLast
,
pCfg
->
compression
,
pCfg
->
daysPerFile
,
pCfg
->
walF
syncPeriod
,
pCfg
->
maxRows
,
pCfg
->
minRows
,
pCfg
->
daysToKeep0
,
pCfg
->
daysToKeep1
,
pCfg
->
daysToKeep2
,
pCfg
->
pages
,
pCfg
->
maxRows
,
pCfg
->
minRows
,
pCfg
->
daysToKeep0
,
pCfg
->
daysToKeep1
,
pCfg
->
daysToKeep2
,
pCfg
->
pages
,
pCfg
->
pageSize
,
prec
,
pCfg
->
replications
,
pCfg
->
strict
,
pCfg
->
walLevel
,
pCfg
->
numOfVgroups
,
pCfg
->
pageSize
,
prec
,
pCfg
->
replications
,
pCfg
->
strict
,
pCfg
->
walLevel
,
pCfg
->
numOfVgroups
,
1
==
pCfg
->
numOfStables
);
1
==
pCfg
->
numOfStables
);
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
e4b6fa74
...
@@ -2975,7 +2975,7 @@ static int32_t buildCreateDbReq(STranslateContext* pCxt, SCreateDatabaseStmt* pS
...
@@ -2975,7 +2975,7 @@ static int32_t buildCreateDbReq(STranslateContext* pCxt, SCreateDatabaseStmt* pS
pReq
->
daysToKeep2
=
pStmt
->
pOptions
->
keep
[
2
];
pReq
->
daysToKeep2
=
pStmt
->
pOptions
->
keep
[
2
];
pReq
->
minRows
=
pStmt
->
pOptions
->
minRowsPerBlock
;
pReq
->
minRows
=
pStmt
->
pOptions
->
minRowsPerBlock
;
pReq
->
maxRows
=
pStmt
->
pOptions
->
maxRowsPerBlock
;
pReq
->
maxRows
=
pStmt
->
pOptions
->
maxRowsPerBlock
;
pReq
->
f
syncPeriod
=
pStmt
->
pOptions
->
fsyncPeriod
;
pReq
->
walF
syncPeriod
=
pStmt
->
pOptions
->
fsyncPeriod
;
pReq
->
walLevel
=
pStmt
->
pOptions
->
walLevel
;
pReq
->
walLevel
=
pStmt
->
pOptions
->
walLevel
;
pReq
->
precision
=
pStmt
->
pOptions
->
precision
;
pReq
->
precision
=
pStmt
->
pOptions
->
precision
;
pReq
->
compression
=
pStmt
->
pOptions
->
compressionLevel
;
pReq
->
compression
=
pStmt
->
pOptions
->
compressionLevel
;
...
@@ -3334,7 +3334,7 @@ static void buildAlterDbReq(STranslateContext* pCxt, SAlterDatabaseStmt* pStmt,
...
@@ -3334,7 +3334,7 @@ static void buildAlterDbReq(STranslateContext* pCxt, SAlterDatabaseStmt* pStmt,
pReq
->
daysToKeep0
=
pStmt
->
pOptions
->
keep
[
0
];
pReq
->
daysToKeep0
=
pStmt
->
pOptions
->
keep
[
0
];
pReq
->
daysToKeep1
=
pStmt
->
pOptions
->
keep
[
1
];
pReq
->
daysToKeep1
=
pStmt
->
pOptions
->
keep
[
1
];
pReq
->
daysToKeep2
=
pStmt
->
pOptions
->
keep
[
2
];
pReq
->
daysToKeep2
=
pStmt
->
pOptions
->
keep
[
2
];
pReq
->
f
syncPeriod
=
pStmt
->
pOptions
->
fsyncPeriod
;
pReq
->
walF
syncPeriod
=
pStmt
->
pOptions
->
fsyncPeriod
;
pReq
->
walLevel
=
pStmt
->
pOptions
->
walLevel
;
pReq
->
walLevel
=
pStmt
->
pOptions
->
walLevel
;
pReq
->
strict
=
pStmt
->
pOptions
->
strict
;
pReq
->
strict
=
pStmt
->
pOptions
->
strict
;
pReq
->
cacheLast
=
pStmt
->
pOptions
->
cacheModel
;
pReq
->
cacheLast
=
pStmt
->
pOptions
->
cacheModel
;
...
...
source/libs/parser/test/parAlterToBalanceTest.cpp
浏览文件 @
e4b6fa74
...
@@ -106,7 +106,7 @@ TEST_F(ParserInitialATest, alterDatabase) {
...
@@ -106,7 +106,7 @@ TEST_F(ParserInitialATest, alterDatabase) {
expect
.
daysToKeep0
=
-
1
;
expect
.
daysToKeep0
=
-
1
;
expect
.
daysToKeep1
=
-
1
;
expect
.
daysToKeep1
=
-
1
;
expect
.
daysToKeep2
=
-
1
;
expect
.
daysToKeep2
=
-
1
;
expect
.
f
syncPeriod
=
-
1
;
expect
.
walF
syncPeriod
=
-
1
;
expect
.
walLevel
=
-
1
;
expect
.
walLevel
=
-
1
;
expect
.
strict
=
-
1
;
expect
.
strict
=
-
1
;
expect
.
cacheLast
=
-
1
;
expect
.
cacheLast
=
-
1
;
...
@@ -123,7 +123,7 @@ TEST_F(ParserInitialATest, alterDatabase) {
...
@@ -123,7 +123,7 @@ TEST_F(ParserInitialATest, alterDatabase) {
expect
.
daysToKeep1
=
(
-
1
==
daysToKeep1
?
expect
.
daysToKeep0
:
daysToKeep1
);
expect
.
daysToKeep1
=
(
-
1
==
daysToKeep1
?
expect
.
daysToKeep0
:
daysToKeep1
);
expect
.
daysToKeep2
=
(
-
1
==
daysToKeep1
?
expect
.
daysToKeep1
:
daysToKeep2
);
expect
.
daysToKeep2
=
(
-
1
==
daysToKeep1
?
expect
.
daysToKeep1
:
daysToKeep2
);
};
};
auto
setAlterDbFsync
=
[
&
](
int32_t
fsync
)
{
expect
.
f
syncPeriod
=
fsync
;
};
auto
setAlterDbFsync
=
[
&
](
int32_t
fsync
)
{
expect
.
walF
syncPeriod
=
fsync
;
};
auto
setAlterDbWal
=
[
&
](
int8_t
wal
)
{
expect
.
walLevel
=
wal
;
};
auto
setAlterDbWal
=
[
&
](
int8_t
wal
)
{
expect
.
walLevel
=
wal
;
};
auto
setAlterDbStrict
=
[
&
](
int8_t
strict
)
{
expect
.
strict
=
strict
;
};
auto
setAlterDbStrict
=
[
&
](
int8_t
strict
)
{
expect
.
strict
=
strict
;
};
auto
setAlterDbCacheModel
=
[
&
](
int8_t
cacheModel
)
{
expect
.
cacheLast
=
cacheModel
;
};
auto
setAlterDbCacheModel
=
[
&
](
int8_t
cacheModel
)
{
expect
.
cacheLast
=
cacheModel
;
};
...
@@ -141,7 +141,7 @@ TEST_F(ParserInitialATest, alterDatabase) {
...
@@ -141,7 +141,7 @@ TEST_F(ParserInitialATest, alterDatabase) {
ASSERT_EQ
(
req
.
daysToKeep0
,
expect
.
daysToKeep0
);
ASSERT_EQ
(
req
.
daysToKeep0
,
expect
.
daysToKeep0
);
ASSERT_EQ
(
req
.
daysToKeep1
,
expect
.
daysToKeep1
);
ASSERT_EQ
(
req
.
daysToKeep1
,
expect
.
daysToKeep1
);
ASSERT_EQ
(
req
.
daysToKeep2
,
expect
.
daysToKeep2
);
ASSERT_EQ
(
req
.
daysToKeep2
,
expect
.
daysToKeep2
);
ASSERT_EQ
(
req
.
fsyncPeriod
,
expect
.
f
syncPeriod
);
ASSERT_EQ
(
req
.
walFsyncPeriod
,
expect
.
walF
syncPeriod
);
ASSERT_EQ
(
req
.
walLevel
,
expect
.
walLevel
);
ASSERT_EQ
(
req
.
walLevel
,
expect
.
walLevel
);
ASSERT_EQ
(
req
.
strict
,
expect
.
strict
);
ASSERT_EQ
(
req
.
strict
,
expect
.
strict
);
ASSERT_EQ
(
req
.
cacheLast
,
expect
.
cacheLast
);
ASSERT_EQ
(
req
.
cacheLast
,
expect
.
cacheLast
);
...
...
source/libs/parser/test/parInitialCTest.cpp
浏览文件 @
e4b6fa74
...
@@ -102,7 +102,7 @@ TEST_F(ParserInitialCTest, createDatabase) {
...
@@ -102,7 +102,7 @@ TEST_F(ParserInitialCTest, createDatabase) {
expect
.
cacheLastSize
=
TSDB_DEFAULT_CACHE_SIZE
;
expect
.
cacheLastSize
=
TSDB_DEFAULT_CACHE_SIZE
;
expect
.
compression
=
TSDB_DEFAULT_COMP_LEVEL
;
expect
.
compression
=
TSDB_DEFAULT_COMP_LEVEL
;
expect
.
daysPerFile
=
TSDB_DEFAULT_DAYS_PER_FILE
;
expect
.
daysPerFile
=
TSDB_DEFAULT_DAYS_PER_FILE
;
expect
.
f
syncPeriod
=
TSDB_DEFAULT_FSYNC_PERIOD
;
expect
.
walF
syncPeriod
=
TSDB_DEFAULT_FSYNC_PERIOD
;
expect
.
maxRows
=
TSDB_DEFAULT_MAXROWS_FBLOCK
;
expect
.
maxRows
=
TSDB_DEFAULT_MAXROWS_FBLOCK
;
expect
.
minRows
=
TSDB_DEFAULT_MINROWS_FBLOCK
;
expect
.
minRows
=
TSDB_DEFAULT_MINROWS_FBLOCK
;
expect
.
daysToKeep0
=
TSDB_DEFAULT_KEEP
;
expect
.
daysToKeep0
=
TSDB_DEFAULT_KEEP
;
...
@@ -124,7 +124,7 @@ TEST_F(ParserInitialCTest, createDatabase) {
...
@@ -124,7 +124,7 @@ TEST_F(ParserInitialCTest, createDatabase) {
auto
setDbCachelastSize
=
[
&
](
int8_t
cachelastSize
)
{
expect
.
cacheLastSize
=
cachelastSize
;
};
auto
setDbCachelastSize
=
[
&
](
int8_t
cachelastSize
)
{
expect
.
cacheLastSize
=
cachelastSize
;
};
auto
setDbCompressionFunc
=
[
&
](
int8_t
compressionLevel
)
{
expect
.
compression
=
compressionLevel
;
};
auto
setDbCompressionFunc
=
[
&
](
int8_t
compressionLevel
)
{
expect
.
compression
=
compressionLevel
;
};
auto
setDbDaysFunc
=
[
&
](
int32_t
daysPerFile
)
{
expect
.
daysPerFile
=
daysPerFile
;
};
auto
setDbDaysFunc
=
[
&
](
int32_t
daysPerFile
)
{
expect
.
daysPerFile
=
daysPerFile
;
};
auto
setDbFsyncFunc
=
[
&
](
int32_t
fsyncPeriod
)
{
expect
.
f
syncPeriod
=
fsyncPeriod
;
};
auto
setDbFsyncFunc
=
[
&
](
int32_t
fsyncPeriod
)
{
expect
.
walF
syncPeriod
=
fsyncPeriod
;
};
auto
setDbMaxRowsFunc
=
[
&
](
int32_t
maxRowsPerBlock
)
{
expect
.
maxRows
=
maxRowsPerBlock
;
};
auto
setDbMaxRowsFunc
=
[
&
](
int32_t
maxRowsPerBlock
)
{
expect
.
maxRows
=
maxRowsPerBlock
;
};
auto
setDbMinRowsFunc
=
[
&
](
int32_t
minRowsPerBlock
)
{
expect
.
minRows
=
minRowsPerBlock
;
};
auto
setDbMinRowsFunc
=
[
&
](
int32_t
minRowsPerBlock
)
{
expect
.
minRows
=
minRowsPerBlock
;
};
auto
setDbKeepFunc
=
[
&
](
int32_t
keep0
,
int32_t
keep1
=
0
,
int32_t
keep2
=
0
)
{
auto
setDbKeepFunc
=
[
&
](
int32_t
keep0
,
int32_t
keep1
=
0
,
int32_t
keep2
=
0
)
{
...
@@ -175,7 +175,7 @@ TEST_F(ParserInitialCTest, createDatabase) {
...
@@ -175,7 +175,7 @@ TEST_F(ParserInitialCTest, createDatabase) {
ASSERT_EQ
(
req
.
daysToKeep2
,
expect
.
daysToKeep2
);
ASSERT_EQ
(
req
.
daysToKeep2
,
expect
.
daysToKeep2
);
ASSERT_EQ
(
req
.
minRows
,
expect
.
minRows
);
ASSERT_EQ
(
req
.
minRows
,
expect
.
minRows
);
ASSERT_EQ
(
req
.
maxRows
,
expect
.
maxRows
);
ASSERT_EQ
(
req
.
maxRows
,
expect
.
maxRows
);
ASSERT_EQ
(
req
.
fsyncPeriod
,
expect
.
f
syncPeriod
);
ASSERT_EQ
(
req
.
walFsyncPeriod
,
expect
.
walF
syncPeriod
);
ASSERT_EQ
(
req
.
walLevel
,
expect
.
walLevel
);
ASSERT_EQ
(
req
.
walLevel
,
expect
.
walLevel
);
ASSERT_EQ
(
req
.
precision
,
expect
.
precision
);
ASSERT_EQ
(
req
.
precision
,
expect
.
precision
);
ASSERT_EQ
(
req
.
compression
,
expect
.
compression
);
ASSERT_EQ
(
req
.
compression
,
expect
.
compression
);
...
...
tests/test/c/sdbDump.c
浏览文件 @
e4b6fa74
...
@@ -79,8 +79,6 @@ void dumpDb(SSdb *pSdb, SJson *json) {
...
@@ -79,8 +79,6 @@ void dumpDb(SSdb *pSdb, SJson *json) {
tjsonAddIntegerToObject
(
item
,
"daysToKeep2"
,
pObj
->
cfg
.
daysToKeep2
);
tjsonAddIntegerToObject
(
item
,
"daysToKeep2"
,
pObj
->
cfg
.
daysToKeep2
);
tjsonAddIntegerToObject
(
item
,
"minRows"
,
pObj
->
cfg
.
minRows
);
tjsonAddIntegerToObject
(
item
,
"minRows"
,
pObj
->
cfg
.
minRows
);
tjsonAddIntegerToObject
(
item
,
"maxRows"
,
pObj
->
cfg
.
maxRows
);
tjsonAddIntegerToObject
(
item
,
"maxRows"
,
pObj
->
cfg
.
maxRows
);
tjsonAddIntegerToObject
(
item
,
"fsyncPeriod"
,
pObj
->
cfg
.
fsyncPeriod
);
tjsonAddIntegerToObject
(
item
,
"walLevel"
,
pObj
->
cfg
.
walLevel
);
tjsonAddIntegerToObject
(
item
,
"precision"
,
pObj
->
cfg
.
precision
);
tjsonAddIntegerToObject
(
item
,
"precision"
,
pObj
->
cfg
.
precision
);
tjsonAddIntegerToObject
(
item
,
"compression"
,
pObj
->
cfg
.
compression
);
tjsonAddIntegerToObject
(
item
,
"compression"
,
pObj
->
cfg
.
compression
);
tjsonAddIntegerToObject
(
item
,
"replications"
,
pObj
->
cfg
.
replications
);
tjsonAddIntegerToObject
(
item
,
"replications"
,
pObj
->
cfg
.
replications
);
...
@@ -89,6 +87,12 @@ void dumpDb(SSdb *pSdb, SJson *json) {
...
@@ -89,6 +87,12 @@ void dumpDb(SSdb *pSdb, SJson *json) {
tjsonAddIntegerToObject
(
item
,
"hashMethod"
,
pObj
->
cfg
.
hashMethod
);
tjsonAddIntegerToObject
(
item
,
"hashMethod"
,
pObj
->
cfg
.
hashMethod
);
tjsonAddIntegerToObject
(
item
,
"numOfRetensions"
,
pObj
->
cfg
.
numOfRetensions
);
tjsonAddIntegerToObject
(
item
,
"numOfRetensions"
,
pObj
->
cfg
.
numOfRetensions
);
tjsonAddIntegerToObject
(
item
,
"schemaless"
,
pObj
->
cfg
.
schemaless
);
tjsonAddIntegerToObject
(
item
,
"schemaless"
,
pObj
->
cfg
.
schemaless
);
tjsonAddIntegerToObject
(
item
,
"walLevel"
,
pObj
->
cfg
.
walLevel
);
tjsonAddIntegerToObject
(
item
,
"walFsyncPeriod"
,
pObj
->
cfg
.
walFsyncPeriod
);
tjsonAddIntegerToObject
(
item
,
"walRetentionPeriod"
,
pObj
->
cfg
.
walRetentionPeriod
);
tjsonAddIntegerToObject
(
item
,
"walRetentionSize"
,
pObj
->
cfg
.
walRetentionSize
);
tjsonAddIntegerToObject
(
item
,
"walRollPeriod"
,
pObj
->
cfg
.
walRollPeriod
);
tjsonAddIntegerToObject
(
item
,
"walSegmentSize"
,
pObj
->
cfg
.
walSegmentSize
);
sdbRelease
(
pSdb
,
pObj
);
sdbRelease
(
pSdb
,
pObj
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录