Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2cfdd234
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
2cfdd234
编写于
7月 12, 2023
作者:
W
wade zhang
提交者:
GitHub
7月 12, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22034 from taosdata/feat/TS-3239
feat/TS-3239/TS-3596: port 'keepTimeOffset' from 2.6 to 3.0
上级
693e34cc
4886cb46
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
123 addition
and
73 deletion
+123
-73
docs/en/14-reference/12-config/index.md
docs/en/14-reference/12-config/index.md
+11
-0
docs/zh/14-reference/12-config/index.md
docs/zh/14-reference/12-config/index.md
+82
-73
include/common/tglobal.h
include/common/tglobal.h
+2
-0
packaging/cfg/taos.cfg
packaging/cfg/taos.cfg
+3
-0
source/common/src/tglobal.c
source/common/src/tglobal.c
+23
-0
source/dnode/vnode/src/tsdb/tsdbUtil.c
source/dnode/vnode/src/tsdb/tsdbUtil.c
+2
-0
未找到文件。
docs/en/14-reference/12-config/index.md
浏览文件 @
2cfdd234
...
...
@@ -722,6 +722,16 @@ The charset that takes effect is UTF-8.
| Value Range | 0: not change; 1: change by modification |
| Default Value | 0 |
### keepTimeOffset
| Attribute | Description |
| ------------- | ------------------------- |
| Applicable | Server Only |
| Meaning | Latency of data migration |
| Unit | hour |
| Value Range | 0-23 |
| Default Value | 0 |
## 3.0 Parameters
| # |
**Parameter**
|
**Applicable to 2.x **
|
**Applicable to 3.0 **
| Current behavior in 3.0 |
...
...
@@ -779,3 +789,4 @@ The charset that takes effect is UTF-8.
| 53 | udf | Yes | Yes | |
| 54 | enableCoreFile | Yes | Yes | |
| 55 | ttlChangeOnWrite | No | Yes | |
| 56 | keepTimeOffset | Yes | Yes | |
docs/zh/14-reference/12-config/index.md
浏览文件 @
2cfdd234
此差异已折叠。
点击以展开。
include/common/tglobal.h
浏览文件 @
2cfdd234
...
...
@@ -48,6 +48,7 @@ extern int32_t tsMaxNumOfDistinctResults;
extern
int32_t
tsCompatibleModel
;
extern
bool
tsPrintAuth
;
extern
int64_t
tsTickPerMin
[
3
];
extern
int64_t
tsTickPerHour
[
3
];
extern
int32_t
tsCountAlwaysReturnValue
;
extern
float
tsSelectivityRatio
;
extern
int32_t
tsTagFilterResCacheSize
;
...
...
@@ -185,6 +186,7 @@ extern bool tsDisableStream;
extern
int64_t
tsStreamBufferSize
;
extern
int64_t
tsCheckpointInterval
;
extern
bool
tsFilterScalarMode
;
extern
int32_t
tsKeepTimeOffset
;
extern
int32_t
tsMaxStreamBackendCache
;
extern
int32_t
tsPQSortMemThreshold
;
...
...
packaging/cfg/taos.cfg
浏览文件 @
2cfdd234
...
...
@@ -108,6 +108,9 @@
# time period of keeping log files, in days
# logKeepDays 0
# unit Hour. Latency of data migration
# keepTimeOffset 0
############ 3. Debug Flag and levels #############################################
...
...
source/common/src/tglobal.c
浏览文件 @
2cfdd234
...
...
@@ -186,6 +186,13 @@ bool tsDeployOnSnode = true;
* TSDB_TIME_PRECISION_NANO: 60000000000L
*/
int64_t
tsTickPerMin
[]
=
{
60000L
,
60000000L
,
60000000000L
};
/*
* millisecond by default
* for TSDB_TIME_PRECISION_MILLI: 3600000L
* TSDB_TIME_PRECISION_MICRO: 3600000000L
* TSDB_TIME_PRECISION_NANO: 3600000000000L
*/
int64_t
tsTickPerHour
[]
=
{
3600000L
,
3600000000L
,
3600000000000L
};
// lossy compress 6
char
tsLossyColumns
[
32
]
=
""
;
// "float|double" means all float and double columns can be lossy compressed. set empty
...
...
@@ -217,6 +224,7 @@ bool tsDisableStream = false;
int64_t
tsStreamBufferSize
=
128
*
1024
*
1024
;
int64_t
tsCheckpointInterval
=
3
*
60
*
60
*
1000
;
bool
tsFilterScalarMode
=
false
;
int32_t
tsKeepTimeOffset
=
0
;
// latency of data migration
#ifndef _STORAGE
int32_t
taosSetTfsCfg
(
SConfig
*
pCfg
)
{
...
...
@@ -537,6 +545,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
if
(
cfgAddInt32
(
pCfg
,
"cacheLazyLoadThreshold"
,
tsCacheLazyLoadThreshold
,
0
,
100000
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"filterScalarMode"
,
tsFilterScalarMode
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"keepTimeOffset"
,
tsKeepTimeOffset
,
0
,
23
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"maxStreamBackendCache"
,
tsMaxStreamBackendCache
,
16
,
1024
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"pqSortMemThreshold"
,
tsPQSortMemThreshold
,
1
,
10240
,
0
)
!=
0
)
return
-
1
;
...
...
@@ -921,6 +930,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
tsCheckpointInterval
=
cfgGetItem
(
pCfg
,
"checkpointInterval"
)
->
i64
;
tsFilterScalarMode
=
cfgGetItem
(
pCfg
,
"filterScalarMode"
)
->
bval
;
tsKeepTimeOffset
=
cfgGetItem
(
pCfg
,
"keepTimeOffset"
)
->
i32
;
tsMaxStreamBackendCache
=
cfgGetItem
(
pCfg
,
"maxStreamBackendCache"
)
->
i32
;
tsPQSortMemThreshold
=
cfgGetItem
(
pCfg
,
"pqSortMemThreshold"
)
->
i32
;
...
...
@@ -1478,6 +1488,19 @@ void taosCfgDynamicOptions(const char *option, const char *value) {
return
;
}
if
(
strcasecmp
(
option
,
"keepTimeOffset"
)
==
0
)
{
int32_t
newKeepTimeOffset
=
atoi
(
value
);
if
(
newKeepTimeOffset
<
0
||
newKeepTimeOffset
>
23
)
{
uError
(
"failed to set keepTimeOffset from %d to %d. Valid range: [0, 23]"
,
tsKeepTimeOffset
,
newKeepTimeOffset
);
return
;
}
uInfo
(
"keepTimeOffset set from %d to %d"
,
tsKeepTimeOffset
,
newKeepTimeOffset
);
tsKeepTimeOffset
=
newKeepTimeOffset
;
return
;
}
const
char
*
options
[]
=
{
"dDebugFlag"
,
"vDebugFlag"
,
"mDebugFlag"
,
"wDebugFlag"
,
"sDebugFlag"
,
"tsdbDebugFlag"
,
"tqDebugFlag"
,
"fsDebugFlag"
,
"udfDebugFlag"
,
"smaDebugFlag"
,
"idxDebugFlag"
,
"tdbDebugFlag"
,
"tmrDebugFlag"
,
"uDebugFlag"
,
...
...
source/dnode/vnode/src/tsdb/tsdbUtil.c
浏览文件 @
2cfdd234
...
...
@@ -542,6 +542,8 @@ int32_t tsdbFidLevel(int32_t fid, STsdbKeepCfg *pKeepCfg, int64_t nowSec) {
ASSERT
(
0
);
}
nowSec
=
nowSec
-
tsKeepTimeOffset
*
tsTickPerHour
[
pKeepCfg
->
precision
];
key
=
nowSec
-
pKeepCfg
->
keep0
*
tsTickPerMin
[
pKeepCfg
->
precision
];
aFid
[
0
]
=
tsdbKeyFid
(
key
,
pKeepCfg
->
days
,
pKeepCfg
->
precision
);
key
=
nowSec
-
pKeepCfg
->
keep1
*
tsTickPerMin
[
pKeepCfg
->
precision
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录