Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b798fbef
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看板
未验证
提交
b798fbef
编写于
12月 08, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
12月 08, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18790 from taosdata/fix/TD-20305-3.0
fix: keep option of database with ns precision
上级
fc0412b6
45528081
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
8 deletion
+14
-8
include/util/tdef.h
include/util/tdef.h
+3
-2
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+11
-6
未找到文件。
include/util/tdef.h
浏览文件 @
b798fbef
...
...
@@ -307,8 +307,9 @@ typedef enum ELogicConditionType {
#define TSDB_MIN_DURATION_PER_FILE 60 // unit minute
#define TSDB_MAX_DURATION_PER_FILE (3650 * 1440)
#define TSDB_DEFAULT_DURATION_PER_FILE (10 * 1440)
#define TSDB_MIN_KEEP (1 * 1440) // data in db to be reserved. unit minute
#define TSDB_MAX_KEEP (365000 * 1440) // data in db to be reserved.
#define TSDB_MIN_KEEP (1 * 1440) // data in db to be reserved. unit minute
#define TSDB_MAX_KEEP (365000 * 1440) // data in db to be reserved.
#define TSDB_MAX_KEEP_NS (365 * 292 * 1440) // data in db to be reserved.
#define TSDB_DEFAULT_KEEP (3650 * 1440) // ten years
#define TSDB_MIN_MINROWS_FBLOCK 10
#define TSDB_MAX_MINROWS_FBLOCK 1000
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
b798fbef
...
...
@@ -3879,12 +3879,17 @@ static int32_t checkDbKeepOption(STranslateContext* pCxt, SDatabaseOptions* pOpt
pOptions
->
keep
[
2
]
=
getBigintFromValueNode
((
SValueNode
*
)
nodesListGetNode
(
pOptions
->
pKeep
,
2
));
}
int64_t
tsdbMaxKeep
=
TSDB_MAX_KEEP
;
if
(
pOptions
->
precision
==
TSDB_TIME_PRECISION_NANO
)
{
tsdbMaxKeep
=
TSDB_MAX_KEEP_NS
;
}
if
(
pOptions
->
keep
[
0
]
<
TSDB_MIN_KEEP
||
pOptions
->
keep
[
1
]
<
TSDB_MIN_KEEP
||
pOptions
->
keep
[
2
]
<
TSDB_MIN_KEEP
||
pOptions
->
keep
[
0
]
>
TSDB_MAX_KEEP
||
pOptions
->
keep
[
1
]
>
TSDB_MAX_KEEP
||
pOptions
->
keep
[
2
]
>
TSDB_MAX_KEEP
)
{
pOptions
->
keep
[
0
]
>
tsdbMaxKeep
||
pOptions
->
keep
[
1
]
>
tsdbMaxKeep
||
pOptions
->
keep
[
2
]
>
tsdbMaxKeep
)
{
return
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_DB_OPTION
,
"Invalid option keep: %"
PRId64
", %"
PRId64
", %"
PRId64
" valid range: [%dm, %dm]"
,
pOptions
->
keep
[
0
],
pOptions
->
keep
[
1
],
pOptions
->
keep
[
2
],
TSDB_MIN_KEEP
,
TSDB_MAX_KEEP
);
tsdbMaxKeep
);
}
if
(
!
((
pOptions
->
keep
[
0
]
<=
pOptions
->
keep
[
1
])
&&
(
pOptions
->
keep
[
1
]
<=
pOptions
->
keep
[
2
])))
{
...
...
@@ -4036,7 +4041,10 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName
TSDB_MAX_MINROWS_FBLOCK
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkDbKeepOption
(
pCxt
,
pOptions
);
code
=
checkDbPrecisionOption
(
pCxt
,
pOptions
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkDbKeepOption
(
pCxt
,
pOptions
);
// use precision
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkDbRangeOption
(
pCxt
,
"pages"
,
pOptions
->
pages
,
TSDB_MIN_PAGES_PER_VNODE
,
TSDB_MAX_PAGES_PER_VNODE
);
...
...
@@ -4049,9 +4057,6 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName
code
=
checkDbRangeOption
(
pCxt
,
"tsdbPagesize"
,
pOptions
->
tsdbPageSize
,
TSDB_MIN_TSDB_PAGESIZE
,
TSDB_MAX_TSDB_PAGESIZE
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkDbPrecisionOption
(
pCxt
,
pOptions
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkDbEnumOption
(
pCxt
,
"replications"
,
pOptions
->
replica
,
TSDB_MIN_DB_REPLICA
,
TSDB_MAX_DB_REPLICA
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录